[MEDIUM] fix stats socket limitation to 16 kB

Due to the way the stats socket work, it was not possible to
maintain the information related to the command entered, so
after filling a whole buffer, the request was lost and it was
considered that there was nothing to write anymore.

The major reason was that some flags were passed directly
during the first call to stats_dump_raw() instead of being
stored persistently in the session.

To definitely fix this problem, flags were added to the stats
member of the session structure.

A second problem appeared. When the stats were produced, a first
call to client_retnclose() was performed, then one or multiple
subsequent calls to buffer_write_chunks() were done. But once the
stats buffer was full and a reschedule operated, the buffer was
flushed, the write flag cleared from the buffer and nothing was
done to re-arm it.

For this reason, a check was added in the proto_uxst_stats()
function in order to re-call the client FSM when data were added
by stats_dump_raw(). Finally, the whole unix stats dump FSM was
rewritten to avoid all the magics it depended on. It is now
simpler and looks more like the HTTP one.
diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h
index 3626505..6cca84f 100644
--- a/include/proto/dumpstats.h
+++ b/include/proto/dumpstats.h
@@ -27,18 +27,22 @@
 #include <types/buffers.h>
 #include <types/session.h>
 
-#define STAT_FMT_HTML  0x1
-#define STAT_SHOW_STAT 0x2
-#define STAT_SHOW_INFO 0x4
+/* Flags for session->data_ctx.stats.flags */
+#define STAT_FMT_CSV    0x00000001	/* dump the stats in CSV format instead of HTML */
+#define STAT_SHOW_STAT  0x00000002	/* dump the stats part */
+#define STAT_SHOW_INFO  0x00000004	/* dump the info part */
+#define STAT_HIDE_DOWN  0x00000008	/* hide 'down' servers in the stats page */
+#define STAT_NO_REFRESH 0x00000010	/* do not automatically refresh the stats page */
+#define STAT_BOUND      0x00800000	/* bound statistics to selected proxies/types/services */
 
 #define STATS_TYPE_FE  0
 #define STATS_TYPE_BE  1
 #define STATS_TYPE_SV  2
 
 int stats_parse_global(const char **args, char *err, int errlen);
-int stats_dump_raw(struct session *s, struct uri_auth *uri, int flags);
-int stats_dump_http(struct session *s, struct uri_auth *uri, int flags);
-int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri, int flags);
+int stats_dump_raw(struct session *s, struct uri_auth *uri);
+int stats_dump_http(struct session *s, struct uri_auth *uri);
+int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri);
 
 
 #endif /* _PROTO_DUMPSTATS_H */