hyperium / h2

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

Stream stacking occurs when H2 processes HTTP2 RST_STREAM frames. #621

Closed silence-coding closed 1 year ago

silence-coding commented 2 years ago

@seanmonstar As described in the issue in hyper, I think the size of the slab should be limited to max_concurrent_streams + max_concurrent_reset_streams . When the size of the slab exceeds the upper limit, the recv_frame method should discard the received Headers and PushPromise frames and send the protocol error to the client. https://github.com/hyperium/hyper/issues/2877

Drop the Headers and PushPromise frames here and throw a GoAway error. https://github.com/hyperium/h2/blob/e4cf88c1a19a7f7823dfaa9eb4c6a19a24f4ead8/src/proto/connection.rs#L460

silence-coding commented 2 years ago

Requests can be provided to users after REST. However, num_reset_streams must be reduced after the request is processed to ensure that max_reset_streams takes effect. https://github.com/hyperium/h2/issues/30

lidong14 commented 2 years ago

@seanmonstar please check this MR

kevinji commented 1 year ago

@silence-coding this should be closed too now that #668 is merged.

seanmonstar commented 1 year ago

Ah yes, thanks for remembering!