about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows/rev/client.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/rainbows/rev/client.rb b/lib/rainbows/rev/client.rb
index f9284e8..f854a63 100644
--- a/lib/rainbows/rev/client.rb
+++ b/lib/rainbows/rev/client.rb
@@ -29,18 +29,16 @@ module Rainbows
           begin
             w = @_io.write_nonblock(buf)
             if w == Rack::Utils.bytesize(buf)
-              on_write_complete
-              return w
+              return on_write_complete
             end
             # we never care for the return value, but yes, we may return
             # a "fake" short write from super(buf) if anybody cares.
             buf = buf[w..-1]
           rescue Errno::EAGAIN
-            # fall through to super(buf)
+            break # fall through to super(buf)
           rescue
-            close
-            return
-          end
+            return close
+          end while true
         end
         super(buf)
       end