mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
MINOR: h3: add traces to h3_req_headers_send()
Add traces during HTTP/3 request encoding. This operation is performed on the backend side.
This commit is contained in:
parent
3126cba82e
commit
cbbbf4ea43
16
src/h3.c
16
src/h3.c
@ -2014,6 +2014,8 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx)
|
|||||||
int smallbuf = 1;
|
int smallbuf = 1;
|
||||||
int ret, err, hdr;
|
int ret, err, hdr;
|
||||||
|
|
||||||
|
TRACE_ENTER(H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
|
|
||||||
hdr = 0;
|
hdr = 0;
|
||||||
sl = NULL;
|
sl = NULL;
|
||||||
for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
|
for (blk = htx_get_head_blk(htx); blk; blk = htx_get_next_blk(htx, blk)) {
|
||||||
@ -2033,8 +2035,10 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HTX_BLK_HDR:
|
case HTX_BLK_HDR:
|
||||||
if (unlikely(hdr >= sizeof(list) / sizeof(list[0]) - 1))
|
if (unlikely(hdr >= sizeof(list) / sizeof(list[0]) - 1)) {
|
||||||
|
TRACE_ERROR("too many headers", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
list[hdr].n = htx_get_blk_name(htx, blk);
|
list[hdr].n = htx_get_blk_name(htx, blk);
|
||||||
list[hdr].v = htx_get_blk_value(htx, blk);
|
list[hdr].v = htx_get_blk_value(htx, blk);
|
||||||
@ -2056,9 +2060,12 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx)
|
|||||||
res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) :
|
res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) :
|
||||||
qcc_realloc_stream_txbuf(qcs);
|
qcc_realloc_stream_txbuf(qcs);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
if (err)
|
if (err) {
|
||||||
|
TRACE_ERROR("cannot allocate Tx buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE_STATE("buf window full", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2068,6 +2075,8 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx)
|
|||||||
/* Start the headers after frame type + length */
|
/* Start the headers after frame type + length */
|
||||||
headers_buf = b_make(b_tail(res) + 5, b_contig_space(res) - 5, 0, 0);
|
headers_buf = b_make(b_tail(res) + 5, b_contig_space(res) - 5, 0, 0);
|
||||||
|
|
||||||
|
TRACE_DATA("encoding HEADERS frame", H3_EV_TX_FRAME|H3_EV_TX_HDR,
|
||||||
|
qcs->qcc->conn, qcs);
|
||||||
if (qpack_encode_field_section_line(&headers_buf))
|
if (qpack_encode_field_section_line(&headers_buf))
|
||||||
goto err_full;
|
goto err_full;
|
||||||
|
|
||||||
@ -2170,14 +2179,17 @@ static int h3_req_headers_send(struct qcs *qcs, struct htx *htx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
TRACE_LEAVE(H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
err_full:
|
err_full:
|
||||||
if (smallbuf) {
|
if (smallbuf) {
|
||||||
|
TRACE_DEVEL("retry with a full buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
smallbuf = 0;
|
smallbuf = 0;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
|
TRACE_DEVEL("leaving on error", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user