BUG/MINOR: mux-h2: only update rxbuf's length for H1 headers

In h2c_decode_headers() we update the buffer's length according to the
amount of data produced (outlen). But in case of HTX this outlen value
is not a quantity, just an indicator of success, resulting in the buffer
being added one extra byte and temporarily showing .data > .size, which
is wrong. Fortunately this is overridden when leaving the function by
htx_to_buf() so the impact only exists in step-by-step debugging, but
it definitely needs to be fixed.

This must be backported to 1.9.
This commit is contained in:
Willy Tarreau 2019-01-03 10:26:23 +01:00
parent 45ffc0ca34
commit 8319593005

View File

@ -3344,6 +3344,8 @@ next_frame:
} else {
/* HTTP/1 mode */
outlen = h2_make_h1_request(list, b_tail(rxbuf), try, &msgf);
if (outlen > 0)
b_add(rxbuf, outlen);
}
if (outlen < 0) {
@ -3363,7 +3365,6 @@ next_frame:
b_del(&h2c->dbuf, h2c->dfl + hole);
hole = 0;
h2c->st0 = H2_CS_FRAME_H;
b_add(rxbuf, outlen);
if (htx && h2c->dff & H2_F_HEADERS_END_STREAM)
htx_add_endof(htx, HTX_BLK_EOM);