mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-06 15:41:36 +01:00
[BUG] http: update the header list's tail when removing the last header
Stefan Behte reported a strange case where depending on the position of the Connection header in the header list, some headers added after it were or were not usable in "balance hdr()". The reason is that when the last header is removed, the list's tail was not updated, so any header added after that one was not visible from the list. This fix must be backported to 1.4 and possibly 1.3.
This commit is contained in:
parent
16171e234b
commit
5c4784f4b8
@ -601,6 +601,8 @@ int http_remove_header2(struct http_msg *msg, struct buffer *buf,
|
||||
idx->used--;
|
||||
hdr->len = 0; /* unused entry */
|
||||
idx->v[ctx->prev].next = idx->v[ctx->idx].next;
|
||||
if (idx->tail == ctx->idx)
|
||||
idx->tail = ctx->prev;
|
||||
ctx->idx = ctx->prev; /* walk back to the end of previous header */
|
||||
ctx->line -= idx->v[ctx->idx].len + idx->v[cur_idx].cr + 1;
|
||||
ctx->val = idx->v[ctx->idx].len; /* point to end of previous header */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user