Force a close when inactivity timer triggers
authorfatbob313 <martin@fatbob.nu>
Thu, 10 Sep 2009 16:53:47 +0000 (16:53 +0000)
committerfatbob313 <martin@fatbob.nu>
Thu, 10 Sep 2009 16:53:47 +0000 (16:53 +0000)
src/client.c

index 94da524243ee4fbd69afc96ae48c276e09607c06..ce9af73bc0c900acde5a3633acbda21a985d7feb 100644 (file)
@@ -94,8 +94,11 @@ void Client_janitor()
                if (c->availableBandwidth > bwTop)
                        c->availableBandwidth = bwTop;
                
-               if (Timer_isElapsed(&c->lastActivity, 1000000LL * INACTICITY_TIMEOUT))
-                       Client_close(c);
+               if (Timer_isElapsed(&c->lastActivity, 1000000LL * INACTICITY_TIMEOUT)) {
+                       /* No activity from client - assume it is lost and close. */
+                       Log_info("Session ID %d timeout - closing", c->sessionId);
+                       Client_free(c);
+               }
        }
 }