MINOR: mux-h2: Set REFUSED_STREAM error to reset a stream if no data was never sent
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Mar 2019 14:51:33 +0000 (15:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 18 Mar 2019 14:50:23 +0000 (15:50 +0100)
commit35757d38ce35002f4d578c2bf88277053b7cd344
tree6b310da3021f82fe5be333fd073533cf007f9d04
parentf02ca00a36b4bd43a783973e05690594bcf9b92b
MINOR: mux-h2: Set REFUSED_STREAM error to reset a stream if no data was never sent

According to the H2 spec (see #8.1.4), setting the REFUSED_STREAM error code
is a way to indicate that the stream is being closed prior to any processing
having occurred, such as when a server-side H1 keepalive connection is closed
without sending anything (which differs from the regular error case since
haproxy doesn't even generate an error message). Any request that was sent on
the reset stream can be safely retried. So, when a stream is closed, if no
data was ever sent back (ie. the flag H2_SF_HEADERS_SENT is not set), we can
set the REFUSED_STREAM error code on the RST_STREAM frame.

This patch may be backported to 1.9.
src/mux_h2.c