[MEDIUM] store a complete dump of request and response errors in proxies

Each proxy instance, either frontend or backend, now has some room
dedicated to storing a complete dated request or response in case
of parsing error. This will make it possible to consult errors in
order to find the exact cause, which is particularly important for
troubleshooting faulty applications.
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 2f67791..9adf5cd 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -123,6 +123,17 @@
 	int next_weight;        /* total weight of the next time range */
 }; 
 
+struct error_snapshot {
+	struct timeval when;		/* date of this event, (tv_sec == 0) means "never" */
+	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 */
+	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 */
+	char buf[BUFSIZE];		/* copy of the beginning of the message */
+};
+
 struct proxy {
 	struct listener *listen;		/* the listen addresses and sockets */
 	struct in_addr mon_net, mon_mask;	/* don't forward connections from this net (network order) FIXME: should support IPv6 */
@@ -259,6 +270,7 @@
 	int next_svid;				/* next server-id, used for SNMP */
 	unsigned int backlog;			/* force the frontend's listen backlog */
 	unsigned int bind_proc;			/* bitmask of processes using this proxy. 0 = all. */
+	struct error_snapshot invalid_req, invalid_rep; /* captures of last errors */
 };
 
 struct switching_rule {