Improve timeout handling in Protocols.HTTP.Query
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=7676
Reported by Tobias Liin firstname.lastname@example.org
Protocols.HTTP.Query currently doesn't offer a good way to perform a full request with a timeout.
async_request() is fine but async_fetch() doesn't offer a fail callback.
There is timed_async_fetch() that offers a fail callback, but with the caveat that the entire request must complete within the value of data_timeout. As a code comment states:
// NB: The timeout is currently not reset on each read, so the whole // response has to be read within data_timeout seconds. Is that // intentional? /mast
The module could either:
- Fix timed_async_fetch() to reset the call_out() on each read to make it implement a timeout behavior that most people would expect.
- Keep timed_async_fetch() intact and offer it as an exotic feature, and instead add a fail callback to async_fetch().