From: Willy Tarreau Date: Tue, 7 Nov 2017 10:08:28 +0000 (+0100) Subject: BUG/MEDIUM: h2: fix some wrong error codes on connections X-Git-Tag: v1.8-rc3~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d8e4af46acbfad03cd813d7349ffbb9262d5539;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: h2: fix some wrong error codes on connections When the assignment of the connection state was moved into h2c_error(), 3 of them were missed because they were wrong, using H2_SS_ERROR instead. This resulted in the connection's state being set to H2_CS_ERROR2 in fact, so the error was not properly sent. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 7e80dca046..fbd042bad3 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1731,7 +1731,6 @@ static void h2_process_demux(struct h2c *h2c) case H2_FT_PUSH_PROMISE: /* not permitted here, RFC7540#5.1 */ h2c_error(h2c, H2_ERR_PROTOCOL_ERROR); - h2c->st0 = H2_SS_ERROR; break; /* implement all extra frame types here */ @@ -2316,7 +2315,6 @@ static int h2_frt_decode_headers(struct h2s *h2s, struct buffer *buf, int count) if (*hdrs >= flen) { /* RFC7540#6.2 : pad length = length of frame payload or greater */ h2c_error(h2c, H2_ERR_PROTOCOL_ERROR); - h2c->st0 = H2_SS_ERROR; return 0; } flen -= *hdrs + 1; @@ -2430,7 +2428,6 @@ static int h2_frt_transfer_data(struct h2s *h2s, struct buffer *buf, int count) if (padlen >= flen) { /* RFC7540#6.1 : pad length = length of frame payload or greater */ h2c_error(h2c, H2_ERR_PROTOCOL_ERROR); - h2c->st0 = H2_SS_ERROR; return 0; } flen -= padlen + 1;