Closed
Description
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 (isNone
), check the body for trailspoll_trailers
.- It might be we want to add some state to the dispatcher like
Wants::TRAILERS
, if we received a request withTE: 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
.
- It might be we want to add some state to the dispatcher like
- Add
proto::h1::Conn::write_trailers()
afterwrite_body()
. The dispatcher would call this. - Add
proto::h1::Encoder::encode_trailers()
that flattens theHeaderMap
into aBuf
.- A few unit tests for encoding trailers in the
encode
file.
- A few unit tests for encoding trailers in the
- A couple tests, at least one in each of
tests/client.rs
andtests/server.rs
that both sides can send trailers.