]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: Move stuff about the stats status codes in stats files
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Feb 2019 15:42:58 +0000 (16:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Mar 2019 13:34:59 +0000 (14:34 +0100)
The status codes definition (STAT_STATUS_*) and their string representation
stat_status_codes) have been moved in stats files. There is no reason to keep
them in proto_http files.

include/proto/stats.h
include/types/proto_http.h
include/types/stats.h
src/proto_http.c
src/stats.c

index 77edda9b18ba3093bf22ab7385f3bf562bfbfe87..01c96cb23a2c257062e1e857fdbe9ec3fa0e0fc2 100644 (file)
@@ -84,6 +84,8 @@ static inline struct field mkf_str(uint32_t type, const char *value)
        return f;
 }
 
+extern const char *stat_status_codes[];
+
 /* These two structs contains all field names according with
  * the the number of entries in "enum stat_field" and
  * "enum info_field"
index 4af1361450b0969dabe68ca9cbba562ce92311d1..8fc0feb90e8b9640e6c01111ab73dd1f4ff85ba7 100644 (file)
@@ -183,20 +183,6 @@ enum rule_result {
        HTTP_RULE_RES_BADREQ,    /* bad request */
 };
 
-/* status codes available for the stats admin page */
-enum {
-       STAT_STATUS_INIT = 0,
-       STAT_STATUS_DENY,       /* action denied */
-       STAT_STATUS_DONE,       /* the action is successful */
-       STAT_STATUS_ERRP,       /* an error occurred due to invalid values in parameters */
-       STAT_STATUS_EXCD,       /* an error occurred because the buffer couldn't store all data */
-       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
-};
-
 /* Legacy version of the HTTP/1 message state, used by the channels, should
  * ultimately be removed.
  */
index ec29c786b0f790b09f71cf6d267377f751641155..f416af1de8900408a08f48049a160b4384a42972 100644 (file)
@@ -45,6 +45,20 @@ enum {
        STAT_HTTP_LAST,      /* sending last chunk of response */
 };
 
+/* status codes available for the stats admin page */
+enum {
+       STAT_STATUS_INIT = 0,
+       STAT_STATUS_DENY,       /* action denied */
+       STAT_STATUS_DONE,       /* the action is successful */
+       STAT_STATUS_ERRP,       /* an error occurred due to invalid values in parameters */
+       STAT_STATUS_EXCD,       /* an error occurred because the buffer couldn't store all data */
+       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
+};
+
 /* HTML form to limit output scope */
 #define STAT_SCOPE_TXT_MAXLEN 20      /* max len for scope substring */
 #define STAT_SCOPE_INPUT_NAME "scope" /* pattern form scope name <input> in html form */
index 0127e23b59b8c763e91a785046fe074dc650abdb..7bf0e20f28a174023c7d767948e35942769b3411 100644 (file)
 #include <proto/pattern.h>
 #include <proto/vars.h>
 
-/* status codes available for the stats admin page (strictly 4 chars length) */
-const char *stat_status_codes[STAT_STATUS_SIZE] = {
-       [STAT_STATUS_DENY] = "DENY",
-       [STAT_STATUS_DONE] = "DONE",
-       [STAT_STATUS_ERRP] = "ERRP",
-       [STAT_STATUS_EXCD] = "EXCD",
-       [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
  * stream interface is assumed to be already in a closed state. An optional
  * message is copied into the input buffer.
index 6f563533018b501459d72eaf3bef71dbf34ef42a..7c20453d94c742160f2ad629e7f2ae7bfe8fe797 100644 (file)
 #endif
 
 
+/* status codes available for the stats admin page (strictly 4 chars length) */
+const char *stat_status_codes[STAT_STATUS_SIZE] = {
+       [STAT_STATUS_DENY] = "DENY",
+       [STAT_STATUS_DONE] = "DONE",
+       [STAT_STATUS_ERRP] = "ERRP",
+       [STAT_STATUS_EXCD] = "EXCD",
+       [STAT_STATUS_NONE] = "NONE",
+       [STAT_STATUS_PART] = "PART",
+       [STAT_STATUS_UNKN] = "UNKN",
+       [STAT_STATUS_IVAL] = "IVAL",
+};
+
 /* These are the field names for each INF_* field position. Please pay attention
  * to always use the exact same name except that the strings for new names must
  * be lower case or CamelCase while the enum entries must be upper case.
@@ -294,8 +306,6 @@ static const char *stats_scope_ptr(struct appctx *appctx, struct stream_interfac
  */
 
 
-extern const char *stat_status_codes[];
-
 /* Dumps the stats CSV header to the trash buffer which. The caller is responsible
  * for clearing it if needed.
  * NOTE: Some tools happen to rely on the field position instead of its name,