]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: http: move http_txn out of struct stream
authorWilly Tarreau <w@1wt.eu>
Fri, 3 Apr 2015 21:46:31 +0000 (23:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:35:52 +0000 (11:35 +0200)
commiteee5b51248ee5fefea257cb997de47f307516e86
treeb85c56787ac922ce2bb32e00540d05443c0693e3
parent63986c72c88f0d5b44f338d734c6f0f91509d187
MAJOR: http: move http_txn out of struct stream

Now this one is dynamically allocated. It means that 280 bytes of memory
are saved per TCP stream, but more importantly that it will become
possible to remove the l7 pointer from fetches and converters since
it will be deduced from the stream and will support being null.

A lot of care was taken because it's easy to forget a test somewhere,
and the previous code used to always trust s->txn for being valid, but
all places seem to have been visited.

All HTTP fetch functions check the txn first so we shouldn't have any
issue there even when called from TCP. When branching from a TCP frontend
to an HTTP backend, the txn is properly allocated at the same time as the
hdr_idx.
14 files changed:
include/proto/proto_http.h
include/types/proto_http.h
include/types/stream.h
src/backend.c
src/compression.c
src/dumpstats.c
src/frontend.c
src/hlua.c
src/log.c
src/peers.c
src/proto_http.c
src/proto_tcp.c
src/proxy.c
src/stream.c