]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: ensure that hdr_idx is always reserved when L7 fetches are used
authorWilly Tarreau <w@1wt.eu>
Fri, 5 Oct 2012 20:41:26 +0000 (22:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Oct 2012 20:46:09 +0000 (22:46 +0200)
commit1b6c00cb9942d634263253408c265c96f4f38630
tree8d0743c39c22af5fae6938597c9d633ea60eddb6
parent71e451c74cc1b71576bab6f2fe329f8390d57868
BUG/MAJOR: ensure that hdr_idx is always reserved when L7 fetches are used

Baptiste Assmann reported a bug causing a crash on recent versions when
sticking rules were set on layer 7 in a TCP proxy. The bug is easier to
reproduce with the "defer-accept" option on the "bind" line in order to
have some contents to parse when the connection is accepted. The issue
is that the acl_prefetch_http() function called from HTTP fetches relies
on hdr_idx to be preinitialized, which is not the case if there is no L7
ACL.

The solution consists in adding a new SMP_CAP_L7 flag to fetches to indicate
that they are expected to work on L7 data, so that the proxy knows that the
hdr_idx has to be initialized. This is already how ACL and HTTP mode are
handled.

The bug was present since 1.5-dev9.
include/types/sample.h
src/cfgparse.c
src/proto_http.c