From: Amaury Denoyelle Date: Thu, 12 Nov 2026 14:36:05 +0000 (+0100) Subject: BUG/MINOR: h3: fix error code on incomplete request X-Git-Tag: v3.5-dev12~26 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=44340ca85d498eef457a114b51710e5bb35d5a9d;p=haproxy.git BUG/MINOR: h3: fix error code on incomplete request HTTP/3 parser validates that a request has been received when FIN is signalled by the peer on a request stream. FIN signal may be conveyed with an extension frame. In this case, if no header was received, the request is invalid and the stream is closed with an error. This patch simply fixes the reported error code to H3_REQUEST_INCOMPLETE as recommended by RFC 9114 when the issue occurs on the frontend side. H3_MESSAGE_ERROR is kept on the backend side as there is no specific error code defined for an incomplete response. This must be backported up to 2.8. Ensure enum is adapted for 2.8 as the name changed after. --- diff --git a/src/h3.c b/src/h3.c index 278bafccd..f93ceb433 100644 --- a/src/h3.c +++ b/src/h3.c @@ -2326,8 +2326,8 @@ static ssize_t h3_rcv_buf(struct qcs *qcs, struct buffer *b, int fin) if (quic_stream_is_bidi(qcs->id) && last_stream_frame) { /* No header seen, HTTP message is malformed. */ if (h3s->st_req == H3S_ST_REQ_BEFORE) { - TRACE_ERROR("malformed request closed by unknown frame without any header", H3_EV_RX_FRAME, qcs->qcc->conn, qcs); - h3s->err = H3_ERR_MESSAGE_ERROR; + TRACE_ERROR("incomplete request/response closed by unknown frame", H3_EV_RX_FRAME, qcs->qcc->conn, qcs); + h3s->err = !conn_is_back(qcs->qcc->conn) ? H3_ERR_REQUEST_INCOMPLETE : H3_ERR_MESSAGE_ERROR; qcc_report_glitch(qcs->qcc, 1); ret = -1; break;