mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-17 04:26:59 +00:00
BUG/MINOR: quic: do not alloc buf count on alloc failure
The total number of buffer per connection for sending is limited by a configuration value. To ensure this, <stream_buf_count> quic_conn field is incremented on qc_stream_buf_alloc(). qc_stream_buf_alloc() may fail if the buffer cannot be allocated. In this case, <stream_buf_count> should not be incremented. To fix this, simply move increment operation after buffer allocation. The impact of this bug is low. However, if a connection suffers from several buffer allocation failure, it may cause the <stream_buf_count> to be incremented over the limit without being able to go back down. This must be backported up to 2.6.
This commit is contained in:
parent
d00b3093c9
commit
50fe00650f
@ -241,13 +241,13 @@ struct buffer *qc_stream_buf_alloc(struct qc_stream_desc *stream,
|
||||
if (!qc_stream_buf_avail(qc))
|
||||
return NULL;
|
||||
|
||||
++qc->stream_buf_count;
|
||||
|
||||
stream->buf_offset = offset;
|
||||
stream->buf = pool_alloc(pool_head_quic_stream_buf);
|
||||
if (!stream->buf)
|
||||
return NULL;
|
||||
|
||||
++qc->stream_buf_count;
|
||||
|
||||
stream->buf->buf = BUF_NULL;
|
||||
LIST_APPEND(&stream->buf_list, &stream->buf->list);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user