[MINOR] stats: report HTTP message state and buffer flags in error dumps

Debugging parsing errors can be greatly improved if we know what the parser
state was and what the buffer flags were (especially for closed inputs/outputs
and full buffers). Let's add that to the error snapshots.
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index e7181ec..417d5e6 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -91,7 +91,7 @@
 void http_return_srv_error(struct session *s, struct stream_interface *si);
 void http_capture_bad_message(struct error_snapshot *es, struct session *s,
                               struct buffer *buf, struct http_msg *msg,
-			      struct proxy *other_end);
+			      int state, struct proxy *other_end);
 unsigned int get_ip_from_hdr2(struct http_msg *msg, const char *hname, int hlen,
 			      struct hdr_idx *idx, int occ);
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 9704783..89cb09b 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -161,6 +161,8 @@
 	unsigned int len;		/* original length of the last invalid request/response */
 	unsigned int pos;		/* position of the first invalid character */
 	unsigned int sid;		/* ID of the faulty session */
+	unsigned int state;		/* message state before the error (when saved) */
+	unsigned int flags;		/* buffer flags */
 	struct server *srv;		/* server associated with the error (or NULL) */
 	struct proxy *oe;		/* other end = frontend or backend involved */
 	struct sockaddr_storage src;	/* client's address */