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

Simplify the closing handshake #1902

Closed
wants to merge 3 commits into from
Closed

Commits on Jun 24, 2021

  1. [minor] Simplify the closing handshake

    - When the socket emits the `'end'` event, do not call `socket.end()`.
      End only the `receiver` stream.
    - Do not wait for a close frame to be received and sent before calling
      `socket.end()`. Call it right after the close frame is written.
    - When the `receiver` stream emits `'finish'`, send a close frame if no
      close frame is received.
    
    The assumption is that the socket is allowed to be half-open. On the
    server side this is always true (unless the user explicitly sets the
    `allowHalfOpen` property of the socket to `false`). On the client side
    the user might use an agent so we set `socket.allowHalfOpen` to `true`
    when the `http.ClientRequest` object emits the `'upgrade'` event.
    
    Refs: #1899
    lpinca committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    916adf5 View commit details
    Browse the repository at this point in the history
  2. [fix] Do not unconditionally set the ready state to -2

    If we're already closing, then we shouldn't move into the new -2 ready
    state (i.e. closing-because-the-remote-end-closed). We're already
    closing, we shouldn't go back to a state that allows sending another
    close frame.
    pimterry authored and lpinca committed Jun 24, 2021
    Configuration menu
    Copy the full SHA
    e83f377 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1d923fa View commit details
    Browse the repository at this point in the history