[MINOR] pre-set analyser flags on the listener at registration time

In order to achieve more generic accept() code, we can set the request
analysers at the listener registration time. It's better than doing it
during accept(), and allows more code reuse.
diff --git a/include/types/protocols.h b/include/types/protocols.h
index 0816351..4c64551 100644
--- a/include/types/protocols.h
+++ b/include/types/protocols.h
@@ -88,6 +88,7 @@
 	void (*handler)(struct task *t, int *next); /* protocol handler */
 	int  *timeout;                  /* pointer to client-side timeout */
 	void *private;			/* any private data which may be used by accept() */
+	unsigned int analysers;		/* bitmap of required protocol analysers */
 	union {				/* protocol-dependant access restrictions */
 		struct {		/* UNIX socket permissions */
 			uid_t uid;	/* -1 to leave unchanged */
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5f4e123..df297b6 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -46,6 +46,7 @@
 #include <proto/proto_http.h>
 #include <proto/proxy.h>
 #include <proto/server.h>
+#include <proto/session.h>
 #include <proto/task.h>
 
 
@@ -3218,6 +3219,13 @@
 			listener->timeout = &curproxy->timeout.client;
 			listener->accept = event_accept;
 			listener->private = curproxy;
+			listener->handler = process_session;
+
+			if (curproxy->mode == PR_MODE_HTTP)
+				listener->analysers |= AN_REQ_HTTP_HDR;
+
+			if (curproxy->tcp_req.inspect_delay)
+				listener->analysers |= AN_REQ_INSPECT;
 
 			listener = listener->next;
 		}
diff --git a/src/client.c b/src/client.c
index bf7f55c..65ffdaa 100644
--- a/src/client.c
+++ b/src/client.c
@@ -153,7 +153,7 @@
 			setsockopt(cfd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger));
 
 		task_init(t);
-		t->process = process_session;
+		t->process = l->handler;
 		t->context = s;
 
 		s->task = t;
@@ -366,11 +366,8 @@
 		if (p->mode == PR_MODE_HTTP) /* reserve some space for header rewriting */
 			s->req->rlim -= MAXREWRITE;
 
-		if (s->fe->tcp_req.inspect_delay)
-			s->req->analysers |= AN_REQ_INSPECT;
-
-		if (p->mode == PR_MODE_HTTP)
-			s->req->analysers |= AN_REQ_HTTP_HDR;
+		/* activate default analysers enabled for this listener */
+		s->req->analysers = l->analysers;
 
 		if (!s->req->analysers)
 			buffer_write_ena(s->req);  /* don't wait to establish connection */