about summary refs log tree commit homepage
path: root/lib/rainbows/stream_response_epoll
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2012-05-09 02:18:08 +0000
committerEric Wong <normalperson@yhbt.net>2012-05-09 02:18:08 +0000
commitbbd55c8bcd0d2833c99a2c23856ff07be7f46f9a (patch)
tree2e02524ffed199460cf3ac0d72b7869bdb94c09e /lib/rainbows/stream_response_epoll
parent9573d9bc6c63aced28300a9d7346b5575eed8b7d (diff)
downloadrainbows-bbd55c8bcd0d2833c99a2c23856ff07be7f46f9a.tar.gz
unicorn 4.3.x now calls shutdown() explicitly on the socket,
so we can't just rely on a dup()-ed FD to keep a socket around.
Diffstat (limited to 'lib/rainbows/stream_response_epoll')
-rw-r--r--lib/rainbows/stream_response_epoll/client.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rainbows/stream_response_epoll/client.rb b/lib/rainbows/stream_response_epoll/client.rb
index cf3056e..db303b0 100644
--- a/lib/rainbows/stream_response_epoll/client.rb
+++ b/lib/rainbows/stream_response_epoll/client.rb
@@ -19,7 +19,7 @@ class Rainbows::StreamResponseEpoll::Client
 
   def initialize(io, unwritten)
     @closed = false
-    @to_io = io.dup
+    @to_io = io
     @wr_queue = [ unwritten.dup ]
     EP.set(self, OUT)
   end
@@ -50,6 +50,7 @@ class Rainbows::StreamResponseEpoll::Client
 
   def on_write_complete
     if @closed
+      @to_io.shutdown
       @to_io.close
       N.decr(0, 1)
     end