nitely / nim-hyperx

Pure Nim http2 client and server 🖖
MIT License
24 stars 0 forks source link

Send RstStream Refused_Stream on exceeded concurrent streams instead of GoAway #10

Closed nitely closed 4 months ago

nitely commented 4 months ago

Sending a RST frame of refused stream error here does nothing, because we need to send a conn error for closed streams when receiving headers/data frames. So a client will send headers followed by data without waiting for any frame (they don't know a RST frame error is coming), and then get an RST frame followed by a GoAway + connection close.

Keeping track of first refused stream and resetting when a stream is finally open won't do, because a quick refuse+open alternation will only work for the last refused stream, and the client may sometimes get RST frames and sometimes GoAway frames.

We could keep track of last N refused streams in a queue, and avoid GoAways for those. The other way around of keeping opened streams won't work because we need to ensure we send GoAway for actually closed streams always if we get headers/data for those.

Sending GoAways instead of RST frames is always allowed by the spec.

nitely commented 4 months ago

Closing because I didn't intend to "fix" this (sending GoAway is ok). This issue was merely for the record.