time_t last_change; /* last time, when the state was changed */
int (*accept)(struct session *s); /* application layer's accept() */
struct conn_src conn_src; /* connection source settings */
+ enum obj_type *default_target; /* default target to use for accepted sessions or NULL */
struct proxy *next;
unsigned int log_count; /* number of logs produced by the frontend */
*/
static int stats_accept(struct session *s)
{
- s->target = &cli_applet.obj_type;
/* no need to initialize the applet, it will start with st0=st1 = 0 */
tv_zero(&s->logs.tv_request);
fe->conf.file = strdup(file);
fe->conf.line = line;
fe->accept = stats_accept;
+ fe->default_target = &cli_applet.obj_type;
/* the stats frontend is the only one able to assign ID #0 */
fe->conf.id.key = fe->uuid = 0;
*/
static int peer_accept(struct session *s)
{
- s->target = &peer_applet.obj_type;
/* no need to initialize the applet, it will start with st0=st1 = 0 */
tv_zero(&s->logs.tv_request);
fe->conn_retries = CONN_RETRIES;
fe->timeout.client = MS_TO_TICKS(5000);
fe->accept = peer_accept;
+ fe->default_target = &peer_applet.obj_type;
fe->options2 |= PR_O2_INDEPSTR | PR_O2_SMARTCON | PR_O2_SMARTACC;
}
s->si[1].flags |= SI_FL_INDEP_STR;
session_init_srv_conn(s);
- s->target = NULL;
+ s->target = p->default_target; /* used by peers and CLI */
s->pend_pos = NULL;
/* init store persistence */