Skip to content

fix(mux): a half-closed TLS H1 client loses the end of a large response #1779

Closed

Description

@FlorentinDUBOIS

A TLS HTTP/1.1 client that sends its request and then half-closes its connection (shutdown(SHUT_WR)) can lose the end of a large response: responses of 3 MiB and more are observed truncated (around 2.75 MB or 4.3 MB), sometimes ending in a reset.

Mux::delay_close_for_frontend_flush (lib/src/protocol/mux/mod.rs) queues the TLS close_notify as soon as the frontend HUP is seen, and a HUP with nothing pending closes the session on entry to Mux::ready_inner, while the response is still being produced. A half-close only ends the client's sending side (RFC 9293 §3.6); the response must still be delivered whole.

The H2 test e2e_session_tls_client_fin_not_truncated passes only because it sleeps 200 ms before half-closing.

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