brunodecarvalho/http-client — pull request #6 by brunodecarvalho (2013-05-14 18:54:38+00:00)
Title: Cleanup connection on timeout

Differentiates between `failedWithCause` and `failedWhileHandlingResponse`.

* Renames `failedWithCause(Throwable, HttpResponse)` to `failedWhileProcessingContent(Throwable, HttpResponse)`. The latter is only called if an exception is raised while processing content and thus doesn't need to perform any cleanup on the connection itself.

* `failedWithCause` now includes code to terminate the connection if it is still marked as available when this even happens.

* Updates specs to match this change

* Adds tests to ensure the request queue keeps flowing and executing queued requests if a request times out.