"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "context.c" between
citadel-9.01.tar.gz and citadel-902.tar.gz

About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).

context.c  (citadel-9.01):context.c  (citadel-902)
/* /*
* Citadel context management stuff. * Citadel context management stuff.
* Here's where we (hopefully) have all the code that manipulates contexts. * Here's where we (hopefully) have all the code that manipulates contexts.
* *
* Copyright (c) 1987-2011 by the citadel.org team * Copyright (c) 1987-2015 by the citadel.org team
* *
* This program is open source software; you can redistribute it and/or modify * This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3. * it under the terms of the GNU General Public License, version 3.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "ctdl_module.h" #include "ctdl_module.h"
#include "serv_extensions.h" #include "serv_extensions.h"
#include "ecrash.h" #include "ecrash.h"
#include "citserver.h" #include "citserver.h"
#include "user_ops.h" #include "user_ops.h"
#include "locate_host.h" #include "locate_host.h"
#include "context.h" #include "context.h"
#include "control.h" #include "control.h"
#include "config.h"
int DebugSession = 0; int DebugSession = 0;
pthread_key_t MyConKey; /* TSD key for MyContext( ) */ pthread_key_t MyConKey; /* TSD key for MyContext( ) */
CitContext masterCC; CitContext masterCC;
CitContext *ContextList = NULL; CitContext *ContextList = NULL;
time_t last_purge = 0; /* Last dead session purge */ time_t last_purge = 0; /* Last dead session purge */
int num_sessions = 0; /* Current number of sessions */ int num_sessions = 0; /* Current number of sessions */
skipping to change at line 231 skipping to change at line 232
CitContext *ccptr; CitContext *ccptr;
time_t now; time_t now;
int killed = 0; int killed = 0;
int longrunners = 0; int longrunners = 0;
now = time(NULL); now = time(NULL);
begin_critical_section(S_SESSION_TABLE); begin_critical_section(S_SESSION_TABLE);
for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
if ( if (
(ccptr != CC) (ccptr != CC)
&& (config.c_sleeping > 0) && (CtdlGetConfigLong("c_sleeping") > 0)
&& (now - (ccptr->lastcmd) > config.c_sleeping) && (now - (ccptr->lastcmd) > CtdlGetConfigLong("c_sleepin
g"))
) { ) {
if (!ccptr->dont_term) { if (!ccptr->dont_term) {
ccptr->kill_me = KILLME_IDLE; ccptr->kill_me = KILLME_IDLE;
++killed; ++killed;
} }
else { else {
++longrunners; ++longrunners;
} }
} }
} }
skipping to change at line 491 skipping to change at line 492
time(&con->lastcmd); time(&con->lastcmd);
time(&con->lastidle); time(&con->lastidle);
strcpy(con->lastcmdname, " "); strcpy(con->lastcmdname, " ");
strcpy(con->cs_clientname, "(unknown)"); strcpy(con->cs_clientname, "(unknown)");
strcpy(con->curr_user, NLI); strcpy(con->curr_user, NLI);
*con->net_node = '\0'; *con->net_node = '\0';
*con->fake_username = '\0'; *con->fake_username = '\0';
*con->fake_hostname = '\0'; *con->fake_hostname = '\0';
*con->fake_roomname = '\0'; *con->fake_roomname = '\0';
*con->cs_clientinfo = '\0'; *con->cs_clientinfo = '\0';
safestrncpy(con->cs_host, config.c_fqdn, sizeof con->cs_host); safestrncpy(con->cs_host, CtdlGetConfigStr("c_fqdn"), sizeof con->cs_host );
safestrncpy(con->cs_addr, "", sizeof con->cs_addr); safestrncpy(con->cs_addr, "", sizeof con->cs_addr);
con->cs_UDSclientUID = -1; con->cs_UDSclientUID = -1;
con->cs_host[sizeof con->cs_host - 1] = 0; con->cs_host[sizeof con->cs_host - 1] = 0;
if (!CC->is_local_socket) { if (!CC->is_local_socket) {
locate_host(con->cs_host, sizeof con->cs_host, locate_host(con->cs_host, sizeof con->cs_host,
con->cs_addr, sizeof con->cs_addr, con->cs_addr, sizeof con->cs_addr,
con->client_socket con->client_socket
); );
} }
else { else {
skipping to change at line 543 skipping to change at line 544
credentials.gid); credentials.gid);
} }
} }
#endif #endif
} }
con->cs_flags = 0; con->cs_flags = 0;
con->upload_type = UPL_FILE; con->upload_type = UPL_FILE;
con->dl_is_net = 0; con->dl_is_net = 0;
con->nologin = 0; con->nologin = 0;
if (((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions)) | | CtdlWantSingleUser()) { if (((CtdlGetConfigInt("c_maxsessions") > 0)&&(num_sessions > CtdlGetConf igInt("c_maxsessions"))) || CtdlWantSingleUser()) {
con->nologin = 1; con->nologin = 1;
} }
if (!CC->is_local_socket) { if (!CC->is_local_socket) {
syslog(LOG_NOTICE, "Session (%s) started from %s (%s).\n", con->S erviceName, con->cs_host, con->cs_addr); syslog(LOG_NOTICE, "Session (%s) started from %s (%s).\n", con->S erviceName, con->cs_host, con->cs_addr);
} }
else { else {
syslog(LOG_NOTICE, "Session (%s) started via local socket UID:%d. \n", con->ServiceName, con->cs_UDSclientUID); syslog(LOG_NOTICE, "Session (%s) started via local socket UID:%d. \n", con->ServiceName, con->cs_UDSclientUID);
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS