MAJOR: sample: don't pass l7 anymore to sample fetch functions

All of them can now retrieve the HTTP transaction *if it exists* from
the stream and be sure to get NULL there when called with an embryonic
session.

The patch is a bit large because many locations were touched (all fetch
functions had to have their prototype adjusted). The opportunity was
taken to also uniformize the call names (the stream is now always "strm"
instead of "l4") and to fix indent where it was broken. This way when
we later introduce the session here there will be less confusion.
diff --git a/src/acl.c b/src/acl.c
index edf1339..fe2e0ec 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1097,7 +1097,7 @@
  *     if (cond->pol == ACL_COND_UNLESS)
  *         res = !res;
  */
-enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct stream *l4, void *l7, unsigned int opt)
+enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct stream *strm, unsigned int opt)
 {
 	__label__ fetch_next;
 	struct acl_term_suite *suite;
@@ -1141,7 +1141,7 @@
 				/* we need to reset context and flags */
 				memset(&smp, 0, sizeof(smp));
 			fetch_next:
-				if (!sample_process(px, l4, l7, opt, expr->smp, &smp)) {
+				if (!sample_process(px, strm, opt, expr->smp, &smp)) {
 					/* maybe we could not fetch because of missing data */
 					if (smp.flags & SMP_F_MAY_CHANGE && !(opt & SMP_OPT_FINAL))
 						acl_res |= ACL_TEST_MISS;
diff --git a/src/backend.c b/src/backend.c
index a8cf644..4f0a654 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1483,7 +1483,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_nbsrv(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_nbsrv(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -1506,7 +1506,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_is_up(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_srv_is_up(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct server *srv = args->data.srv;
@@ -1526,7 +1526,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_connslots(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_connslots(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct server *iterator;
@@ -1554,25 +1554,25 @@
 
 /* set temp integer to the id of the backend */
 static int
-smp_fetch_be_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_be_id(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TXN;
 	smp->type = SMP_T_UINT;
-	smp->data.uint = l4->be->uuid;
+	smp->data.uint = strm->be->uuid;
 	return 1;
 }
 
 /* set temp integer to the id of the server */
 static int
-smp_fetch_srv_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_srv_id(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	if (!objt_server(l4->target))
+	if (!objt_server(strm->target))
 		return 0;
 
 	smp->type = SMP_T_UINT;
-	smp->data.uint = objt_server(l4->target)->puid;
+	smp->data.uint = objt_server(strm->target)->puid;
 
 	return 1;
 }
@@ -1582,7 +1582,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_be_sess_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_be_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -1596,7 +1596,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_be_conn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_be_conn(struct proxy *px, struct stream *strm, unsigned int opt,
                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -1610,7 +1610,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_queue_size(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_queue_size(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -1628,7 +1628,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_avg_queue_size(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_avg_queue_size(struct proxy *px, struct stream *strm, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int nbsrv;
@@ -1657,7 +1657,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_conn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_srv_conn(struct proxy *px, struct stream *strm, unsigned int opt,
                    const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -1671,7 +1671,7 @@
  * undefined behaviour.
  */
 static int
-smp_fetch_srv_sess_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_srv_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
diff --git a/src/compression.c b/src/compression.c
index 50d41c1..f3355fe 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -838,26 +838,26 @@
 
 /* boolean, returns true if compression is used (either gzip or deflate) in the response */
 static int
-smp_fetch_res_comp(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_res_comp(struct proxy *px, struct stream *strm, unsigned int opt,
+                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
-	smp->data.uint = (l4->comp_algo != NULL);
+	smp->data.uint = (strm->comp_algo != NULL);
 	return 1;
 }
 
 /* string, returns algo */
 static int
-smp_fetch_res_comp_algo(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_res_comp_algo(struct proxy *px, struct stream *strm, unsigned int opt,
+                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	if (!l4->comp_algo)
+	if (!strm->comp_algo)
 		return 0;
 
 	smp->type = SMP_T_STR;
 	smp->flags = SMP_F_CONST;
-	smp->data.str.str = l4->comp_algo->cfg_name;
-	smp->data.str.len = l4->comp_algo->cfg_name_len;
+	smp->data.str.str = strm->comp_algo->cfg_name;
+	smp->data.str.len = strm->comp_algo->cfg_name_len;
 	return 1;
 }
 
diff --git a/src/frontend.c b/src/frontend.c
index 3a28d6f..c75fadd 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -220,12 +220,12 @@
 
 /* set temp integer to the id of the frontend */
 static int
-smp_fetch_fe_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_fe_id(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_SESS;
 	smp->type = SMP_T_UINT;
-	smp->data.uint = strm_sess(l4)->fe->uuid;
+	smp->data.uint = strm_sess(strm)->fe->uuid;
 	return 1;
 }
 
@@ -234,7 +234,7 @@
  * an undefined behaviour.
  */
 static int
-smp_fetch_fe_sess_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_fe_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -248,7 +248,7 @@
  * an undefined behaviour.
  */
 static int
-smp_fetch_fe_conn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_fe_conn(struct proxy *px, struct stream *strm, unsigned int opt,
                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
diff --git a/src/hlua.c b/src/hlua.c
index 43d9c1b..320a0bf 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2769,7 +2769,7 @@
 	memset(&smp, 0, sizeof(smp));
 
 	/* Run the sample fetch process. */
-	if (!f->process(hsmp->p, hsmp->s, hsmp->l7, 0, args, &smp, f->kw, f->private)) {
+	if (!f->process(hsmp->p, hsmp->s, 0, args, &smp, f->kw, f->private)) {
 		if (hsmp->stringsafe)
 			lua_pushstring(L, "");
 		else
@@ -3323,7 +3323,7 @@
  * return 0 if the stack does not contains free slots,
  * otherwise it returns 1.
  */
-static int hlua_txn_new(lua_State *L, struct stream *s, struct proxy *p, void *l7)
+static int hlua_txn_new(lua_State *L, struct stream *s, struct proxy *p)
 {
 	struct hlua_txn *htxn;
 
@@ -3342,7 +3342,7 @@
 
 	htxn->s = s;
 	htxn->p = p;
-	htxn->l7 = l7;
+	htxn->l7 = s->txn;
 
 	/* Create the "f" field that contains a list of fetches. */
 	lua_pushstring(L, "f");
@@ -3914,7 +3914,7 @@
  * doesn't allow "yield" functions because the HAProxy engine cannot
  * resume sample-fetches.
  */
-static int hlua_sample_fetch_wrapper(struct proxy *px, struct stream *s, void *l7,
+static int hlua_sample_fetch_wrapper(struct proxy *px, struct stream *s,
                                      unsigned int opt, const struct arg *arg_p,
                                      struct sample *smp, const char *kw, void *private)
 {
@@ -3946,7 +3946,7 @@
 		lua_rawgeti(s->hlua.T, LUA_REGISTRYINDEX, fcn->function_ref);
 
 		/* push arguments in the stack. */
-		if (!hlua_txn_new(s->hlua.T, s, px, l7)) {
+		if (!hlua_txn_new(s->hlua.T, s, px)) {
 			send_log(px, LOG_ERR, "Lua sample-fetch '%s': full stack.", fcn->name);
 			if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
 				Alert("Lua sample-fetch '%s': full stack.\n", fcn->name);
@@ -4226,7 +4226,7 @@
 		lua_rawgeti(s->hlua.T, LUA_REGISTRYINDEX, rule->fcn.function_ref);
 
 		/* Create and and push object stream in the stack. */
-		if (!hlua_txn_new(s->hlua.T, s, px, http_txn)) {
+		if (!hlua_txn_new(s->hlua.T, s, px)) {
 			send_log(px, LOG_ERR, "Lua function '%s': full stack.", rule->fcn.name);
 			if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
 				Alert("Lua function '%s': full stack.\n", rule->fcn.name);
diff --git a/src/listener.c b/src/listener.c
index af8a524..5d459b6 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -590,21 +590,21 @@
 
 /* set temp integer to the number of connexions to the same listening socket */
 static int
-smp_fetch_dconn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_dconn(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
-	smp->data.uint = strm_sess(l4)->listener->nbconn;
+	smp->data.uint = strm_sess(strm)->listener->nbconn;
 	return 1;
 }
 
 /* set temp integer to the id of the socket (listener) */
 static int
-smp_fetch_so_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_so_id(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
-	smp->data.uint = strm_sess(l4)->listener->luid;
+	smp->data.uint = strm_sess(strm)->listener->luid;
 	return 1;
 }
 
diff --git a/src/log.c b/src/log.c
index 97a2080..65e50d4 100644
--- a/src/log.c
+++ b/src/log.c
@@ -971,9 +971,9 @@
 			case LOG_FMT_EXPR: // sample expression, may be request or response
 				key = NULL;
 				if (tmp->options & LOG_OPT_REQ_CAP)
-					key = sample_fetch_string(be, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, tmp->expr);
+					key = sample_fetch_string(be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, tmp->expr);
 				if (!key && (tmp->options & LOG_OPT_RES_CAP))
-					key = sample_fetch_string(be, s, txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL, tmp->expr);
+					key = sample_fetch_string(be, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, tmp->expr);
 				if (tmp->options & LOG_OPT_HTTP)
 					ret = encode_chunk(tmplog, dst + maxsize,
 					                   '%', http_encode_map, key ? &key->data.str : &empty);
diff --git a/src/payload.c b/src/payload.c
index 9d7774c..638857c 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -29,7 +29,7 @@
  * used with content inspection.
  */
 static int
-smp_fetch_wait_end(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_wait_end(struct proxy *px, struct stream *s, unsigned int opt,
                    const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	if (!(opt & SMP_OPT_FINAL)) {
@@ -43,8 +43,8 @@
 
 /* return the number of bytes in the request buffer */
 static int
-smp_fetch_len(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
-                  const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_len(struct proxy *px, struct stream *s, unsigned int opt,
+              const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct channel *chn;
 
@@ -60,7 +60,7 @@
 
 /* returns the type of SSL hello message (mainly used to detect an SSL hello) */
 static int
-smp_fetch_ssl_hello_type(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_ssl_hello_type(struct proxy *px, struct stream *s, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int hs_len;
@@ -128,7 +128,7 @@
  * Note: this decoder only works with non-wrapping data.
  */
 static int
-smp_fetch_req_ssl_ver(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_req_ssl_ver(struct proxy *px, struct stream *s, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int version, bleft, msg_len;
@@ -264,7 +264,7 @@
  *             - opaque hostname[name_len bytes]
  */
 static int
-smp_fetch_ssl_hello_sni(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_ssl_hello_sni(struct proxy *px, struct stream *s, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int hs_len, ext_len, bleft;
@@ -493,20 +493,20 @@
  * returned sample has type SMP_T_CSTR.
  */
 int
-smp_fetch_rdp_cookie(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_rdp_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	return fetch_rdp_cookie_name(s, smp, args ? args->data.str.str : NULL, args ? args->data.str.len : 0);
+	return fetch_rdp_cookie_name(strm, smp, args ? args->data.str.str : NULL, args ? args->data.str.len : 0);
 }
 
 /* returns either 1 or 0 depending on whether an RDP cookie is found or not */
 static int
-smp_fetch_rdp_cookie_cnt(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_rdp_cookie_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int ret;
 
-	ret = smp_fetch_rdp_cookie(px, s, l7, opt, args, smp, kw, private);
+	ret = smp_fetch_rdp_cookie(px, strm, opt, args, smp, kw, private);
 
 	if (smp->flags & SMP_F_MAY_CHANGE)
 		return 0;
@@ -519,7 +519,7 @@
 
 /* extracts part of a payload with offset and length at a given position */
 static int
-smp_fetch_payload_lv(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_payload_lv(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
 {
 	unsigned int len_offset = arg_p[0].data.uint;
@@ -533,7 +533,7 @@
 	/* by default buf offset == len offset + len size */
 	/* buf offset could be absolute or relative to len offset + len size if prefixed by + or - */
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
+	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &strm->res : &strm->req;
 	if (!chn->buf)
 		return 0;
 
@@ -573,14 +573,14 @@
 
 /* extracts some payload at a fixed position and length */
 static int
-smp_fetch_payload(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_payload(struct proxy *px, struct stream *strm, unsigned int opt,
                   const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
 {
 	unsigned int buf_offset = arg_p[0].data.uint;
 	unsigned int buf_size = arg_p[1].data.uint;
 	struct channel *chn;
 
-	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &s->res : &s->req;
+	chn = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &strm->res : &strm->req;
 	if (!chn->buf)
 		return 0;
 
diff --git a/src/proto_http.c b/src/proto_http.c
index 9b68270..61b29a1 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -2876,7 +2876,7 @@
 
 		/* Check if we want to fail this monitor request or not */
 		list_for_each_entry(cond, &sess->fe->mon_fail_cond, list) {
-			int ret = acl_exec_cond(cond, sess->fe, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			int ret = acl_exec_cond(cond, sess->fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 
 			ret = acl_pass(ret);
 			if (cond->pol == ACL_COND_UNLESS)
@@ -3197,7 +3197,7 @@
 		int ret = 1;
 
 		if (stats_admin_rule->cond) {
-			ret = acl_exec_cond(stats_admin_rule->cond, s->be, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(stats_admin_rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (stats_admin_rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -3352,7 +3352,7 @@
 		if (rule->cond) {
 			int ret;
 
-			ret = acl_exec_cond(rule->cond, px, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 
 			if (rule->cond->pol == ACL_COND_UNLESS)
@@ -3565,7 +3565,7 @@
 				void *ptr;
 
 				t = rule->act_prm.trk_ctr.table.t;
-				key = stktable_fetch_key(t, s->be, s, s->txn, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
+				key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
 
 				if (key && (ts = stktable_get_entry(t, key))) {
 					stream_track_stkctr(&s->stkctr[http_req_trk_idx(rule->action)], t, ts);
@@ -3627,7 +3627,7 @@
 		if (rule->cond) {
 			int ret;
 
-			ret = acl_exec_cond(rule->cond, px, s, txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+			ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 
 			if (rule->cond->pol == ACL_COND_UNLESS)
@@ -4169,7 +4169,7 @@
 	/* add request headers from the rule sets in the same order */
 	list_for_each_entry(wl, &px->req_add, list) {
 		if (wl->cond) {
-			int ret = acl_exec_cond(wl->cond, px, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			int ret = acl_exec_cond(wl->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (((struct acl_cond *)wl->cond)->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -4207,7 +4207,7 @@
 		if (rule->cond) {
 			int ret;
 
-			ret = acl_exec_cond(rule->cond, px, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -6394,7 +6394,7 @@
 			if (txn->status < 200 && txn->status != 101)
 				break;
 			if (wl->cond) {
-				int ret = acl_exec_cond(wl->cond, px, s, txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+				int ret = acl_exec_cond(wl->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
 				ret = acl_pass(ret);
 				if (((struct acl_cond *)wl->cond)->pol == ACL_COND_UNLESS)
 					ret = !ret;
@@ -7175,7 +7175,7 @@
 		 * next filter if the condition does not match.
 		 */
 		if (exp->cond) {
-			ret = acl_exec_cond(exp->cond, px, s, txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(exp->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (((struct acl_cond *)exp->cond)->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -8001,7 +8001,7 @@
 		 * next filter if the condition does not match.
 		 */
 		if (exp->cond) {
-			ret = acl_exec_cond(exp->cond, px, s, txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+			ret = acl_exec_cond(exp->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (((struct acl_cond *)exp->cond)->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -9903,10 +9903,10 @@
  *   1 if an HTTP message is ready
  */
 static int
-smp_prefetch_http(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
                   const struct arg *args, struct sample *smp, int req_vol)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn = s->txn;
 	struct http_msg *msg = &txn->req;
 
 	/* Note: this function may only be used from places where
@@ -9996,10 +9996,10 @@
  * least the type and uint value are modified.
  */
 #define CHECK_HTTP_MESSAGE_FIRST() \
-	do { int r = smp_prefetch_http(px, l4, l7, opt, args, smp, 1); if (r <= 0) return r; } while (0)
+	do { int r = smp_prefetch_http(px, strm, opt, args, smp, 1); if (r <= 0) return r; } while (0)
 
 #define CHECK_HTTP_MESSAGE_FIRST_PERM() \
-	do { int r = smp_prefetch_http(px, l4, l7, opt, args, smp, 0); if (r <= 0) return r; } while (0)
+	do { int r = smp_prefetch_http(px, strm, opt, args, smp, 0); if (r <= 0) return r; } while (0)
 
 
 /* 1. Check on METHOD
@@ -10034,11 +10034,11 @@
  * This is intended to be used with pat_match_meth() only.
  */
 static int
-smp_fetch_meth(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_meth(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int meth;
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 
 	CHECK_HTTP_MESSAGE_FIRST_PERM();
 
@@ -10088,10 +10088,10 @@
 }
 
 static int
-smp_fetch_rqver(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_rqver(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 	char *ptr;
 	int len;
 
@@ -10113,15 +10113,16 @@
 }
 
 static int
-smp_fetch_stver(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_stver(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	char *ptr;
 	int len;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	if (txn->rsp.msg_state < HTTP_MSG_BODY)
 		return 0;
 
@@ -10142,15 +10143,16 @@
 
 /* 3. Check on Status Code. We manipulate integers here. */
 static int
-smp_fetch_stcode(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_stcode(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	char *ptr;
 	int len;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	if (txn->rsp.msg_state < HTTP_MSG_BODY)
 		return 0;
 
@@ -10165,13 +10167,14 @@
 
 /* 4. Check on URL/URI. A pointer to the URI is stored. */
 static int
-smp_fetch_url(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_url(struct proxy *px, struct stream *strm, unsigned int opt,
               const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	smp->type = SMP_T_STR;
 	smp->data.str.len = txn->req.sl.rq.u_l;
 	smp->data.str.str = txn->req.chn->buf->p + txn->req.sl.rq.u;
@@ -10180,14 +10183,15 @@
 }
 
 static int
-smp_fetch_url_ip(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_url_ip(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	struct sockaddr_storage addr;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	url2sa(txn->req.chn->buf->p + txn->req.sl.rq.u, txn->req.sl.rq.u_l, &addr, NULL);
 	if (((struct sockaddr_in *)&addr)->sin_family != AF_INET)
 		return 0;
@@ -10199,14 +10203,15 @@
 }
 
 static int
-smp_fetch_url_port(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_url_port(struct proxy *px, struct stream *strm, unsigned int opt,
                    const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	struct sockaddr_storage addr;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	url2sa(txn->req.chn->buf->p + txn->req.sl.rq.u, txn->req.sl.rq.u_l, &addr, NULL);
 	if (((struct sockaddr_in *)&addr)->sin_family != AF_INET)
 		return 0;
@@ -10225,13 +10230,12 @@
  * returns full lines instead (useful for User-Agent or Date for example).
  */
 static int
-smp_fetch_fhdr(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_fhdr(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct hdr_idx *idx;
 	struct hdr_ctx *ctx = smp->ctx.a[0];
-	const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+	const struct http_msg *msg;
 	int occ = 0;
 	const char *name_str = NULL;
 	int name_len = 0;
@@ -10255,6 +10259,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	idx = &strm->txn->hdr_idx;
+	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &strm->txn->req : &strm->txn->rsp;
+
 	if (ctx && !(smp->flags & SMP_F_NOT_LAST))
 		/* search for header from the beginning */
 		ctx->idx = 0;
@@ -10281,13 +10288,12 @@
  * returns full lines instead (useful for User-Agent or Date for example).
  */
 static int
-smp_fetch_fhdr_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                  const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_fhdr_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
-	const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+	const struct http_msg *msg;
 	int cnt;
 	const char *name = NULL;
 	int len = 0;
@@ -10299,6 +10305,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	idx = &strm->txn->hdr_idx;
+	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &strm->txn->req : &strm->txn->rsp;
+
 	ctx.idx = 0;
 	cnt = 0;
 	while (http_find_full_header2(name, len, msg->chn->buf->p, idx, &ctx))
@@ -10311,13 +10320,12 @@
 }
 
 static int
-smp_fetch_hdr_names(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_hdr_names(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
-	const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+	const struct http_msg *msg;
 	struct chunk *temp;
 	char del = ',';
 
@@ -10326,6 +10334,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	idx = &strm->txn->hdr_idx;
+	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &strm->txn->req : &strm->txn->rsp;
+
 	temp = get_trash_chunk();
 
 	ctx.idx = 0;
@@ -10350,13 +10361,12 @@
  * headers are considered from the first one.
  */
 static int
-smp_fetch_hdr(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_hdr(struct proxy *px, struct stream *strm, unsigned int opt,
               const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct hdr_idx *idx;
 	struct hdr_ctx *ctx = smp->ctx.a[0];
-	const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+	const struct http_msg *msg;
 	int occ = 0;
 	const char *name_str = NULL;
 	int name_len = 0;
@@ -10380,6 +10390,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	idx = &strm->txn->hdr_idx;
+	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &strm->txn->req : &strm->txn->rsp;
+
 	if (ctx && !(smp->flags & SMP_F_NOT_LAST))
 		/* search for header from the beginning */
 		ctx->idx = 0;
@@ -10405,13 +10418,12 @@
  * Accepts exactly 1 argument of type string.
  */
 static int
-smp_fetch_hdr_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_hdr_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
-	const struct http_msg *msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &txn->req : &txn->rsp;
+	const struct http_msg *msg;
 	int cnt;
 	const char *name = NULL;
 	int len = 0;
@@ -10423,6 +10435,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	idx = &strm->txn->hdr_idx;
+	msg = ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) ? &strm->txn->req : &strm->txn->rsp;
+
 	ctx.idx = 0;
 	cnt = 0;
 	while (http_find_header2(name, len, msg->chn->buf->p, idx, &ctx))
@@ -10440,10 +10455,10 @@
  * may or may not be appropriate for everything.
  */
 static int
-smp_fetch_hdr_val(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_hdr_val(struct proxy *px, struct stream *strm, unsigned int opt,
                   const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw, private);
+	int ret = smp_fetch_hdr(px, strm, opt, args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -10458,12 +10473,12 @@
  * It returns an IPv4 or IPv6 address.
  */
 static int
-smp_fetch_hdr_ip(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_hdr_ip(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int ret;
 
-	while ((ret = smp_fetch_hdr(px, l4, l7, opt, args, smp, kw, private)) > 0) {
+	while ((ret = smp_fetch_hdr(px, strm, opt, args, smp, kw, private)) > 0) {
 		if (url2ipv4((char *)smp->data.str.str, &smp->data.ipv4)) {
 			smp->type = SMP_T_IPV4;
 			break;
@@ -10490,14 +10505,15 @@
  * the first '/' after the possible hostname, and ends before the possible '?'.
  */
 static int
-smp_fetch_path(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_path(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	char *ptr, *end;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	end = txn->req.chn->buf->p + txn->req.sl.rq.u + txn->req.sl.rq.u_l;
 	ptr = http_get_path(txn);
 	if (!ptr)
@@ -10523,19 +10539,20 @@
  * The returned sample is of type string.
  */
 static int
-smp_fetch_base(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_base(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	char *ptr, *end, *beg;
 	struct hdr_ctx ctx;
 	struct chunk *temp;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	ctx.idx = 0;
 	if (!http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx) || !ctx.vlen)
-		return smp_fetch_path(px, l4, l7, opt, args, smp, kw, private);
+		return smp_fetch_path(px, strm, opt, args, smp, kw, private);
 
 	/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
 	temp = get_trash_chunk();
@@ -10570,10 +10587,10 @@
  * high-traffic sites without having to store whole paths.
  */
 int
-smp_fetch_base32(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_base32(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	struct hdr_ctx ctx;
 	unsigned int hash = 0;
 	char *ptr, *beg, *end;
@@ -10581,6 +10598,7 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	ctx.idx = 0;
 	if (http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx)) {
 		/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
@@ -10618,17 +10636,17 @@
  * 8 bytes would still work.
  */
 static int
-smp_fetch_base32_src(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_base32_src(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
 	if (!cli_conn)
 		return 0;
 
-	if (!smp_fetch_base32(px, l4, l7, opt, args, smp, kw, private))
+	if (!smp_fetch_base32(px, strm, opt, args, smp, kw, private))
 		return 0;
 
 	temp = get_trash_chunk();
@@ -10658,14 +10676,15 @@
  * of type string carrying the whole query string.
  */
 static int
-smp_fetch_query(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-               const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_query(struct proxy *px, struct stream *strm, unsigned int opt,
+                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	char *ptr, *end;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	ptr = txn->req.chn->buf->p + txn->req.sl.rq.u;
 	end = ptr + txn->req.sl.rq.u_l;
 
@@ -10683,7 +10702,7 @@
 }
 
 static int
-smp_fetch_proto_http(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_proto_http(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	/* Note: hdr_idx.v cannot be NULL in this ACL because the ACL is tagged
@@ -10699,17 +10718,17 @@
 
 /* return a valid test if the current request is the first one on the connection */
 static int
-smp_fetch_http_first_req(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_http_first_req(struct proxy *px, struct stream *strm, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
-	smp->data.uint = !(s->txn->flags & TX_NOT_FIRST);
+	smp->data.uint = !(strm->txn->flags & TX_NOT_FIRST);
 	return 1;
 }
 
 /* Accepts exactly 1 argument of type userlist */
 static int
-smp_fetch_http_auth(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_http_auth(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 
@@ -10718,33 +10737,32 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
-	if (!get_http_auth(l4))
+	if (!get_http_auth(strm))
 		return 0;
 
 	smp->type = SMP_T_BOOL;
-	smp->data.uint = check_user(args->data.usr, l4->txn->auth.user, l4->txn->auth.pass);
+	smp->data.uint = check_user(args->data.usr, strm->txn->auth.user, strm->txn->auth.pass);
 	return 1;
 }
 
 /* Accepts exactly 1 argument of type userlist */
 static int
-smp_fetch_http_auth_grp(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_http_auth_grp(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-
 	if (!args || args->type != ARGT_USR)
 		return 0;
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
-	if (!get_http_auth(l4))
+	if (!get_http_auth(strm))
 		return 0;
 
 	/* if the user does not belong to the userlist or has a wrong password,
 	 * report that it unconditionally does not match. Otherwise we return
 	 * a string containing the username.
 	 */
-	if (!check_user(args->data.usr, l4->txn->auth.user, l4->txn->auth.pass))
+	if (!check_user(args->data.usr, strm->txn->auth.user, strm->txn->auth.pass))
 		return 0;
 
 	/* pat_match_auth() will need the user list */
@@ -10752,8 +10770,8 @@
 
 	smp->type = SMP_T_STR;
 	smp->flags = SMP_F_CONST;
-	smp->data.str.str = l4->txn->auth.user;
-	smp->data.str.len = strlen(l4->txn->auth.user);
+	smp->data.str.str = strm->txn->auth.user;
+	smp->data.str.len = strlen(strm->txn->auth.user);
 
 	return 1;
 }
@@ -10857,10 +10875,10 @@
  * the "capture" option in the configuration file
  */
 static int
-smp_fetch_capture_header_req(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_capture_header_req(struct proxy *px, struct stream *strm, unsigned int opt,
+                             const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct proxy *fe = strm_sess(l4)->fe;
+	struct proxy *fe = strm_sess(strm)->fe;
 	int idx;
 
 	if (!args || args->type != ARGT_UINT)
@@ -10868,13 +10886,13 @@
 
 	idx = args->data.uint;
 
-	if (idx > (fe->nb_req_cap - 1) || l4->req_cap == NULL || l4->req_cap[idx] == NULL)
+	if (idx > (fe->nb_req_cap - 1) || strm->req_cap == NULL || strm->req_cap[idx] == NULL)
 		return 0;
 
 	smp->type = SMP_T_STR;
 	smp->flags |= SMP_F_CONST;
-	smp->data.str.str = l4->req_cap[idx];
-	smp->data.str.len = strlen(l4->req_cap[idx]);
+	smp->data.str.str = strm->req_cap[idx];
+	smp->data.str.len = strlen(strm->req_cap[idx]);
 
 	return 1;
 }
@@ -10883,10 +10901,10 @@
  * the "capture" option in the configuration file
  */
 static int
-smp_fetch_capture_header_res(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_capture_header_res(struct proxy *px, struct stream *strm, unsigned int opt,
+                             const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct proxy *fe = strm_sess(l4)->fe;
+	struct proxy *fe = strm_sess(strm)->fe;
 	int idx;
 
 	if (!args || args->type != ARGT_UINT)
@@ -10894,27 +10912,27 @@
 
 	idx = args->data.uint;
 
-	if (idx > (fe->nb_rsp_cap - 1) || l4->res_cap == NULL || l4->res_cap[idx] == NULL)
+	if (idx > (fe->nb_rsp_cap - 1) || strm->res_cap == NULL || strm->res_cap[idx] == NULL)
 		return 0;
 
 	smp->type = SMP_T_STR;
 	smp->flags |= SMP_F_CONST;
-	smp->data.str.str = l4->res_cap[idx];
-	smp->data.str.len = strlen(l4->res_cap[idx]);
+	smp->data.str.str = strm->res_cap[idx];
+	smp->data.str.len = strlen(strm->res_cap[idx]);
 
 	return 1;
 }
 
 /* Extracts the METHOD in the HTTP request, the txn->uri should be filled before the call */
 static int
-smp_fetch_capture_req_method(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_capture_req_method(struct proxy *px, struct stream *strm, unsigned int opt,
                              const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 	char *ptr;
 
-	if (!txn->uri)
+	if (!txn || !txn->uri)
 		return 0;
 
 	ptr = txn->uri;
@@ -10935,14 +10953,14 @@
 
 /* Extracts the path in the HTTP request, the txn->uri should be filled before the call  */
 static int
-smp_fetch_capture_req_uri(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                             const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_capture_req_uri(struct proxy *px, struct stream *strm, unsigned int opt,
+                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 	char *ptr;
 
-	if (!txn->uri)
+	if (!txn || !txn->uri)
 		return 0;
 
 	ptr = txn->uri;
@@ -10974,12 +10992,12 @@
  * as a string (either "HTTP/1.0" or "HTTP/1.1").
  */
 static int
-smp_fetch_capture_req_ver(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_capture_req_ver(struct proxy *px, struct stream *strm, unsigned int opt,
                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 
-	if (txn->req.msg_state < HTTP_MSG_HDR_FIRST)
+	if (!txn || txn->req.msg_state < HTTP_MSG_HDR_FIRST)
 		return 0;
 
 	if (txn->req.flags & HTTP_MSGF_VER_11)
@@ -10998,12 +11016,12 @@
  * as a string (either "HTTP/1.0" or "HTTP/1.1").
  */
 static int
-smp_fetch_capture_res_ver(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_capture_res_ver(struct proxy *px, struct stream *strm, unsigned int opt,
                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn = strm->txn;
 
-	if (txn->rsp.msg_state < HTTP_MSG_HDR_FIRST)
+	if (!txn || txn->rsp.msg_state < HTTP_MSG_HDR_FIRST)
 		return 0;
 
 	if (txn->rsp.flags & HTTP_MSGF_VER_11)
@@ -11029,11 +11047,11 @@
  * The returned sample is of type CSTR. Can be used to parse cookies in other
  * files.
  */
-int smp_fetch_cookie(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+int smp_fetch_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
+                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct http_txn *txn;
+	struct hdr_idx *idx;
 	struct hdr_ctx *ctx = smp->ctx.a[2];
 	const struct http_msg *msg;
 	const char *hdr_name;
@@ -11054,6 +11072,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
+	idx = &strm->txn->hdr_idx;
+
 	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
 		msg = &txn->req;
 		hdr_name = "Cookie";
@@ -11128,11 +11149,11 @@
  * type UINT. Accepts exactly 1 argument of type string.
  */
 static int
-smp_fetch_cookie_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_cookie_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
-	struct hdr_idx *idx = &txn->hdr_idx;
+	struct http_txn *txn;
+	struct hdr_idx *idx;
 	struct hdr_ctx ctx;
 	const struct http_msg *msg;
 	const char *hdr_name;
@@ -11146,6 +11167,9 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
+	idx = &strm->txn->hdr_idx;
+
 	if ((opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ) {
 		msg = &txn->req;
 		hdr_name = "Cookie";
@@ -11195,10 +11219,10 @@
  * takes a mandatory argument of type string. It relies on smp_fetch_cookie().
  */
 static int
-smp_fetch_cookie_val(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_cookie_val(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_cookie(px, l4, l7, opt, args, smp, kw, private);
+	int ret = smp_fetch_cookie(px, strm, opt, args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -11300,12 +11324,11 @@
 }
 
 static int
-smp_fetch_url_param(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_url_param(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	char delim = '?';
-	struct http_txn *txn = l7;
-	struct http_msg *msg = &txn->req;
+	struct http_msg *msg;
 
 	if (!args || args[0].type != ARGT_STR ||
 	    (args[1].type && args[1].type != ARGT_STR))
@@ -11313,6 +11336,8 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	msg = &strm->txn->req;
+
 	if (args[1].type)
 		delim = *args[1].data.str.str;
 
@@ -11331,10 +11356,10 @@
  * above).
  */
 static int
-smp_fetch_url_param_val(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                     const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_url_param_val(struct proxy *px, struct stream *strm, unsigned int opt,
+                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	int ret = smp_fetch_url_param(px, l4, l7, opt, args, smp, kw, private);
+	int ret = smp_fetch_url_param(px, strm, opt, args, smp, kw, private);
 
 	if (ret > 0) {
 		smp->type = SMP_T_UINT;
@@ -11355,10 +11380,10 @@
  * as well as the path
  */
 static int
-smp_fetch_url32(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                 const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_url32(struct proxy *px, struct stream *strm, unsigned int opt,
+                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct http_txn *txn = l7;
+	struct http_txn *txn;
 	struct hdr_ctx ctx;
 	unsigned int hash = 0;
 	char *ptr, *beg, *end;
@@ -11366,6 +11391,7 @@
 
 	CHECK_HTTP_MESSAGE_FIRST();
 
+	txn = strm->txn;
 	ctx.idx = 0;
 	if (http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx)) {
 		/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
@@ -11403,14 +11429,14 @@
  * 8 bytes would still work.
  */
 static int
-smp_fetch_url32_src(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                     const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_url32_src(struct proxy *px, struct stream *strm, unsigned int opt,
+                    const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct chunk *temp;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
-	if (!smp_fetch_url32(px, l4, l7, opt, args, smp, kw, private))
+	if (!smp_fetch_url32(px, strm, opt, args, smp, kw, private))
 		return 0;
 
 	temp = get_trash_chunk();
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index af61c54..b7904e0 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1134,7 +1134,7 @@
 		enum acl_test_res ret = ACL_TEST_PASS;
 
 		if (rule->cond) {
-			ret = acl_exec_cond(rule->cond, s->be, s, s->txn, SMP_OPT_DIR_REQ | partial);
+			ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_REQ | partial);
 			if (ret == ACL_TEST_MISS)
 				goto missing_data;
 
@@ -1175,7 +1175,7 @@
 					continue;
 
 				t = rule->act_prm.trk_ctr.table.t;
-				key = stktable_fetch_key(t, s->be, s, s->txn, SMP_OPT_DIR_REQ | partial, rule->act_prm.trk_ctr.expr, &smp);
+				key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.trk_ctr.expr, &smp);
 
 				if ((smp.flags & SMP_F_MAY_CHANGE) && !(partial & SMP_OPT_FINAL))
 					goto missing_data; /* key might appear later */
@@ -1193,7 +1193,7 @@
 				char **cap = s->req_cap;
 				int len;
 
-				key = sample_fetch_string(s->be, s, s->txn, SMP_OPT_DIR_REQ | partial, rule->act_prm.cap.expr);
+				key = sample_fetch_string(s->be, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.cap.expr);
 				if (!key)
 					continue;
 
@@ -1292,7 +1292,7 @@
 		enum acl_test_res ret = ACL_TEST_PASS;
 
 		if (rule->cond) {
-			ret = acl_exec_cond(rule->cond, s->be, s, s->txn, SMP_OPT_DIR_RES | partial);
+			ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_RES | partial);
 			if (ret == ACL_TEST_MISS) {
 				/* just set the analyser timeout once at the beginning of the response */
 				if (!tick_isset(rep->analyse_exp) && s->be->tcp_rep.inspect_delay)
@@ -1377,7 +1377,7 @@
 		ret = ACL_TEST_PASS;
 
 		if (rule->cond) {
-			ret = acl_exec_cond(rule->cond, sess->fe, s, NULL, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(rule->cond, sess->fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -1407,7 +1407,7 @@
 					continue;
 
 				t = rule->act_prm.trk_ctr.table.t;
-				key = stktable_fetch_key(t, s->be, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
+				key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
 
 				if (key && (ts = stktable_get_entry(t, key)))
 					stream_track_stkctr(&s->stkctr[tcp_trk_idx(rule->action)], t, ts);
@@ -1965,10 +1965,10 @@
 
 /* fetch the connection's source IPv4/IPv6 address */
 static int
-smp_fetch_src(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_src(struct proxy *px, struct stream *strm, unsigned int opt,
               const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
 	if (!cli_conn)
@@ -1993,10 +1993,10 @@
 
 /* set temp integer to the connection's source port */
 static int
-smp_fetch_sport(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sport(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *k, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
 	if (!cli_conn)
@@ -2012,10 +2012,10 @@
 
 /* fetch the connection's destination IPv4/IPv6 address */
 static int
-smp_fetch_dst(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_dst(struct proxy *px, struct stream *strm, unsigned int opt,
               const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
 	if (!cli_conn)
@@ -2042,10 +2042,10 @@
 
 /* set temp integer to the frontend connexion's destination port */
 static int
-smp_fetch_dport(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_dport(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *cli_conn = objt_conn(sess->origin);
 
 	if (!cli_conn)
diff --git a/src/sample.c b/src/sample.c
index c5f5b16..9d53b81 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1022,8 +1022,7 @@
  *   smp      1        0     Present, may change (eg: request length)
  *   smp      1        1     Present, last known value (eg: request length)
  */
-struct sample *sample_process(struct proxy *px, struct stream *l4, void *l7,
-                              unsigned int opt,
+struct sample *sample_process(struct proxy *px, struct stream *strm, unsigned int opt,
                               struct sample_expr *expr, struct sample *p)
 {
 	struct sample_conv_expr *conv_expr;
@@ -1033,7 +1032,7 @@
 		memset(p, 0, sizeof(*p));
 	}
 
-	if (!expr->fetch->process(px, l4, l7, opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
+	if (!expr->fetch->process(px, strm, opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
 		return NULL;
 
 	list_for_each_entry(conv_expr, &expr->conv_exprs, list) {
@@ -1052,7 +1051,7 @@
 
 		/* OK cast succeeded */
 
-		if (!conv_expr->conv->process(l4, conv_expr->arg_p, p, conv_expr->conv->private))
+		if (!conv_expr->conv->process(strm, conv_expr->arg_p, p, conv_expr->conv->private))
 			return NULL;
 	}
 	return p;
@@ -1331,14 +1330,14 @@
  *   smp      1        0     Not present yet, may appear later (eg: header)
  *   smp      1        1     never happens (either flag is cleared on output)
  */
-struct sample *sample_fetch_string(struct proxy *px, struct stream *l4, void *l7,
+struct sample *sample_fetch_string(struct proxy *px, struct stream *strm,
                                    unsigned int opt, struct sample_expr *expr)
 {
 	struct sample *smp = &temp_smp;
 
 	memset(smp, 0, sizeof(*smp));
 
-	if (!sample_process(px, l4, l7, opt, expr, smp)) {
+	if (!sample_process(px, strm, opt, expr, smp)) {
 		if ((smp->flags & SMP_F_MAY_CHANGE) && !(opt & SMP_OPT_FINAL))
 			return smp;
 		return NULL;
@@ -2147,7 +2146,7 @@
 
 /* force TRUE to be returned at the fetch level */
 static int
-smp_fetch_true(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_true(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
@@ -2157,7 +2156,7 @@
 
 /* force FALSE to be returned at the fetch level */
 static int
-smp_fetch_false(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_false(struct proxy *px, struct stream *strm, unsigned int opt,
                 const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
@@ -2167,7 +2166,7 @@
 
 /* retrieve environment variable $1 as a string */
 static int
-smp_fetch_env(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_env(struct proxy *px, struct stream *strm, unsigned int opt,
               const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	char *env;
@@ -2190,7 +2189,7 @@
  * of args[0] seconds.
  */
 static int
-smp_fetch_date(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_date(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->data.uint = date.tv_sec;
@@ -2206,7 +2205,7 @@
 
 /* returns the number of processes */
 static int
-smp_fetch_nbproc(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_nbproc(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
@@ -2216,7 +2215,7 @@
 
 /* returns the number of the current process (between 1 and nbproc */
 static int
-smp_fetch_proc(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_proc(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_UINT;
@@ -2228,7 +2227,7 @@
  * range specified in argument.
  */
 static int
-smp_fetch_rand(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_rand(struct proxy *px, struct stream *strm, unsigned int opt,
                const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->data.uint = random();
@@ -2244,7 +2243,7 @@
 
 /* returns true if the current process is stopping */
 static int
-smp_fetch_stopping(struct proxy *px, struct stream *s, void *l7, unsigned int opt,
+smp_fetch_stopping(struct proxy *px, struct stream *strm, unsigned int opt,
                    const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->type = SMP_T_BOOL;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index e06e96d..f39d973 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -3084,11 +3084,11 @@
 
 /* boolean, returns true if client cert was present */
 static int
-smp_fetch_ssl_fc_has_crt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_has_crt(struct proxy *px, struct stream *strm, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
-	struct session *sess = l4->sess;
+	struct session *sess = strm_sess(strm);
 
 	conn = objt_conn(sess->origin);
 	if (!conn || conn->xprt != &ssl_sock)
@@ -3111,14 +3111,14 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_der(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_der(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3157,14 +3157,14 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_serial(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_serial(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3203,7 +3203,7 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_sha1(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_sha1(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
@@ -3211,7 +3211,7 @@
 	const EVP_MD *digest;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3249,14 +3249,14 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_notafter(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                       const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_x_notafter(struct proxy *px, struct stream *strm, unsigned int opt,
+                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3294,15 +3294,15 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_i_dn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                       const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_x_i_dn(struct proxy *px, struct stream *strm, unsigned int opt,
+                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	X509_NAME *name;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3355,14 +3355,14 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_notbefore(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                       const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_x_notbefore(struct proxy *px, struct stream *strm, unsigned int opt,
+                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3400,15 +3400,15 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_s_dn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                       const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_x_s_dn(struct proxy *px, struct stream *strm, unsigned int opt,
+                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt = NULL;
 	X509_NAME *name;
 	int ret = 0;
 	struct chunk *smp_trash;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3458,11 +3458,11 @@
 
 /* integer, returns true if current session use a client certificate */
 static int
-smp_fetch_ssl_c_used(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                        const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_c_used(struct proxy *px, struct stream *strm, unsigned int opt,
+                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	X509 *crt;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3490,12 +3490,12 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_version(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_version(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3528,13 +3528,13 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_sig_alg(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_sig_alg(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
 	int nid;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3578,13 +3578,13 @@
  * should be use.
  */
 static int
-smp_fetch_ssl_x_key_alg(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_x_key_alg(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int cert_peer = (kw[4] == 'c') ? 1 : 0;
 	X509 *crt;
 	int nid;
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3627,11 +3627,11 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc(struct proxy *px, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
-	struct connection *conn = objt_conn(l4->si[back_conn].end);
+	struct connection *conn = objt_conn(strm->si[back_conn].end);
 
 	smp->type = SMP_T_BOOL;
 	smp->data.uint = (conn && conn->xprt == &ssl_sock);
@@ -3640,7 +3640,7 @@
 
 /* boolean, returns true if client present a SNI */
 static int
-smp_fetch_ssl_fc_has_sni(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_has_sni(struct proxy *px, struct stream *strm, unsigned int opt,
                          const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
@@ -3662,7 +3662,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_cipher(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_cipher(struct proxy *px, struct stream *strm, unsigned int opt,
                         const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3670,7 +3670,7 @@
 
 	smp->flags = 0;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3691,7 +3691,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_alg_keysize(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_alg_keysize(struct proxy *px, struct stream *strm, unsigned int opt,
                              const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3699,7 +3699,7 @@
 
 	smp->flags = 0;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3716,7 +3716,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_use_keysize(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_use_keysize(struct proxy *px, struct stream *strm, unsigned int opt,
                              const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3724,7 +3724,7 @@
 
 	smp->flags = 0;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3739,7 +3739,7 @@
 
 #ifdef OPENSSL_NPN_NEGOTIATED
 static int
-smp_fetch_ssl_fc_npn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_npn(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
@@ -3765,7 +3765,7 @@
 
 #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
 static int
-smp_fetch_ssl_fc_alpn(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_alpn(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	struct connection *conn;
@@ -3794,7 +3794,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_protocol(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_protocol(struct proxy *px, struct stream *strm, unsigned int opt,
                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3802,7 +3802,7 @@
 
 	smp->flags = 0;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3822,7 +3822,7 @@
  * char is 'b'.
  */
 static int
-smp_fetch_ssl_fc_session_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_session_id(struct proxy *px, struct stream *strm, unsigned int opt,
                             const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #if OPENSSL_VERSION_NUMBER > 0x0090800fL
@@ -3833,7 +3833,7 @@
 	smp->flags = SMP_F_CONST;
 	smp->type = SMP_T_BIN;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3852,7 +3852,7 @@
 }
 
 static int
-smp_fetch_ssl_fc_sni(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_fc_sni(struct proxy *px, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
@@ -3878,8 +3878,8 @@
 }
 
 static int
-smp_fetch_ssl_fc_unique_id(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                          const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_ssl_fc_unique_id(struct proxy *px, struct stream *strm, unsigned int opt,
+                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 #if OPENSSL_VERSION_NUMBER > 0x0090800fL
 	int back_conn = (kw[4] == 'b') ? 1 : 0;
@@ -3889,7 +3889,7 @@
 
 	smp->flags = 0;
 
-	conn = objt_conn(l4->si[back_conn].end);
+	conn = objt_conn(strm->si[back_conn].end);
 	if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
 		return 0;
 
@@ -3919,10 +3919,10 @@
 
 /* integer, returns the first verify error in CA chain of client certificate chain. */
 static int
-smp_fetch_ssl_c_ca_err(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_c_ca_err(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3943,10 +3943,10 @@
 
 /* integer, returns the depth of the first verify error in CA chain of client certificate chain. */
 static int
-smp_fetch_ssl_c_ca_err_depth(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_c_ca_err_depth(struct proxy *px, struct stream *strm, unsigned int opt,
                              const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3967,10 +3967,10 @@
 
 /* integer, returns the first verify error on client certificate */
 static int
-smp_fetch_ssl_c_err(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_c_err(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
@@ -3991,10 +3991,10 @@
 
 /* integer, returns the verify result on client cert */
 static int
-smp_fetch_ssl_c_verify(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_ssl_c_verify(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn;
 
 	conn = objt_conn(sess->origin);
diff --git a/src/stick_table.c b/src/stick_table.c
index f0f7808..79ab4fa 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -680,13 +680,13 @@
  *   smp      1        0     not possible
  *   smp      1        1     Present, last known value (eg: request length)
  */
-struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct stream *l4, void *l7,
+struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct stream *strm,
                                         unsigned int opt, struct sample_expr *expr, struct sample *smp)
 {
 	if (smp)
 		memset(smp, 0, sizeof(*smp));
 
-	smp = sample_process(px, l4, l7, opt, expr, smp);
+	smp = sample_process(px, strm, opt, expr, smp);
 	if (!smp)
 		return NULL;
 
diff --git a/src/stream.c b/src/stream.c
index f12b2c3..5833b07 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1391,7 +1391,7 @@
 			int ret = 1;
 
 			if (rule->cond) {
-				ret = acl_exec_cond(rule->cond, fe, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+				ret = acl_exec_cond(rule->cond, fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 				ret = acl_pass(ret);
 				if (rule->cond->pol == ACL_COND_UNLESS)
 					ret = !ret;
@@ -1444,7 +1444,7 @@
 		int ret = 1;
 
 		if (prst_rule->cond) {
-	                ret = acl_exec_cond(prst_rule->cond, s->be, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+	                ret = acl_exec_cond(prst_rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (prst_rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -1502,7 +1502,7 @@
 		list_for_each_entry(rule, &px->server_rules, list) {
 			int ret;
 
-			ret = acl_exec_cond(rule->cond, s->be, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+			ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -1567,7 +1567,7 @@
 			continue;
 
 		if (rule->cond) {
-	                ret = acl_exec_cond(rule->cond, px, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+	                ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
 			ret = acl_pass(ret);
 			if (rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -1576,7 +1576,7 @@
 		if (ret) {
 			struct stktable_key *key;
 
-			key = stktable_fetch_key(rule->table.t, px, s, s->txn, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->expr, NULL);
+			key = stktable_fetch_key(rule->table.t, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->expr, NULL);
 			if (!key)
 				continue;
 
@@ -1670,7 +1670,7 @@
 			continue;
 
 		if (rule->cond) {
-	                ret = acl_exec_cond(rule->cond, px, s, s->txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+	                ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
 	                ret = acl_pass(ret);
 			if (rule->cond->pol == ACL_COND_UNLESS)
 				ret = !ret;
@@ -1679,7 +1679,7 @@
 		if (ret) {
 			struct stktable_key *key;
 
-			key = stktable_fetch_key(rule->table.t, px, s, s->txn, SMP_OPT_DIR_RES|SMP_OPT_FINAL, rule->expr, NULL);
+			key = stktable_fetch_key(rule->table.t, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, rule->expr, NULL);
 			if (!key)
 				continue;
 
@@ -2951,12 +2951,12 @@
  * Supports being called as "sc[0-9]_tracked" only.
  */
 static int
-smp_fetch_sc_tracked(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                      const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_sc_tracked(struct proxy *px, struct stream *strm, unsigned int opt,
+                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
 	smp->type = SMP_T_BOOL;
-	smp->data.uint = !!smp_fetch_sc_stkctr(l4, args, kw);
+	smp->data.uint = !!smp_fetch_sc_stkctr(strm, args, kw);
 	return 1;
 }
 
@@ -2966,10 +2966,10 @@
  * zero is returned if the key is new.
  */
 static int
-smp_fetch_sc_get_gpc0(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_get_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -2993,10 +2993,10 @@
  * Value zero is returned if the key is new.
  */
 static int
-smp_fetch_sc_gpc0_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_gpc0_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3019,10 +3019,10 @@
  * Supports being called as "sc[0-9]_inc_gpc0" or "src_inc_gpc0" only.
  */
 static int
-smp_fetch_sc_inc_gpc0(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_inc_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3056,10 +3056,10 @@
  * Supports being called as "sc[0-9]_clr_gpc0" or "src_clr_gpc0" only.
  */
 static int
-smp_fetch_sc_clr_gpc0(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_clr_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3082,10 +3082,10 @@
  * "src_conn_cnt" only.
  */
 static int
-smp_fetch_sc_conn_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_conn_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3107,10 +3107,10 @@
  * only.
  */
 static int
-smp_fetch_sc_conn_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_conn_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3133,10 +3133,10 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_src_updt_conn_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_src_updt_conn_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                             const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct session *sess = strm_sess(l4);
+	struct session *sess = strm_sess(strm);
 	struct connection *conn = objt_conn(sess->origin);
 	struct stksess *ts;
 	struct stktable_key *key;
@@ -3170,10 +3170,10 @@
  * "src_conn_cur" only.
  */
 static int
-smp_fetch_sc_conn_cur(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_conn_cur(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3195,10 +3195,10 @@
  * "src_sess_cnt" only.
  */
 static int
-smp_fetch_sc_sess_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_sess_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                       const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3219,10 +3219,10 @@
  * Supports being called as "sc[0-9]_sess_rate" or "src_sess_rate" only.
  */
 static int
-smp_fetch_sc_sess_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3245,10 +3245,10 @@
  * "src_http_req_cnt" only.
  */
 static int
-smp_fetch_sc_http_req_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_http_req_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3270,10 +3270,10 @@
  * "src_http_req_rate" only.
  */
 static int
-smp_fetch_sc_http_req_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_http_req_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                            const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3296,10 +3296,10 @@
  * "src_http_err_cnt" only.
  */
 static int
-smp_fetch_sc_http_err_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_http_err_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                           const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3321,10 +3321,10 @@
  * "src_http_err_rate" only.
  */
 static int
-smp_fetch_sc_http_err_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_http_err_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                            const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3347,10 +3347,10 @@
  * "sc[0-9]_kbytes_in" or "src_kbytes_in" only.
  */
 static int
-smp_fetch_sc_kbytes_in(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_kbytes_in(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3372,10 +3372,10 @@
  * "sc[0-9]_bytes_in_rate" or "src_bytes_in_rate" only.
  */
 static int
-smp_fetch_sc_bytes_in_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_bytes_in_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                            const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3398,10 +3398,10 @@
  * "sc[0-9]_kbytes_out" or "src_kbytes_out" only.
  */
 static int
-smp_fetch_sc_kbytes_out(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
-                       const struct arg *args, struct sample *smp, const char *kw, void *private)
+smp_fetch_sc_kbytes_out(struct proxy *px, struct stream *strm, unsigned int opt,
+                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3423,10 +3423,10 @@
  * "sc[0-9]_bytes_out_rate" or "src_bytes_out_rate" only.
  */
 static int
-smp_fetch_sc_bytes_out_rate(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_bytes_out_rate(struct proxy *px, struct stream *strm, unsigned int opt,
                             const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3448,10 +3448,10 @@
  * tracked frontend counters. Supports being called as "sc[0-9]_trackers" only.
  */
 static int
-smp_fetch_sc_trackers(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_sc_trackers(struct proxy *px, struct stream *strm, unsigned int opt,
                        const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
-	struct stkctr *stkctr = smp_fetch_sc_stkctr(l4, args, kw);
+	struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
 
 	if (!stkctr)
 		return 0;
@@ -3466,7 +3466,7 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_table_cnt(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_table_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	smp->flags = SMP_F_VOL_TEST;
@@ -3479,7 +3479,7 @@
  * Accepts exactly 1 argument of type table.
  */
 static int
-smp_fetch_table_avl(struct proxy *px, struct stream *l4, void *l7, unsigned int opt,
+smp_fetch_table_avl(struct proxy *px, struct stream *strm, unsigned int opt,
                     const struct arg *args, struct sample *smp, const char *kw, void *private)
 {
 	px = args->data.prx;