diff --git a/include/haproxy/listener-t.h b/include/haproxy/listener-t.h index 25449e451..6edb52e51 100644 --- a/include/haproxy/listener-t.h +++ b/include/haproxy/listener-t.h @@ -245,7 +245,6 @@ struct listener { struct fe_counters *counters; /* statistics counters */ int nbconn; /* current number of connections on this listener */ - enum obj_type *default_target; /* default target to use for accepted sessions or NULL */ /* cache line boundary */ struct mt_list wait_queue; /* link element to make the listener wait for something (LI_LIMITED) */ unsigned int thr_idx; /* thread indexes for queue distribution : (t2<<16)+t1 */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 88e772871..666d5c33b 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -747,7 +747,6 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) * Newly allocated listener is at the end of the list */ l = LIST_ELEM(bind_conf->listeners.p, typeof(l), by_bind); - l->default_target = curpeers->peers_fe->default_target; l->options |= LI_O_UNLIMITED; /* don't make the peers subject to global limits */ global.maxsock++; /* for the listening socket */ @@ -972,7 +971,6 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) * Newly allocated listener is at the end of the list */ l = LIST_ELEM(bind_conf->listeners.p, typeof(l), by_bind); - l->default_target = curpeers->peers_fe->default_target; l->options |= LI_O_UNLIMITED; /* don't make the peers subject to global limits */ global.maxsock++; /* for the listening socket */ } @@ -4329,8 +4327,6 @@ int check_config_validity() } #endif - listener->default_target = curproxy->default_target; - if (!LIST_ISEMPTY(&curproxy->tcp_req.l4_rules)) listener->options |= LI_O_TCP_L4_RULES; diff --git a/src/cli.c b/src/cli.c index c917ea21e..4b78fdac1 100644 --- a/src/cli.c +++ b/src/cli.c @@ -552,8 +552,8 @@ static int cli_parse_global(char **args, int section_type, struct proxy *curpx, } bind_conf->accept = session_accept_fd; + list_for_each_entry(l, &bind_conf->listeners, by_bind) { - l->default_target = global.cli_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++; /* for the listening socket */ @@ -3045,8 +3045,8 @@ struct bind_conf *mworker_cli_proxy_new_listener(char *line) bind_conf->accept = session_accept_fd; + list_for_each_entry(l, &bind_conf->listeners, by_bind) { - l->default_target = mworker_proxy->default_target; /* don't make the peers subject to global limits and don't close it in the master */ l->options |= LI_O_UNLIMITED; l->rx.flags |= RX_F_MWORKER; /* we are keeping this FD in the master */ @@ -3112,8 +3112,8 @@ int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc) ha_free(&path); bind_conf->accept = session_accept_fd; + list_for_each_entry(l, &bind_conf->listeners, by_bind) { - l->default_target = global.cli_fe->default_target; l->options |= (LI_O_UNLIMITED | LI_O_NOSTOP); HA_ATOMIC_INC(&unstoppable_jobs); /* it's a sockpair but we don't want to keep the fd in the master */ diff --git a/src/log.c b/src/log.c index b64262148..04ead1f6b 100644 --- a/src/log.c +++ b/src/log.c @@ -3826,7 +3826,6 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm) } } list_for_each_entry(l, &bind_conf->listeners, by_bind) { - l->default_target = cfg_log_forward->default_target; global.maxsock++; } cur_arg++; diff --git a/src/stream.c b/src/stream.c index ce90151bd..19e54b666 100644 --- a/src/stream.c +++ b/src/stream.c @@ -491,7 +491,7 @@ struct stream *stream_new(struct session *sess, struct stconn *sc, struct buffer } stream_init_srv_conn(s); - s->target = sess->listener ? sess->listener->default_target : NULL; + s->target = sess->fe->default_target; s->pend_pos = NULL; s->priority_class = 0;