From 39f0cf9dcc971369a4618d0320e0a721a9abd4c1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 27 Jul 2010 16:55:35 +0000 Subject: rev/client: workaround close ordering issue when proxying 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. --- lib/rainbows/rev/deferred_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3-24-ge0c7