mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
MINOR: quic: remove unneeded notification of txbuf room
When a stream buffer is freed, qc_stream_desc notify MUX. This is useful if MUX is waiting for Tx buffer allocation. Remove this notification in qc_stream_desc(). This is because the function is called when all stream data have been acknowledged and thus notified. This function can also be called with some data unacknowledged, but in this case this is only true just before connection closure. As such, it is useful to notify the MUX in this condition.
This commit is contained in:
parent
12782da020
commit
4859d8e71d
@ -209,36 +209,32 @@ void qc_stream_desc_free(struct qc_stream_desc *stream, int closing)
|
||||
struct quic_conn *qc = stream->qc;
|
||||
struct eb64_node *frm_node;
|
||||
unsigned int free_count = 0;
|
||||
uint64_t free_size = 0;
|
||||
|
||||
/* This function only deals with released streams. */
|
||||
BUG_ON(!(stream->flags & QC_SD_FL_RELEASE));
|
||||
|
||||
/* free remaining stream buffers */
|
||||
list_for_each_entry_safe(buf, buf_back, &stream->buf_list, list) {
|
||||
if (!(b_data(&buf->buf)) || closing) {
|
||||
free_size += b_size(&buf->buf);
|
||||
if (buf->sbuf)
|
||||
pool_free(pool_head_sbuf, buf->buf.area);
|
||||
else
|
||||
b_free(&buf->buf);
|
||||
LIST_DELETE(&buf->list);
|
||||
pool_free(pool_head_quic_stream_buf, buf);
|
||||
++free_count;
|
||||
}
|
||||
|
||||
/* qc_stream_desc_free() can only be used after all data is
|
||||
* acknowledged or on connection shutdown. In the contrary
|
||||
* case, MUX must be notified about room available.
|
||||
*/
|
||||
BUG_ON(b_data(&buf->buf) && !closing);
|
||||
|
||||
if (buf->sbuf)
|
||||
pool_free(pool_head_sbuf, buf->buf.area);
|
||||
else
|
||||
b_free(&buf->buf);
|
||||
|
||||
LIST_DELETE(&buf->list);
|
||||
pool_free(pool_head_quic_stream_buf, buf);
|
||||
++free_count;
|
||||
}
|
||||
|
||||
if (free_count) {
|
||||
if (free_count)
|
||||
offer_buffers(NULL, free_count);
|
||||
|
||||
if (qc->mux_state == QC_MUX_READY) {
|
||||
if (!(stream->flags & QC_SD_FL_OOB_BUF)) {
|
||||
/* notify MUX about available buffers. */
|
||||
qcc_notify_buf(qc->qcc, free_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* qc_stream_desc might be freed before having received all its ACKs.
|
||||
* This is the case if some frames were retransmitted.
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user