]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: htx: Store the first block position instead of the start-line one
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 May 2019 09:03:26 +0000 (11:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 May 2019 05:42:33 +0000 (07:42 +0200)
commit29f1758285968a2cb764e10306da68e5e58b3eda
tree09a79d5f255bb096e8c89eda514b684c4949c52b
parentee1bd4b4f77209588ec72a83a7f22b4af0589a9a
MEDIUM: htx: Store the first block position instead of the start-line one

We don't store the start-line position anymore in the HTX message. Instead we
store the first block position to analyze. For now, it is almost the same. But
once all changes will be made on this part, this position will have to be used
by HTX analyzers, and only in the analysis context, to know where the analyse
should start.

When new blocks are added in an HTX message, if the first block position is not
defined, it is set. When the block pointed by it is removed, it is set to the
block following it. -1 remains the value to unset the position. the first block
position is unset when the HTX message is empty. It may also be unset on a
non-empty message, meaning every blocks were already analyzed.

From HTX analyzers point of view, this position is always set during headers
analysis. When they are waiting for a request or a response, if it is unset, it
means the analysis should wait. But once the analysis is started, and as long as
headers are not forwarded, it points to the message start-line.

As mentionned, outside the HTX analysis, no code must rely on the first block
position. So multiplexers and applets must always use the head position to start
a loop on an HTX message.
include/common/htx.h
include/proto/channel.h
src/cache.c
src/hlua.c
src/http_fetch.c
src/http_htx.c
src/htx.c
src/proto_htx.c