MINOR: stats: replace STAT_FMT_CSV with STAT_FMT_HTML
We need to switch the default mode if we want to add new output formats
later. Let CSV be the default and HTML be an option.
diff --git a/src/proto_http.c b/src/proto_http.c
index 60b630d..d49ef05 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3022,7 +3022,7 @@
"Cache-Control: no-cache\r\n"
"Connection: close\r\n"
"Content-Type: %s\r\n",
- (si->applet.ctx.stats.flags & STAT_FMT_CSV) ? "text/plain" : "text/html");
+ (si->applet.ctx.stats.flags & STAT_FMT_HTML) ? "text/html" : "text/plain");
if (uri->refresh > 0 && !(si->applet.ctx.stats.flags & STAT_NO_REFRESH))
chunk_appendf(&trash, "Refresh: %d\r\n",
@@ -7651,6 +7651,7 @@
memset(&si->applet.ctx.stats, 0, sizeof(si->applet.ctx.stats));
si->applet.ctx.stats.st_code = STAT_STATUS_INIT;
+ si->applet.ctx.stats.flags |= STAT_FMT_HTML; /* assume HTML mode by default */
/* check URI size */
if (uri_auth->uri_len > msg->sl.rq.u_l)
@@ -7683,7 +7684,7 @@
h = uri + uri_auth->uri_len;
while (h <= uri + msg->sl.rq.u_l - 4) {
if (memcmp(h, ";csv", 4) == 0) {
- si->applet.ctx.stats.flags |= STAT_FMT_CSV;
+ si->applet.ctx.stats.flags &= ~STAT_FMT_HTML;
break;
}
h++;