Skip to content

h1: shutdown overwrites Connection options with close #1690

Closed

Description

@FlorentinDUBOIS

Found during review of #1683 and #1687. Measured on main at 3ed6e8a61974b9b1847a9571948cfdea8fabb078.

While Sōzu is shutting down (closing = true), the H1 editor rewrites every Connection value to close — on the request side and on the response side (lib/src/protocol/kawa_h1/editor.rs, the if self.closing branches in on_request_headers and on_response_headers). That drops the other options the line carried, so fields the peer nominated as hop-by-hop (e.g. Connection: x-custom, keep-alive) are forwarded as end-to-end, and Connection: Upgrade is lost. This affects HTTP/1.1 as well as HTTP/1.0; #1683 fixed the same problem for non-persistent HTTP/1.0 responses outside shutdown by merging the options and appending close.

Fix: record the close decision first, then merge the existing options and append close (the approach #1683 uses), on both sides. Decide explicitly what a shutdown does to a request carrying Connection: Upgrade. Tests: editor tests for both sides with closing = true.

Activity

  1. added 2 commits that reference this issue on Sep 29, 2026
    3a74d68
    b606e16
  2. added a commit that references this issue on Sep 29, 2026
    5c7f4dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions