BUG/MINOR: quic: do not alloc buf count on alloc failure
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 May 2023 14:52:48 +0000 (16:52 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 12 May 2023 13:55:41 +0000 (15:55 +0200)
commit50fe00650f5a874a69a321ff371f8b2ee6f61403
tree85528b35e6d401defe07b2d15d77e11820c266f7
parentd00b3093c9c60883e3abe96dcd521e670731ac84
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.
src/quic_stream.c