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

http2: release request()'s "connect" event listener after it runs #21916

Closed
wants to merge 1 commit into from

Commits on Jul 28, 2018

  1. http2: release request()'s "connect" event listener after it runs

    The `Http2Session#request()` method internally listens to the "connect"
    event if the session has not yet established a connection so that the
    actual request can be sent after the connection has been established.
    
    This commit removes the event listener after it runs and carries out
    the request and is no longer needed. In practice this shouldn't affect
    the behavior of the session object since the "connect" event fires only
    once anyway, but removing the listener releases its references. The
    rest of this class subscribes to the "connect" event with `once`
    instead of `on` as well.
    
    Tested by adding a new test that ensures `Http2Session#request()` is
    called before the connection is established, indicated by a "connect"
    listener that is run. The test also ensures all "connect" listeners are
    removed after the connection is established.
    ide committed Jul 28, 2018
    Configuration menu
    Copy the full SHA
    2e6649c View commit details
    Browse the repository at this point in the history