event_machine: fix pipelining of static files
commit71ecfee987f13ba447abe97cac14274f38ff70f4
authorEric Wong <normalperson@yhbt.net>
Tue, 27 Jul 2010 06:36:07 +0000 (27 06:36 +0000)
committerEric Wong <normalperson@yhbt.net>
Tue, 27 Jul 2010 07:00:55 +0000 (27 07:00 +0000)
tree9c255960dca3fa1440ff024f85fec5ce93142687
parent052e2b3608071d9cd9d6b1d12f8cb69ac29124af
event_machine: fix pipelining of static files

EM::FileStreamer writes may be intermingled with the headers
in the subsequent response if we enable processing of the
second pipelined response right away, so wait until the
first response is complete before hitting the second one.

This also avoids potential deep stack recursion in the unlikely
case where too many requests are pipelined.
lib/rainbows/event_machine.rb
lib/rainbows/event_machine/response_pipe.rb
t/t0024-pipelined-sendfile-response.sh