]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: http: move buffer->lr to http_msg->next
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Mar 2012 10:17:50 +0000 (11:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 10:28:11 +0000 (12:28 +0200)
commita458b679652d21ee39cb6b9edd12cb7c38aff32c
tree577bf93601b228fb0d0af25419ce72d7702388c2
parent363a5bb152679f2e914421cd87f6195669702cc3
MAJOR: http: move buffer->lr to http_msg->next

The buffer's pointer <lr> was only used by HTTP parsers which also use a
struct http_msg to keep track of the parser's state. We've reached a point
where it makes no sense to keep ->lr in the buffer, as the split between
buffer and msg is only arbitrary for historical reasons.

This change ensures that touching buffers will not impact HTTP messages
anymore, making the buffers more content-agnostic. However, it becomes
very important not to forget to update msg->next when some data get
forwarded or moved (and in general each time buf->p is updated).

The new pointer in http_msg becomes relative to buffer->p so that
parsing multiple messages becomes easier. It is possible that at one
point ->som and ->next will be merged.

Note: http_parse_reqline() and http_parse_stsline() have been temporarily
modified to know the message starting point in the buffer (->p).
include/proto/buffers.h
include/proto/proto_http.h
include/types/buffers.h
include/types/proto_http.h
src/buffers.c
src/dumpstats.c
src/proto_http.c
src/stream_sock.c