[MEDIUM] enable/disable servers from the stats web interface
Based on a patch provided by Judd Montgomery, it is now possible to
enable/disable servers from the stats web interface. This allows to select
several servers in a backend and apply the action to them at the same time.
Currently, there are 2 known limitations :
- The POST data are limited to one packet
(don't alter too many servers at a time).
- Expect: 100-continue is not supported.
(cherry picked from commit 7693948766cb5647ac03b48e782cfee2b1f14491)
diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h
index 56d8abb..7038f46 100644
--- a/include/proto/dumpstats.h
+++ b/include/proto/dumpstats.h
@@ -53,6 +53,12 @@
#define STAT_CLI_O_ERR 7 /* dump errors */
#define STAT_CLI_O_TAB 8 /* dump tables */
+/* status codes (strictly 4 chars) used in the URL to display a message */
+#define STAT_STATUS_UNKN "UNKN" /* an unknown error occured, shouldn't happen */
+#define STAT_STATUS_DONE "DONE" /* the action is successful */
+#define STAT_STATUS_NONE "NONE" /* nothing happened (no action chosen or servers state didn't change) */
+#define STAT_STATUS_EXCD "EXCD" /* an error occured becayse the buffer couldn't store all data */
+
int stats_accept(struct session *s);
int stats_sock_parse_request(struct stream_interface *si, char *line);
diff --git a/include/types/session.h b/include/types/session.h
index d1e54ac..0bbb9bf 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -217,6 +217,7 @@
short px_st, sv_st; /* DATA_ST_INIT or DATA_ST_DATA */
unsigned int flags; /* STAT_* */
int iid, type, sid; /* proxy id, type and service id if bounding of stats is enabled */
+ const char *st_code; /* pointer to the status code returned by an action */
} stats;
struct {
struct bref bref; /* back-reference from the session being dumped */