]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2/traces: present the correct buffer for trailers errors traces
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Oct 2024 13:39:52 +0000 (15:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Oct 2024 14:29:15 +0000 (16:29 +0200)
The local "rxbuf" buffer was passed to the trace instead of h2s->rxbuf
that is used when decoding trailers. The impact is essentially the
impossibility to present some buffer contents in some rare cases. It
may be backported but it's unlikely that anyone will ever notice the
difference.

src/mux_h2.c

index 7ed33c912e2338ad7a0b8bf58e2ea3b0d98a0745..93066eb06e6cdd7853f95d0cce3e95dd3e5fdfbf 100644 (file)
@@ -2910,7 +2910,7 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s)
                        error = h2c_dec_hdrs(h2c, &h2s->rxbuf, &h2s->flags, &body_len, NULL);
                        /* unrecoverable error ? */
                        if (h2c->st0 >= H2_CS_ERROR) {
-                               TRACE_USER("Unrecoverable error decoding H2 trailers", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, 0, &rxbuf);
+                               TRACE_USER("Unrecoverable error decoding H2 trailers", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, 0, &h2s->rxbuf);
                                sess_log(h2c->conn->owner);
                                goto out;
                        }
@@ -2928,7 +2928,7 @@ static struct h2s *h2c_frt_handle_headers(struct h2c *h2c, struct h2s *h2s)
                                 */
                                sess_log(h2c->conn->owner);
                                h2s_error(h2s, H2_ERR_INTERNAL_ERROR);
-                               TRACE_USER("Stream error decoding H2 trailers", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, 0, &rxbuf);
+                               TRACE_USER("Stream error decoding H2 trailers", H2_EV_RX_FRAME|H2_EV_RX_HDR|H2_EV_STRM_NEW|H2_EV_STRM_END, h2c->conn, 0, &h2s->rxbuf);
                                h2c->st0 = H2_CS_FRAME_E;
                                goto out;
                        }