BUG/MINOR: mux-quic: support nul buffer with qc_free_ncbuf()
qc_free_ncbuf() may now be used with a NCBUF_NULL buffer as parameter.
This is useful when using this function on a QCS with no allocated
buffer. This case was not reproduced for the moment, but it will soon
become more present as buffers will be released if emptied.
Also a call to offer_buffers() is added to conform with the dynamic
buffer management of haproxy.
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 68b2bd8..6cc7756 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -189,8 +189,12 @@
{
struct buffer buf;
+ if (ncb_is_null(ncbuf))
+ return;
+
buf = b_make(ncbuf->area, ncbuf->size, 0, 0);
b_free(&buf);
+ offer_buffers(NULL, 1);
*ncbuf = NCBUF_NULL;
}