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

swarm/one_shot: Initialize handler with KeepAlive::Until #1698

Merged
merged 5 commits into from
Aug 13, 2020

Commits on Aug 12, 2020

  1. swarm/one_shot: Add test for not keeping alive idle connection

    A `OneShotHandler` without any ongoing requests should not keep the
    underlying connection alive indefinitely.
    mxinden committed Aug 12, 2020
    Configuration menu
    Copy the full SHA
    1edbd67 View commit details
    Browse the repository at this point in the history
  2. swarm/one_shot: Initialize handler with KeepAlive::Until

    The `OneShotHandler` `keep_alive` property is altered on incoming and
    outgoing reqeusts. By default it is initialized in `KeepAlive::Yes`. In
    case there are no incoming or outgoing requests happening, this state is
    never changed and thus the handler keeps the underlying connection alive
    indefinitely.
    
    With this commit the handler is initialized with `KeepAlive::Until`. As
    before the `keep_alive` timer is updated on incoming requests and set to
    `KeepAlive::Yes` on outgoing requests.
    mxinden committed Aug 12, 2020
    Configuration menu
    Copy the full SHA
    41e310f View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2020

  1. swarm/one_shot: Move KeepAlive logic to poll

    A `ProtocolsHandler` can be created before the underlying connection is
    established. Thus setting a keep alive timeout might be problematic.
    Instead set `keep_alive` to `Yes` at construction and alter it within
    `ProtocolsHandler::poll`.
    mxinden committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    b409252 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cdfe1c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cc04b5b View commit details
    Browse the repository at this point in the history