MEDIUM: http: move header captures from http_txn to struct stream
The header captures are now general purpose captures since tcp rules
can use them to capture various contents. That removes a dependency
on http_txn that appeared in some sample fetch functions and in the
order by which captures and http_txn were allocated.
Interestingly the reset of the header captures were done at too many
places as http_init_txn() used to do it while it was done previously
in every call place.
diff --git a/src/stream.c b/src/stream.c
index 70c07a7..d28684e 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -452,6 +452,8 @@
s->be = sess->fe;
s->comp_algo = NULL;
s->req.buf = s->res.buf = NULL;
+ s->req_cap = NULL;
+ s->res_cap = NULL;
/* Let's count a stream now */
proxy_inc_fe_sess_ctr(l, p);
@@ -538,8 +540,6 @@
txn->srv_cookie = NULL;
txn->cli_cookie = NULL;
txn->uri = NULL;
- txn->req.cap = NULL;
- txn->rsp.cap = NULL;
txn->hdr_idx.v = NULL;
txn->hdr_idx.size = txn->hdr_idx.used = 0;
txn->flags = 0;
@@ -651,8 +651,8 @@
pool_free2(pool2_hdr_idx, txn->hdr_idx.v);
if (fe) {
- pool_free2(fe->rsp_cap_pool, txn->rsp.cap);
- pool_free2(fe->req_cap_pool, txn->req.cap);
+ pool_free2(fe->rsp_cap_pool, s->res_cap);
+ pool_free2(fe->req_cap_pool, s->req_cap);
}
stream_store_counters(s);