MINOR: stats: Add the status code STAT_STATUS_IVAL to handle invalid requests

This patch must be backported to 1.9 because a bug fix depends on it.
This commit is contained in:
Christopher Faulet 2019-02-27 16:41:27 +01:00 committed by Willy Tarreau
parent 0ae79d0b0e
commit 3c2ecf75c8
3 changed files with 12 additions and 0 deletions

View File

@ -193,6 +193,7 @@ enum {
STAT_STATUS_NONE, /* nothing happened (no action chosen or servers state didn't change) */
STAT_STATUS_PART, /* the action is partially successful */
STAT_STATUS_UNKN, /* an unknown error occurred, shouldn't happen */
STAT_STATUS_IVAL, /* invalid requests (chunked or invalid post) */
STAT_STATUS_SIZE
};

View File

@ -84,6 +84,7 @@ const char *stat_status_codes[STAT_STATUS_SIZE] = {
[STAT_STATUS_NONE] = "NONE",
[STAT_STATUS_PART] = "PART",
[STAT_STATUS_UNKN] = "UNKN",
[STAT_STATUS_IVAL] = "IVAL",
};
/* This function handles a server error at the stream interface level. The

View File

@ -2572,6 +2572,16 @@ static void stats_dump_html_info(struct stream_interface *si, struct uri_auth *u
(appctx->ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "",
scope_txt);
break;
case STAT_STATUS_IVAL:
chunk_appendf(&trash,
"<p><div class=active_down>"
"<a class=lfsb href=\"%s%s%s%s\" title=\"Remove this message\">[X]</a> "
"<b>Invalid requests (unsupported method or chunked encoded request).</b>"
"</div>\n", uri->uri_prefix,
(appctx->ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "",
(appctx->ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "",
scope_txt);
break;
default:
chunk_appendf(&trash,
"<p><div class=active_no_check>"