about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-27 16:55:35 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-27 17:00:04 +0000
commit39f0cf9dcc971369a4618d0320e0a721a9abd4c1 (patch)
tree7220164cbada48d5cb4f4dc511afc070913fcf8a /lib
parent9f639eb257f7b940f16016bf548c532dc09e4911 (diff)
downloadrainbows-39f0cf9dcc971369a4618d0320e0a721a9abd4c1.tar.gz
When proxying pipes/sockets, it's possible for the Rev::IO#write
to fail and close our connection.  In that case we do not want
our client to continue with the on_write_complete callback.
Diffstat (limited to 'lib')
-rw-r--r--lib/rainbows/rev/deferred_response.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/rev/deferred_response.rb b/lib/rainbows/rev/deferred_response.rb
index 7e00918..7420631 100644
--- a/lib/rainbows/rev/deferred_response.rb
+++ b/lib/rainbows/rev/deferred_response.rb
@@ -14,7 +14,7 @@ class Rainbows::Rev::DeferredResponse < ::Rev::IO
   end
 
   def on_close
-    @client.next!
+    @client.next! if @client.attached? # attached? is false if write fails
     @body.respond_to?(:close) and @body.close
   end
 end