context.c: last_purge is local to dead_session_purge()
authorArt Cancro <ajc@citadel.org>
Tue, 2 Jan 2024 18:42:38 +0000 (13:42 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 2 Jan 2024 18:42:38 +0000 (13:42 -0500)
citadel/server/context.c

index f7b0448e73e1631e282e6947ced3c2bb60eac11f..6415ce12abd290ea52e8d846fd4dc252701195a3 100644 (file)
@@ -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