]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: h1: support partial message parsing
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Sep 2018 14:20:30 +0000 (16:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 15:38:25 +0000 (17:38 +0200)
commit4c34c0e74a4727ef1c45224b822b093fedb50ee1
tree01bcde25e0d359e27d1c626872a4ce429a5c76cb
parent5384aac0cbbd06d5a0f23d90b1d844252a1b962b
MEDIUM: h1: support partial message parsing

While it was not needed in the H2 mux which was reading full H1 messages
from the channel, it is mandatory for the H1 mux reading contents from
outside to be able to restart on a message. The problem is that the
headers are indexed on the fly, and it's not fun to have to store
everything between calls.

The solution here is to complete the first pass doing a partial restart,
and only once the end of message was found, to start over it again at
once, filling entries. This way there is a bounded number of passes on
the contents and no need to store an intermediary result anymore. Later
this principle could even be used to decide to completely drop an output
buffer to save memory.
src/h1.c