MINOR: session: add stick counters to the struct session
The stick counters in the session will be used for everything not related
to contents, hence the connections / concurrent sessions / etc. They will
be usable by "tcp-request connection" rules even without a stream. For now
they're just allocated and initialized.
diff --git a/src/hlua.c b/src/hlua.c
index 7df8778..cbc0fde 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2035,6 +2035,8 @@
sess->accept_date = date; /* user-visible date for logging */
sess->tv_accept = now; /* corrected date for internal use */
+ memset(sess->stkctr, 0, sizeof(sess->stkctr));
+
socket->s = pool_alloc2(pool2_stream);
if (!socket->s) {
hlua_pusherror(L, "socket: out of memory");
diff --git a/src/peers.c b/src/peers.c
index df4ecf8..57954d7 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1127,6 +1127,7 @@
sess->fe = p;
sess->accept_date = date; /* user-visible date for logging */
sess->tv_accept = now; /* corrected date for internal use */
+ memset(sess->stkctr, 0, sizeof(sess->stkctr));
if ((s = pool_alloc2(pool2_stream)) == NULL) { /* disable this proxy for a while */
Alert("out of memory in peer_session_create().\n");
diff --git a/src/stream.c b/src/stream.c
index 6730ad4..e21a2a5 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -107,6 +107,7 @@
sess->origin = &cli_conn->obj_type;
sess->accept_date = date; /* user-visible date for logging */
sess->tv_accept = now; /* corrected date for internal use */
+ memset(sess->stkctr, 0, sizeof(sess->stkctr));
if (unlikely((s = pool_alloc2(pool2_stream)) == NULL))
goto out_free_sess;