From bac39b0ae1ff3cac8ce79dce12af06b887dda666 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 2 Jan 2024 13:42:38 -0500 Subject: [PATCH] context.c: last_purge is local to dead_session_purge() --- citadel/server/context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/citadel/server/context.c b/citadel/server/context.c index f7b0448e7..6415ce12a 100644 --- a/citadel/server/context.c +++ b/citadel/server/context.c @@ -1,7 +1,7 @@ // Citadel context management stuff. // Here's where we (hopefully) have all the code that manipulates contexts. // -// Copyright (c) 1987-2023 by the citadel.org team +// Copyright (c) 1987-2024 by the citadel.org team // // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License, version 3. @@ -18,7 +18,6 @@ pthread_key_t MyConKey; // TSD key for MyContext() CitContext masterCC; CitContext *ContextList = NULL; -time_t last_purge = 0; // Last dead session purge int num_sessions = 0; // Current number of sessions int next_pid = 0; @@ -493,7 +492,8 @@ void context_cleanup(void) { void dead_session_purge(int force) { CitContext *ptr, *ptr2; // general-purpose utility pointer CitContext *rem = NULL; // list of sessions to be destroyed - + static time_t last_purge = 0; // Last dead session purge + if (force == 0) { if ( (time(NULL) - last_purge) < 5 ) { return; // Too soon, go away -- 2.30.2