/* data transmission states for the stats responses */
enum stat_state {
- STAT_ST_INIT = 0,
- STAT_ST_HEAD,
- STAT_ST_INFO,
- STAT_ST_LIST,
- STAT_ST_END,
- STAT_ST_FIN,
+ STAT_STATE_INIT = 0,
+ STAT_STATE_HEAD,
+ STAT_STATE_INFO,
+ STAT_STATE_LIST,
+ STAT_STATE_END,
+ STAT_STATE_FIN,
+};
+
+/* kept in 2.6 only for compatibility with legacy code. Will be removed in 2.7,
+ * please do not use these values anymore and defined your own!
+ */
+enum obsolete_stat_state {
+ STAT_ST_INIT __attribute__((deprecated)) = 0,
+ STAT_ST_HEAD __attribute__((deprecated)),
+ STAT_ST_INFO __attribute__((deprecated)),
+ STAT_ST_LIST __attribute__((deprecated)),
+ STAT_ST_END __attribute__((deprecated)),
+ STAT_ST_FIN __attribute__((deprecated)),
};
/* data transmission states for the stats responses inside a proxy */
struct htx_sl *sl;
appctx->st1 = 0;
- ctx->state = STAT_ST_INIT;
+ ctx->state = STAT_STATE_INIT;
ctx->st_code = STAT_STATUS_INIT;
ctx->flags |= uri_auth->flags;
ctx->flags |= STAT_FMT_HTML; /* assume HTML mode by default */
chunk_reset(&trash);
switch (ctx->state) {
- case STAT_ST_INIT:
- ctx->state = STAT_ST_HEAD; /* let's start producing data */
+ case STAT_STATE_INIT:
+ ctx->state = STAT_STATE_HEAD; /* let's start producing data */
/* fall through */
- case STAT_ST_HEAD:
+ case STAT_STATE_HEAD:
if (ctx->flags & STAT_FMT_HTML)
stats_dump_html_head(appctx, uri);
else if (ctx->flags & STAT_JSON_SCHM)
goto full;
if (ctx->flags & STAT_JSON_SCHM) {
- ctx->state = STAT_ST_FIN;
+ ctx->state = STAT_STATE_FIN;
return 1;
}
- ctx->state = STAT_ST_INFO;
+ ctx->state = STAT_STATE_INFO;
/* fall through */
- case STAT_ST_INFO:
+ case STAT_STATE_INFO:
if (ctx->flags & STAT_FMT_HTML) {
stats_dump_html_info(cs, uri);
if (!stats_putchk(rep, htx, &trash))
ctx->obj1 = proxies_list;
ctx->px_st = STAT_PX_ST_INIT;
- ctx->state = STAT_ST_LIST;
+ ctx->state = STAT_STATE_LIST;
/* fall through */
- case STAT_ST_LIST:
+ case STAT_STATE_LIST:
switch (domain) {
case STATS_DOMAIN_RESOLVERS:
if (!stats_dump_resolvers(cs, stat_l[domain],
break;
}
- ctx->state = STAT_ST_END;
+ ctx->state = STAT_STATE_END;
/* fall through */
- case STAT_ST_END:
+ case STAT_STATE_END:
if (ctx->flags & (STAT_FMT_HTML|STAT_FMT_JSON)) {
if (ctx->flags & STAT_FMT_HTML)
stats_dump_html_end();
goto full;
}
- ctx->state = STAT_ST_FIN;
+ ctx->state = STAT_STATE_FIN;
/* fall through */
- case STAT_ST_FIN:
+ case STAT_STATE_FIN:
return 1;
default:
/* unknown state ! */
- ctx->state = STAT_ST_FIN;
+ ctx->state = STAT_STATE_FIN;
return -1;
}