haproxy/include/proto
Christopher Faulet 89dc499359 BUG/MAJOR: http_fetch: Get the channel depending on the keyword used
All HTTP samples are buggy because the channel tested in the prefetch functions
(HTX and legacy HTTP) is chosen depending on the sample direction and not the
keyword really used. It means the request channel is used if the sample is
called during the request analysis and the response channel is used if it is
called during the response analysis, regardless the sample really called. For
instance, if you use the sample "req.ver" in an http-response rule, the response
channel will be prefeched because it is called during the response analysis,
while the request channel should have been used instead. So some assumptions on
the validity of the sample may be made on the wrong channel. It is the first
bug.

Then the same error is done in some samples themselves. So fetches are performed
on the wrong channel. For instance, the header extraction (req.fhdr, res.fhdr,
req.hdr, res.hdr...). If the sample "req.hdr" is used in an http-response rule,
then the matching is done on the response headers and not the request ones. It
is the second bug.

Finally, the last one but not the least, in some samples, the right channel is
used. But because the prefetch was done on the wrong one, this channel may be in
a undefined state. For instance, using the sample "req.ver" in an http-response
rule leads to a matching on a posibility released buffer.

To fix all these bugs, the right channel is now chosen in sample fetches, before
the prefetch. If the same function is used to fetch requests and responses
elements, then the keyword is used to choose the right one. This channel is then
used by the functions smp_prefetch_htx() and smp_prefetch_http(). Of course, it
is also used by the samples themselves to extract information.

This patch must be backported to all supported versions. For version 1.8 and
priors, it must be totally refactored. First because there is no HTX into these
versions. Then the buffers API has changed in HAProxy 1.9. The files
http_fetch.{ch} doesn't exist on old versions.
2019-04-17 15:12:27 +02:00
..
acl.h
action.h
activity.h MINOR: activity: add configuration and CLI support for "profiling.tasks" 2018-11-22 11:48:51 +01:00
applet.h MEDIUM: applets: Use the new _HA_ATOMIC_* macros. 2019-03-11 17:02:37 +01:00
arg.h
auth.h
backend.h BUG/MAJOR: lb/threads: fix insufficient locking on round-robin LB 2019-04-16 11:21:14 +02:00
channel.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
checks.h
cli.h MINOR: cli: export cli_parse_default() definition in cli.h 2019-04-01 14:45:37 +02:00
compression.h
connection.h MEDIUM: connection: Add conn_upgrade_mux_fe() to handle mux upgrades 2019-04-12 22:06:53 +02:00
dns.h
fd.h MEDIUM: fd: Use the new _HA_ATOMIC_* macros. 2019-03-11 17:02:37 +01:00
filters.h MINOR: filters: Export the name of known filters 2018-12-11 17:09:31 +01:00
flt_http_comp.h MINOR: compression: Rename the function check_legacy_http_comp_flt() 2018-12-11 17:09:31 +01:00
freq_ctr.h MEDIUM: freq_ctr: Use the new _HA_ATOMIC_* macros. 2019-03-11 17:02:37 +01:00
frontend.h
hdr_idx.h
hlua_fcn.h
hlua.h
http_fetch.h BUG/MAJOR: http_fetch: Get the channel depending on the keyword used 2019-04-17 15:12:27 +02:00
http_htx.h CLEANUP: h1: remove some occurrences of unneeded h1.h inclusions 2018-12-11 17:15:13 +01:00
http_rules.h REORG: http: move HTTP rules parsing to http_rules.c 2018-10-02 18:28:05 +02:00
lb_chash.h MINOR: lb: allow redispatch when using consistent hash 2019-01-02 20:22:17 +01:00
lb_fas.h
lb_fwlc.h
lb_fwrr.h
lb_map.h
listener.h MINOR: listener: introduce listener_backlog() to report the backlog value 2019-02-28 17:05:29 +01:00
log.h MEDIUM: initcall: use initcalls for a few initialization functions 2018-11-26 19:50:32 +01:00
map.h
mux_pt.h
mworker.h MEDIUM: mworker-prog: implement program for master-worker 2019-04-01 14:45:37 +02:00
obj_type.h MINOR: objtype: report a few missing types in names and base pointers 2018-12-18 16:31:10 +01:00
openssl-compat.h MINOR: ssl: generate-certificates for BoringSSL 2018-10-08 09:42:34 +02:00
pattern.h
payload.h
peers.h BUG/MEDIUM: peers: Missing peer initializations. 2019-02-12 19:49:22 +01:00
pipe.h
port_range.h
proto_http.h MINOR: http: update the macro IS_HTX_STRM() to check the stream flag SF_HTX 2019-04-12 22:06:53 +02:00
proto_sockpair.h MEDIUM: protocol: sockpair protocol 2018-09-12 07:20:17 +02:00
proto_tcp.h MINOR: connection: make conn_sock_drain() work for all socket families 2018-08-24 14:45:46 +02:00
proto_udp.h
protocol_buffers.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
protocol.h CLEANUP: Fix a typo in the protocol header file 2018-12-02 18:42:49 +01:00
proxy.h BUILD: address a few cases of "static <type> inline foo()" 2019-04-15 21:55:48 +02:00
queue.h MEDIUM: init: use initcall for all fixed size pool creations 2018-11-26 19:50:32 +01:00
raw_sock.h
sample.h CLEANUP: Fix typos in the sample subsystem 2018-11-18 22:26:42 +01:00
server.h BUILD: address a few cases of "static <type> inline foo()" 2019-04-15 21:55:48 +02:00
session.h MINOR: muxes: Pass the context of the mux to destroy() instead of the connection 2019-04-12 22:06:53 +02:00
shctx.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
signal.h MEDIUM: initcall: use initcalls for a few initialization functions 2018-11-26 19:50:32 +01:00
spoe.h CLEANUP: Fix typos in the spoe subsystem 2018-11-18 22:26:42 +01:00
ssl_sock.h MINOR: ssl: add support of aes256 bits ticket keys on file and cli. 2019-01-14 19:32:58 +01:00
stats.h MINOR: stats: Move stuff about the stats status codes in stats files 2019-03-15 14:34:59 +01:00
stick_table.h MINOR: stktable: provide an unchecked version of stktable_data_ptr() 2018-09-20 11:42:15 +02:00
stream_interface.h MINOR: stream-int: add a new flag to mention that we want the connection to be killed 2019-01-31 19:38:25 +01:00
stream.h BUILD: address a few cases of "static <type> inline foo()" 2019-04-15 21:55:48 +02:00
task.h CLEANUP: task: do not export rq_next anymore 2019-04-15 09:50:56 +02:00
tcp_rules.h
template.h
vars.h