]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: fix some wrong error codes on connections
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 10:08:28 +0000 (11:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 10:08:28 +0000 (11:08 +0100)
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.

src/mux_h2.c

index 7e80dca0462becc4fca63148002ae6643687c6d6..fbd042bad302b999e9773081751ce87dc3f4e77f 100644 (file)
@@ -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;