MINOR: session: start to reintroduce struct session

There is now a pointer to the session in the stream, which is NULL
for now. The session pool is created as well. Some parts will move
from the stream to the session now.
diff --git a/src/haproxy.c b/src/haproxy.c
index 11b7810..591bb96 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -97,6 +97,7 @@
 #include <proto/proxy.h>
 #include <proto/queue.h>
 #include <proto/server.h>
+#include <proto/session.h>
 #include <proto/stream.h>
 #include <proto/signal.h>
 #include <proto/task.h>
@@ -560,6 +561,7 @@
 		exit(1);
 	init_task();
 	init_stream();
+	init_session();
 	init_connection();
 	/* warning, we init buffers later */
 	init_pendconn();
diff --git a/src/hlua.c b/src/hlua.c
index a13b8ce..cdbce00 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2127,6 +2127,7 @@
 	/* The stream dont have listener. The listener is used with real
 	 * proxies.
 	 */
+	socket->s->sess = NULL;
 	socket->s->listener = NULL;
 
 	/* The flags are initialized to 0. Values are setted later. */
diff --git a/src/peers.c b/src/peers.c
index 6df3ce7..0a66010 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1144,6 +1144,7 @@
 
 	s->task = t;
 	s->listener = l;
+	s->sess = NULL;
 
 	/* Note: initially, the stream's backend points to the frontend.
 	 * This changes later when switching rules are executed or
diff --git a/src/session.c b/src/session.c
new file mode 100644
index 0000000..116816f
--- /dev/null
+++ b/src/session.c
@@ -0,0 +1,35 @@
+/*
+ * Stream management functions.
+ *
+ * Copyright 2000-2012 Willy Tarreau <w@1wt.eu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <common/config.h>
+#include <common/buffer.h>
+#include <common/debug.h>
+#include <common/memory.h>
+
+#include <types/global.h>
+#include <types/session.h>
+
+struct pool_head *pool2_session;
+
+/* perform minimal intializations, report 0 in case of error, 1 if OK. */
+int init_session()
+{
+	pool2_session = create_pool("session", sizeof(struct session), MEM_F_SHARED);
+	return pool2_session != NULL;
+}
+
+/*
+ * Local variables:
+ *  c-indent-level: 8
+ *  c-basic-offset: 8
+ * End:
+ */
diff --git a/src/stream.c b/src/stream.c
index 3bc337e..aaea9c0 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -116,6 +116,7 @@
 
 	memset(s->stkctr, 0, sizeof(s->stkctr));
 
+	s->sess = NULL;
 	s->listener = l;
 	s->fe  = p;