Skip to content

Parse buffered HTTP framing before applying EOF #186

Description

@kentbull

Problem

The HTTP request and response parsers sometimes consult their connection-closed flag before attempting to consume framing bytes that are already buffered. This can reject a complete request start line or header block that arrived with the final read.

The response parser has the inverse problem for some partial framing: a partial status line, 100-Continue header block, or fixed-length body can remain suspended forever after EOF because the checks only treat an empty buffer as premature closure.

Expected behavior

Within the current parser generation:

  • complete buffered start lines, headers, and fixed-length bodies are consumed before EOF is applied;
  • partial buffered framing at EOF settles as PrematureClosure instead of hanging; and
  • existing chunked-body behavior remains unchanged and independently covered.

Proposed regression coverage

Use real Requestant, Respondent, and transport objects to pause at each framing boundary, append the final buffered bytes, latch EOF, and verify both complete and partial cases. No monkey-patched clients or uninitialized objects are required.

Activity

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