about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-26 17:42:55 +0000
committerEric Wong <normalperson@yhbt.net>2011-01-26 17:44:19 +0000
commit7d623489dd51667e0a2eec9d44aec57cb4c5ba44 (patch)
tree59b752ede1308591676ffa8f26d6608bff6fbe4e
parentbc8a71ea4fee6e4ed35dad245511508ac0b7bf4b (diff)
downloadrainbows-7d623489dd51667e0a2eec9d44aec57cb4c5ba44.tar.gz
We should only attempt to modify the descriptor when we
block, and not for subsequent events.
-rw-r--r--lib/rainbows/epoll/client.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb
index 2e45b26..a8eacab 100644
--- a/lib/rainbows/epoll/client.rb
+++ b/lib/rainbows/epoll/client.rb
@@ -147,11 +147,11 @@ module Rainbows::Epoll::Client
       when String
         buf = rv # retry
       when :wait_writable
-        break # queue
+        @wr_queue << buf.dup # >3-word 1.9 strings are copy-on-write
+        return EP.set(self, OUT)
       end while true
     end
     @wr_queue << buf.dup # >3-word 1.9 strings are copy-on-write
-    EP.set(self, OUT)
   end
 
   def close