Supervisor/supervisor — pull request #115 by philz (2012-05-04 04:35:08+00:00)
Title: deferring_http_channel.delay is not reset appropriately

https://github.com/Supervisor/supervisor/issues/112

In deferring_http_channel.refill_buffer(), if the underlying callback returns
NOT_DONE_YET, the channel's "delay" field is set to match the callback's delay.
But later, when the callback is done, the delay is not reset.

The issue this was causing for me is that, later on, when a different callback
that returned a lot of data was being executed, unnecessary delays were being
added: 4k of data would be sent, then the code would go back to the main loop,
where, because of the delay, the channel would not be added to the writer fd
set; so it would instead delay the writing of the next 4k of data another whole
second, since that's the timeout hardcoded in the main loop.

Since the reply supervisor was trying to send spanned several 4k packets, it
was taking several seconds to send a reply that was already computed in memory.