avoid EBADF with certain middlewares when proxying
commitac05e7035e1946b78ce4679548db7680aa01734c
authorEric Wong <normalperson@yhbt.net>
Tue, 17 Aug 2010 08:35:03 +0000 (17 08:35 +0000)
committerEric Wong <normalperson@yhbt.net>
Tue, 17 Aug 2010 08:41:15 +0000 (17 08:41 +0000)
tree1379997b2686b9fa777216ad06f1ffe9be5b6027
parent9c5669e232f8f57c2d8e08d84e21bf09cd87bfa1
avoid EBADF with certain middlewares when proxying

First off we use an FD_MAP to avoid creating redundant IO
objects which map to the same FD.  When that doesn't work, we'll
fall back to trapping Errno::EBADF and IOError where
appropriate.
lib/rainbows.rb
lib/rainbows/dev_fd_response.rb
lib/rainbows/response/body.rb
t/close-pipe-to_path-response.ru [new file with mode: 0644]
t/t0032-close-pipe-to_path-response.sh [new file with mode: 0755]