]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: http: make msg->eol carry the last CRLF length
authorWilly Tarreau <w@1wt.eu>
Thu, 13 Mar 2014 14:48:45 +0000 (15:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Apr 2014 21:15:28 +0000 (23:15 +0200)
commit0558a02eb141a8f6d9e894834547cb64213e4ed4
tree7e48327663af80fa0243d1dcd8fce27ee6390116
parent890988f122eb8a5ecb05a914a781a3ac33abb904
MINOR: http: make msg->eol carry the last CRLF length

One of the issues we face when we need to either forward headers only
before compressing, or rewind the stream during a redispatch is to know
the proper length of the request headers. msg->eoh always has the total
length up to the last CRLF, and we never know whether the request ended
with a single LF or a standard CRLF. This makes it hard to rewind the
headers without explicitly checking the bytes in the buffer.

Instead of doing so, we now use msg->eol to carry the length of the last
CRLF (either 1 or 2). Since it is not modified at all after HTTP_MSG_BODY,
and was only left in an undefined state, it is safe to use at any moment.

Thus, the complete header length to forward or to rewind now is always
msg->eoh + msg->eol.
include/types/proto_http.h
src/proto_http.c