mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-30 14:31:08 +01:00
BUG/MINOR: h1: fix buffer shift after realignment
Commit 5e74b0b ("MEDIUM: h1: port to new buffer API.") introduced a
minor bug by which a buffer's head could stay shifted by the amount
of removed CRLF if it started with empty lines. This would cause the
second request (or response) not to work until it would receive a few
extra characters. This most only impacts requests sent by hand though.
This is purely 1.9, no backport is needed.
This commit is contained in:
parent
22de8d3e01
commit
950a8a6fde
7
src/h1.c
7
src/h1.c
@ -457,11 +457,10 @@ void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
|
||||
{
|
||||
enum h1_state state; /* updated only when leaving the FSM */
|
||||
register const char *ptr, *end; /* request pointers, to avoid dereferences */
|
||||
char *input = (char *)ci_head(msg->chn);
|
||||
struct buffer *buf;
|
||||
struct buffer *buf = &msg->chn->buf;
|
||||
char *input = b_head(buf);
|
||||
|
||||
state = msg->msg_state;
|
||||
buf = &msg->chn->buf;
|
||||
ptr = input + msg->next;
|
||||
end = b_stop(buf);
|
||||
|
||||
@ -486,6 +485,7 @@ void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
|
||||
goto http_msg_ood;
|
||||
/* Remove empty leading lines, as recommended by RFC2616. */
|
||||
b_del(buf, ptr - input);
|
||||
input = b_head(buf);
|
||||
}
|
||||
msg->sol = 0;
|
||||
msg->sl.st.l = 0; /* used in debug mode */
|
||||
@ -554,6 +554,7 @@ void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
|
||||
goto http_msg_ood;
|
||||
/* Remove empty leading lines, as recommended by RFC2616. */
|
||||
b_del(buf, ptr - input);
|
||||
input = b_head(buf);
|
||||
}
|
||||
msg->sol = 0;
|
||||
msg->sl.rq.l = 0; /* used in debug mode */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user