diff --git a/include/types/session.h b/include/types/session.h index e4e393b10..45d2df1fb 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -41,6 +41,7 @@ struct session { enum obj_type *origin; /* the connection / applet which initiated this session */ struct timeval accept_date; /* date of the session's accept() in user date */ struct timeval tv_accept; /* date of the session's accept() in internal date (monotonic) */ + struct stkctr stkctr[MAX_SESS_STKCTR]; /* stick counters for tcp-connection */ }; #endif /* _TYPES_SESSION_H */ diff --git a/include/types/stream.h b/include/types/stream.h index b83f65588..be285683d 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -139,7 +139,7 @@ struct stream { int store_count; /* 4 unused bytes here */ - struct stkctr stkctr[MAX_SESS_STKCTR]; /* stick counters */ + struct stkctr stkctr[MAX_SESS_STKCTR]; /* content-aware stick counters */ char **req_cap; /* array of captures from the request (may be NULL) */ char **res_cap; /* array of captures from the response (may be NULL) */ diff --git a/src/hlua.c b/src/hlua.c index 7df8778eb..cbc0fdedd 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2035,6 +2035,8 @@ __LJMP static int hlua_socket_new(lua_State *L) 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 df4ecf889..57954d74a 100644 --- a/src/peers.c +++ b/src/peers.c @@ -1127,6 +1127,7 @@ static struct stream *peer_session_create(struct peer *peer, struct peer_session 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 6730ad47d..e21a2a583 100644 --- a/src/stream.c +++ b/src/stream.c @@ -107,6 +107,7 @@ int stream_accept(struct listener *l, int cfd, struct sockaddr_storage *addr) 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;