]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stconn: Add two fields in sedesc to replace the HTX extra value
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Sep 2025 15:30:32 +0000 (17:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Oct 2025 09:01:36 +0000 (11:01 +0200)
commitc0b6db283058791287974a62f0f70a50d2602caa
tree6e2e0eea6ddfad7e3bd077adfbc59d6c5d18ac34
parent586511c27886b3fab22cdd3e7b061a1f9b2225a7
MINOR: stconn: Add two fields in sedesc to replace the HTX extra value

For now, the HTX extra value is used to specify the known part, in bytes, of
the HTTP payload we will receive. It may concerne the full payload if a
content-length is specified or the current chunk for a chunk-encoded
message. The main purpose of this value is to be used on the opposite side
to be able to announce chunks bigger than a buffer. It can also be used to
check the validity of the payload on the sending path, to properly detect
too big or too short payload.

However, setting this information in the HTX message itself is not really
appropriate because the information is lost when the HTX message is consumed
and the underlying buffer released. So the producer must take care to always
add it in all HTX messages. it is especially an issue when the payload is
altered by a filter.

So to fix this design issue, the information will be moved in the sedesc. It
is a persistent area to save the information. In addition, to avoid the
ambiguity between what the producer say and what the consumer see, the
information will be splitted in two fields. In this patch, the fields are
added:

 * kip : The known input payload length
 * kop : The known output payload lenght

The producer will be responsible to set <kip> value. The stream will be
responsible to decrement <kip> and increment <kop> accordingly. And the
consumer will be responsible to remove consumed bytes from <kop>.
include/haproxy/stconn-t.h
include/haproxy/stconn.h
src/stconn.c