diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h index e488a5e8e..fd345d51a 100644 --- a/include/proto/dumpstats.h +++ b/include/proto/dumpstats.h @@ -39,7 +39,7 @@ #define STATS_TYPE_SO 3 /* unix stats socket states */ -#define STAT_CLI_INIT 0 /* initial state */ +#define STAT_CLI_INIT 0 /* initial state, must leave to zero ! */ #define STAT_CLI_END 1 /* final state, let's close */ #define STAT_CLI_GETREQ 2 /* wait for a request */ #define STAT_CLI_OUTPUT 3 /* all states after this one are responses */ diff --git a/src/dumpstats.c b/src/dumpstats.c index 1b6fe3d34..6cc2bcd91 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -156,14 +156,8 @@ extern const char *stat_status_codes[]; */ static int stats_accept(struct session *s) { - struct appctx *appctx; - s->target = &cli_applet.obj_type; - appctx = stream_int_register_handler(&s->si[1], objt_applet(s->target)); - if (!appctx) - return -1; - appctx->st1 = 0; - appctx->st0 = STAT_CLI_INIT; + /* no need to initialize the applet, it will start with st0=st1 = 0 */ tv_zero(&s->logs.tv_request); s->logs.t_queue = 0;