projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4b7b72
)
context.c: last_purge is local to dead_session_purge()
author
Art Cancro
<ajc@citadel.org>
Tue, 2 Jan 2024 18:42:38 +0000
(13:42 -0500)
committer
Art Cancro
<ajc@citadel.org>
Tue, 2 Jan 2024 18:42:38 +0000
(13:42 -0500)
citadel/server/context.c
patch
|
blob
|
history
diff --git
a/citadel/server/context.c
b/citadel/server/context.c
index f7b0448e73e1631e282e6947ced3c2bb60eac11f..6415ce12abd290ea52e8d846fd4dc252701195a3 100644
(file)
--- 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.
//
// Citadel context management stuff.
// Here's where we (hopefully) have all the code that manipulates contexts.
//
-// Copyright (c) 1987-202
3
by the citadel.org team
+// Copyright (c) 1987-202
4
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.
//
// 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;
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;
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
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
if (force == 0) {
if ( (time(NULL) - last_purge) < 5 ) {
return; // Too soon, go away