MEDIUM: listener: store the default target per listener
This will be useful later to state that some listeners have to use
certain decoders (typically an HTTP/2 decoder) regardless of the
regular processing applied to other listeners. For now it simply
defaults to the frontend's default target, and it is used by the
session.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5fe3ffb..b17527d 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1887,6 +1887,7 @@
l->accept = session_accept;
l->handler = process_session;
l->analysers |= ((struct proxy *)curpeers->peers_fe)->fe_req_ana;
+ l->default_target = ((struct proxy *)curpeers->peers_fe)->default_target;
l->options |= LI_O_UNLIMITED; /* don't make the peers subject to global limits */
global.maxsock += l->maxconn;
}
@@ -7710,6 +7711,7 @@
listener->accept = session_accept;
listener->handler = process_session;
listener->analysers |= curproxy->fe_req_ana;
+ listener->default_target = curproxy->default_target;
if (!LIST_ISEMPTY(&curproxy->tcp_req.l4_rules))
listener->options |= LI_O_TCP_RULES;
diff --git a/src/dumpstats.c b/src/dumpstats.c
index ba72d71..c23e988 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -339,6 +339,7 @@
l->backlog = global.stats_fe->backlog;
l->accept = session_accept;
l->handler = process_session;
+ l->default_target = global.stats_fe->default_target;
l->options |= LI_O_UNLIMITED; /* don't make the peers subject to global limits */
l->nice = -64; /* we want to boost priority for local stats */
global.maxsock += l->maxconn;
diff --git a/src/session.c b/src/session.c
index 7a00b0d..677d3a1 100644
--- a/src/session.c
+++ b/src/session.c
@@ -481,7 +481,7 @@
s->si[1].flags |= SI_FL_INDEP_STR;
session_init_srv_conn(s);
- s->target = p->default_target; /* used by peers and CLI */
+ s->target = l->default_target; /* used by peers and CLI */
s->pend_pos = NULL;
/* init store persistence */