The Wayback Machine - https://web.archive.org/web/20201201012610/https://github.com/microsoft/cpprestsdk/pull/762/commits
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of timed out connections kept alive in connection pool under Unix #762

Merged
merged 5 commits into from Aug 3, 2018

Commits on May 8, 2018

  1. 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.
    vadz committed May 8, 2018
  2. 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.
    vadz committed May 8, 2018
  3. 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.
    vadz committed May 8, 2018

Commits on Aug 3, 2018

  1. Reduce duplicate code between ssl_proxy and asio_context in handle_re…

    …ad_status_line.
    
    Avoid increasing public surface with rewind function.
    ras0219-msft committed Aug 3, 2018
You can’t perform that action at this time.