// 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.
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;
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