Skip to content

[Upload 20MB] Implementation rules #603

@remittor

Description

@remittor

Rules:
https://www.http-arena.com/docs/test-profiles/h1/isolated/upload/implementation/#implementation-rules

The upload endpoint must actually read and process the request body. The returned byte count must be computed by reading the uploaded data, not inferred from request metadata.

  • Do not return the value of the Content-Length header - this defeats the purpose of the test, which is to measure how efficiently the framework processes uploaded content.
  • Frameworks may use small read buffers to process the upload incrementally. Holding the entire payload in memory is allowed but not required.
  • The goal is to prove that the framework can efficiently compute a result over a large blob being sent to it.

HTTP engines are divided into two categories:

  1. server loads the headers and immediately calls the user handler, to which it passes an object through which the user can read the body in parts, or the entire body at once up to the EOF.
  2. server loads the headers and the request body completely into memory and only after that launches the user handler, to which it passes a pointer to a buffer containing the entire request body (already cleared of chunk headers, if exist TE-header).

In the first case, the rules are correct.
But in the second case, the rules force rereading data and creating unnecessary buffers. In the second case, the user handler immediately has access to any part of the request body and doesn't need to read it from beginning to end — it can work with any part of the body immediately.

Therefore, the rules need to be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsAbout test design, issues with tests etc.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions