Skip to content

Sending HTTP/1.1 trailers #2719

Closed
Closed
@seanmonstar

Description

@seanmonstar

Here's a list of pieces needed to make this work:

  • Update proto::h1::Dispatcher::poll_write() so that when all data items are done (is None), check the body for trails poll_trailers.
    • It might be we want to add some state to the dispatcher like Wants::TRAILERS, if we received a request with TE: trailers. This could be useful to skip checking for trailers if the request never said it supports them.
    • It's likely that new state will need to be added, in case the data is done, but polling the trailers is Pending.
  • Add proto::h1::Conn::write_trailers() after write_body(). The dispatcher would call this.
  • Add proto::h1::Encoder::encode_trailers() that flattens the HeaderMap into a Buf.
    • A few unit tests for encoding trailers in the encode file.
  • A couple tests, at least one in each of tests/client.rs and tests/server.rs that both sides can send trailers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-http1Area: HTTP/1 specific.C-featureCategory: feature. This is adding a new feature.E-mediumEffort: medium. Some knowledge of how hyper internal works would be useful.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions