]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: strengthen qcs_send_metadata() usage
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Oct 2024 14:17:03 +0000 (16:17 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 1 Oct 2024 14:17:03 +0000 (16:17 +0200)
This function is reserved for QCS instance where no data was emitted.
A BUG_ON() ensures this by checking that streamdesc buf_list is empty.

However, this condition would not be enough if data were previously
emitted but already fully acknowledged. Thus, extend the condition by
also checking the streamdesc ack_offset is 0.

src/mux_quic.c

index af03eb88144e42ec577a1fcd155f3a1db8898af2..630e98bbc6ecccf603077b527747cb943ba1b341 100644 (file)
@@ -737,7 +737,7 @@ void qcs_send_metadata(struct qcs *qcs)
        /* Reserved for stream with Tx capability. */
        BUG_ON(!qcs->stream);
        /* Cannot use if some data already transferred for this stream. */
-       BUG_ON(!LIST_ISEMPTY(&qcs->stream->buf_list));
+       BUG_ON(qcs->stream->ack_offset || !LIST_ISEMPTY(&qcs->stream->buf_list));
 
        qcs->stream->flags |= QC_SD_FL_OOB_BUF;
 }