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.
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.