The following commit implements for QUIC transcoders a realloc operation
when a smallbuf is not sufficient to encode headers. This is available
via qcc_realloc_stream_txbuf() function.
0d6112b40b20f9eea0cf38dc304bc1155b673588
MINOR: mux-quic: retry after small buf alloc failure
However, an alloc failure of this function was considered as a transient
error, with 0 returned in this case. Fix this so that it is now a fatal
error which will trigger the connection closure, which is the correct
handling for memory allocation issues in QUIC MUX layer.
This must be backported up to 3.2. Note that the chunk relative to
h3_req_headers_send() is specific for QUIC backend usage and must only
be picked on 3.3 and above.
res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) :
qcc_realloc_stream_txbuf(qcs);
if (!res) {
- if (err) {
+ /* detect alloc failure for qcc_get_stream_txbuf() / qcc_realloc_stream_txbuf() */
+ if (!smallbuf || err) {
TRACE_ERROR("cannot allocate Tx buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
goto err;
}
res = smallbuf ? qcc_get_stream_txbuf(qcs, &err, 1) :
qcc_realloc_stream_txbuf(qcs);
if (!res) {
- if (err) {
+ /* detect alloc failure for qcc_get_stream_txbuf() / qcc_realloc_stream_txbuf() */
+ if (!smallbuf || err) {
TRACE_ERROR("cannot allocate Tx buffer", H3_EV_TX_FRAME|H3_EV_TX_HDR, qcs->qcc->conn, qcs);
goto err;
}