You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix handling of timed out connections kept alive in connection pool under Unix (#762)
* Add asio_connection::was_closed_by_server() to reduce duplication
Reduce code duplication between ssl_proxy_tunnel::handle_status_line()
and the method with the same name in asio_context itself by moving the
common handling of connections closed by server into a new function.
No real changes, this is a pure refactoring.
* Fix checking for server-side closure of HTTPS connections
When an SSL connection times out due to being closed by server, a
different error code is returned, so we need to check for it too in
was_closed_by_server().
Without this, losing connection was not detected at all when using
HTTPS, resulting in "Failed to read HTTP status line" errors whenever
the same http_client was reused after more than the server keep alive
timeout of inactivity.
See #592.
* Fix bug with using re-opened connections with ASIO
Creating a new request when the existing connection being used was
closed by the server didn't work correctly because the associated input
stream was already exhausted, as its contents had been already "sent" to
the server using the now discarded connection, so starting a new request
using the same body stream never worked.
Fix this by explicitly rewinding the stream to the beginning before
using it again.
Note that even with this fix using a custom body stream which is not
positioned at the beginning initially (or which doesn't support
rewinding) still wouldn't work, but at least it fixes the most common
use case.
See #592.
* Reduce duplicate code between ssl_proxy and asio_context in handle_read_status_line.
Avoid increasing public surface with rewind function.
0 commit comments