]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: sink/api: pass explicit maxlen parameter to sink_write()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 26 Jun 2023 14:44:41 +0000 (16:44 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 10 Jul 2023 16:28:08 +0000 (18:28 +0200)
commitb6e2d62fb3c3015f2da87e2c78cc562b3a0fc391
tree02f9ee0d5cf373fcea839f74050ff182b99663e7
parent901f31bc9a97b972d8e36362c6f4659f42532194
MINOR: sink/api: pass explicit maxlen parameter to sink_write()

sink_write() currently relies on sink->maxlen to know when to stop
writing a given payload.

But it could be useful to pass a smaller, explicit value to sink_write()
to stop before the ring maxlen, for instance if the ring is shared between
multiple feeders.

sink_write() now takes an optional maxlen parameter:
  if maxlen is > 0, then sink_write will stop writing at maxlen if maxlen
  is smaller than ring->maxlen, else only ring->maxlen will be considered.

[for haproxy <= 2.7, patch must be applied by hand: that is:
__sink_write() and sink_write() should be patched to take maxlen into
account and function calls to sink_write() should use 0 as second argument
to keep original behavior]
include/haproxy/sink.h
src/log.c
src/sample.c
src/sink.c
src/trace.c