event_machine: better handling of staggered pipelines
commitf309cfaf70cbffd7a39208da869e47784e4cb41b
authorEric Wong <normalperson@yhbt.net>
Wed, 28 Jul 2010 11:20:46 +0000 (28 11:20 +0000)
committerEric Wong <normalperson@yhbt.net>
Wed, 28 Jul 2010 11:30:38 +0000 (28 11:30 +0000)
tree3ede259f73e09381fe4cd645d2f1763c1b6dcadc
parentd3ecf49abeda931e23023e1afb93d4c6145f559a
event_machine: better handling of staggered pipelines

Since TCP sockets stream, HTTP requests do not come in at
well-defined boundaries and it's possible for pipelined requests
to come in in a staggered form.  We need to ensure our
receive_data callback doesn't fire any actions at all while
responding with a deferrable @body.

We still need to be careful about buffering, since EM does not
appear to allow temporarily disabling read events (without
pausing writes), so we shutdown the read end of the socket
if it reaches a maximum header size limit.
lib/rainbows/event_machine.rb
t/t0024-pipelined-sendfile-response.sh