From: Willy Tarreau Date: Mon, 16 Oct 2017 16:34:34 +0000 (+0200) Subject: MINOR: h2: handle two extra stream states for errors X-Git-Tag: v1.8-rc1~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96060bad266b9b402d3ea79ec84419f3e0c4fed4;p=thirdparty%2Fhaproxy.git MINOR: h2: handle two extra stream states for errors We need to deal with stream error notifications (RST_STREAM) as well as internal reporting. The problem is that we don't know in which order this will be done so we can't unilaterally decide to deallocate the stream. In order to help, we add two extra stream states, H2_SS_ERROR and H2_SS_RESET. The former mentions that the stream has an error pending and the latter indicates that the error was already sent and that the stream is now closed. It's equivalent to H2_SS_CLOSED except that in this state we'll avoid sending new RST_STREAM as per RFC7540#5.4.2. With this it will be possible to only detach or deallocate the h2s once the stream is closed. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index ba3b6af636..9004758f68 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -87,6 +87,8 @@ enum h2_ss { H2_SS_OPEN, // open H2_SS_HREM, // half-closed(remote) H2_SS_HLOC, // half-closed(local) + H2_SS_ERROR, // an error needs to be sent using RST_STREAM + H2_SS_RESET, // closed after sending RST_STREAM H2_SS_CLOSED, // closed H2_SS_ENTRIES // must be last } __attribute__((packed));