commit 543a329ef6802ea8a9538189ec8bdf6fb1ef5e01
parent 194b575ebf9549817b248c8dbf75b5eac29b762e
Author: Joris Vink <joris@coders.se>
Date:   Mon, 26 Dec 2016 20:03:01 +0100
run the connection timeout test per event loop.
Diffstat:
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/worker.c b/src/worker.c
@@ -264,7 +264,7 @@ kore_worker_entry(struct kore_worker *kw)
 {
 	char			buf[16];
 	int			quit, had_lock, r;
-	u_int64_t		now, idle_check, next_lock, netwait;
+	u_int64_t		now, next_lock, netwait;
 #if defined(KORE_SINGLE_BINARY)
 	void			(*onload)(void);
 #endif
@@ -316,7 +316,6 @@ kore_worker_entry(struct kore_worker *kw)
 	quit = 0;
 	had_lock = 0;
 	next_lock = 0;
-	idle_check = 0;
 	worker_active_connections = 0;
 
 	kore_platform_event_init();
@@ -391,11 +390,7 @@ kore_worker_entry(struct kore_worker *kw)
 		http_process();
 #endif
 
-		if ((now - idle_check) >= 10000) {
-			idle_check = now;
-			kore_connection_check_timeout();
-		}
-
+		kore_connection_check_timeout();
 		kore_connection_prune(KORE_CONNECTION_PRUNE_DISCONNECT);
 
 		if (quit)