event_machine: avoid close on deferred response
authorLin Jen-Shin <godfat@godfat.org>
Tue, 18 Dec 2012 20:03:55 +0000 (04:03 +0800)
committerEric Wong <normalperson@yhbt.net>
Tue, 18 Dec 2012 21:44:19 +0000 (21:44 +0000)
commit42bf1f6de55b82af46fd8255453036c6582b7f19
tree8c5760c9c33d514376e3b553a177f0163be175a1
parentf7f9c6b8470e54e25a17cd1a9517f5030e43fa66
event_machine: avoid close on deferred response

close_connection_after_writing only if not deferred, as in
cool.io

Deferred responses may buffer more data down the line, so
keep the connection alive if we have a deferred response
body.

[ew: clear @deferred when we really want to quit,
 updated commit message]

Acked-by: Eric Wong <normalperson@yhbt.net>
lib/rainbows/event_machine/client.rb