Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending HTTP/1.1 trailers #2719

Closed
Tracked by #2702
seanmonstar opened this issue Dec 10, 2021 · 1 comment · Fixed by #3375
Closed
Tracked by #2702

Sending HTTP/1.1 trailers #2719

seanmonstar opened this issue Dec 10, 2021 · 1 comment · Fixed by #3375
Labels
A-http1 Area: HTTP/1 specific. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.

Comments

@seanmonstar
Copy link
Member

seanmonstar commented Dec 10, 2021

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.
@seanmonstar seanmonstar mentioned this issue Dec 10, 2021
2 tasks
@seanmonstar seanmonstar added A-http1 Area: HTTP/1 specific. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. C-feature Category: feature. This is adding a new feature. labels Dec 10, 2021
@seanmonstar
Copy link
Member Author

@Xuanwo I've updated the issue above to include a list of things I think that needs to be done. If anything is missing, we can add more instructions here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-http1 Area: HTTP/1 specific. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant