X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fcontext.c;fp=citadel%2Fcontext.c;h=576e9359c7da3cc9efeea5b6f6644d8e740f174f;hp=81b597850b1dbfbe00396ea6119ba1014ed80e3e;hb=9571de81331e169c042c630800bff1bde499c8a9;hpb=c51a64e8f8b42b6efd85f17c91178437d73a9c3d diff --git a/citadel/context.c b/citadel/context.c index 81b597850..576e9359c 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -2,7 +2,7 @@ * Citadel context management stuff. * 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 * it under the terms of the GNU General Public License, version 3. @@ -22,6 +22,7 @@ #include "locate_host.h" #include "context.h" #include "control.h" +#include "config.h" int DebugSession = 0; @@ -244,8 +245,8 @@ void terminate_idle_sessions(void) for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { if ( (ccptr != CC) - && (config.c_sleeping > 0) - && (now - (ccptr->lastcmd) > config.c_sleeping) + && (CtdlGetConfigLong("c_sleeping") > 0) + && (now - (ccptr->lastcmd) > CtdlGetConfigLong("c_sleeping")) ) { if (!ccptr->dont_term) { ccptr->kill_me = KILLME_IDLE; @@ -514,7 +515,7 @@ void begin_session(CitContext *con) *con->fake_hostname = '\0'; *con->fake_roomname = '\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); con->cs_UDSclientUID = -1; con->cs_host[sizeof con->cs_host - 1] = 0; @@ -566,7 +567,7 @@ void begin_session(CitContext *con) con->dl_is_net = 0; con->nologin = 0; - if (((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions)) || CtdlWantSingleUser()) { + if (((CtdlGetConfigInt("c_maxsessions") > 0)&&(num_sessions > CtdlGetConfigInt("c_maxsessions"))) || CtdlWantSingleUser()) { con->nologin = 1; }