Fixed idle session processing

The current implementation of idle connection timeouts is not safe. The sessions
are handled in a way which is not thread-safe and the checking is done from
a non-polling thread.

With this change, the checks for the session timeouts are done in one of the
polling threads in a thread-safe manner only if at least one service has enabled
the timing out of idle client connections.
This commit is contained in:
Markus Makela
2016-01-05 06:31:07 +02:00
parent cdeb921b1b
commit c2310327fc
7 changed files with 77 additions and 36 deletions

View File

@ -53,7 +53,7 @@ static HKTASK *tasks = NULL;
static SPINLOCK tasklock = SPINLOCK_INIT;
static int do_shutdown = 0;
unsigned long hkheartbeat = 0;
long hkheartbeat = 0; /*< One heartbeat is 100 milliseconds */
static void hkthread(void *);