]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: chunk: Review chunks usage to not retrieve a large buffer by error
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Jul 2026 14:34:24 +0000 (16:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Jul 2026 06:52:06 +0000 (08:52 +0200)
commitac37158a6db7db31e0f7943f57cf0e2efa5e38ae
tree3b5dc5f22025e3ea9209ff547f0da542baf5ca75
parent2b993de2dafdc3584c06fd56612a7c647627135b
BUG/MEDIUM: chunk: Review chunks usage to not retrieve a large buffer by error

All calls to get_trash_chunk_sz() and alloc_trash_chunk_sz() were reviewed
to be sure we never retrieve a large chunk when it is not expected. Some
calls were not upgrade, but several calls now rely on get_best_trash_chunk()
and alloc_best_trash_chunk() functions.

The idea of the fix is to get a large buffer only when the original buffer
is already a large buffer and the expected size of data exceeds the size of
a regular buffer. This should prevent unexpected memory usage.

This commit relies on the previous one:

  MINOR: chunk: Add function to get a large/regular chunk depending on a buffer

Both must be backported to 3.4.
src/http_conv.c
src/http_fetch.c
src/sample.c