]> git.kaiwu.me - haproxy.git/commit
REORG: http: move the HTTP semantics definitions to http.h/http.c
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Sep 2018 13:38:55 +0000 (15:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Sep 2018 08:30:25 +0000 (10:30 +0200)
commit35b51c6e5b75016b2c29d8d1219a09768291c002
treec840c44b2a0ea588023f377f60f2059b91fdcd02
parent123f1f6441dfd42eaf704a115dcc671f194eb16a
REORG: http: move the HTTP semantics definitions to http.h/http.c

It's a bit painful to have to deal with HTTP semantics for each protocol
version (H1 and H2), and working on the version-agnostic code further
emphasizes the problem.

This patch creates http.h and http.c which are agnostic to the version
in use, and which borrow a few parts from proto_http and from h1. For
example the once thought h1-specific h1_char_classes array is in fact
dictated by RFC7231 and is used to parse HTTP headers. A few changes
were made to a few files which were including proto_http.h while they
only needed http.h.

Certain string definitions pre-dated the introduction of indirect
strings (ist) so some were used to simplify the definition of the known
HTTP methods. The current lookup code saves 2 kB of a heavily used table
and is faster than the previous table based lookup (typ. 14 ns vs 16
before).
23 files changed:
Makefile
include/common/buf.h
include/common/http.h [new file with mode: 0644]
include/proto/h1.h
include/proto/proto_http.h
include/types/hlua.h
include/types/proto_http.h
include/types/proxy.h
include/types/sample.h
src/checks.c
src/compression.c
src/flt_http_comp.c
src/h1.c
src/hlua_fcn.c
src/http.c [new file with mode: 0644]
src/lb_map.c
src/log.c
src/peers.c
src/proto_http.c
src/sample.c
src/session.c
src/stats.c
src/vars.c