hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 269 forks source link

#3000: Serialize debug_data when present in GOAWAY frames #673

Closed Herbstein closed 1 year ago

Herbstein commented 1 year ago

Fixes hyperium/hyper#3200

Debug data in GOAWAY frames is opaque information meant for diagnostic purposes. The data was previously read and stored when being received, but was never written during encoding.

This pull request includes the data when encoding the frame but does not add a (stable) way of setting the data. If it is desired I am happy to include it too. I suspect the function added for testing purposes wouldn't be fit for a stable, public API.

Additionally, I've included an integration test as described in the original issue. However, I'm quite sure there is a better way of creating the GOAWAY frame, I'm just not familiar enough with the structure of the integration tests to find it at the moment. With a few pointers I'd like to rewrite how it is done, if needed.