citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
![]() ![]() |
#include "ctdl_module.h"
#include "serv_extensions.h"
#include "citserver.h"
#include "user_ops.h"
#include "locate_host.h"
#include "context.h"
#include "control.h"
#include "config.h"
Go to the source code of this file.
Functions | |
int | CtdlTrySingleUser (void) |
void | CtdlEndSingleUser (void) |
int | CtdlWantSingleUser (void) |
int | CtdlIsSingleUser (void) |
int | CtdlTerminateOtherSession (int session_num) |
void | CtdlBumpNewMailCounter (long which_user) |
int | CtdlIsUserLoggedIn (char *user_name) |
int | CtdlIsUserLoggedInByNum (long usernum) |
CitContext * | MyContext (void) |
void | terminate_idle_sessions (void) |
void | terminate_all_sessions (void) |
void | RemoveContext (CitContext *con) |
CitContext * | CreateNewContext (void) |
CitContext * | CloneContext (CitContext *CloneMe) |
CitContext * | CtdlGetContextArray (int *count) |
void | begin_session (CitContext *con) |
void | CtdlFillSystemContext (CitContext *context, char *name) |
void | context_cleanup (void) |
void | dead_session_purge (int force) |
void | InitializeMasterCC (void) |
void | set_async_waiting (struct CitContext *ccptr) |
char * | ctdl_module_session_init (int threading) |
Variables | |
pthread_key_t | MyConKey |
CitContext | masterCC |
CitContext * | ContextList = NULL |
time_t | last_purge = 0 |
int | num_sessions = 0 |
int | next_pid = 0 |
static int | want_single_user = 0 |
void begin_session | ( | CitContext * | con | ) |
Definition at line 394 of file context.c.
References CitContext::cached_msglist, CitContext::cached_num_msgs, CC, CitContext::client_socket, CitContext::cs_addr, CitContext::cs_clientinfo, CitContext::cs_clientname, CitContext::cs_flags, CitContext::cs_host, CitContext::cs_UDSclientUID, CtdlGetConfigInt(), CtdlGetConfigStr(), CtdlWantSingleUser(), CitContext::curr_user, CitContext::download_fp, EVT_START, CitContext::FirstExpressMessage, CitContext::internal_pgm, CitContext::lastcmd, CitContext::lastcmdname, CitContext::lastidle, locate_host(), CitContext::logged_in, NLI, CitContext::nologin, num_sessions, PerformSessionHooks(), CitContext::ServiceName, and CitContext::upload_fp.
Referenced by worker_thread().
CitContext * CloneContext | ( | CitContext * | CloneMe | ) |
Definition at line 316 of file context.c.
References begin_critical_section(), CitContext::cached_msglist, CitContext::CIT_ICAL, CitContext::client_socket, ContextList, CitContext::cs_pid, CitContext::download_fp, end_critical_section(), CitContext::lastcmd, CitContext::ldap_dn, CitContext::ma, malloc(), CitContext::MigrateBuf, CitContext::next, next_pid, num_sessions, CitContext::prev, CitContext::RecvBuf, CitContext::redirect_buffer, S_SESSION_TABLE, CitContext::SBuf, CitContext::SendBuf, CitContext::session_specific_data, CitContext::sMigrateBuf, and CitContext::upload_fp.
void context_cleanup | ( | void | ) |
Definition at line 473 of file context.c.
References ContextList, CitContext::cs_pid, free(), CitContext::next, num_sessions, and RemoveContext().
Referenced by master_cleanup().
CitContext * CreateNewContext | ( | void | ) |
Definition at line 280 of file context.c.
References begin_critical_section(), CON_EXECUTING, ContextList, CitContext::cs_pid, end_critical_section(), ctdluser::fullname, CitContext::lastcmd, malloc(), CitContext::MigrateBuf, CitContext::next, next_pid, num_sessions, CitContext::prev, CitContext::RecvBuf, S_SESSION_TABLE, CitContext::state, and CitContext::user.
Referenced by worker_thread().
char * ctdl_module_session_init | ( | int | threading | ) |
void CtdlBumpNewMailCounter | ( | long | which_user | ) |
Definition at line 113 of file context.c.
References begin_critical_section(), ContextList, end_critical_section(), CitContext::newmail, CitContext::next, S_SESSION_TABLE, CitContext::user, and ctdluser::usernum.
Referenced by CtdlSubmitMsg().
void CtdlEndSingleUser | ( | void | ) |
Definition at line 46 of file context.c.
References begin_critical_section(), end_critical_section(), S_SINGLE_USER, and want_single_user.
void CtdlFillSystemContext | ( | CitContext * | context, |
char * | name | ||
) |
Definition at line 442 of file context.c.
References cdb_store, CDB_USERSBYNUMBER, CitContext::client_socket, CON_SYS, CitContext::cs_pid, CtdlPutUser(), CitContext::curr_user, ctdluser::fullname, get_new_user_number(), internal_create_user(), CitContext::internal_pgm, CitContext::ServiceName, SIZ, CitContext::state, CitContext::user, and ctdluser::usernum.
CitContext * CtdlGetContextArray | ( | int * | count | ) |
Definition at line 372 of file context.c.
References begin_critical_section(), ContextList, end_critical_section(), malloc(), CitContext::next, num_sessions, and S_SESSION_TABLE.
Referenced by cmd_rwho(), flush_conversations_to_disk(), roomchat_rwho(), xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(), xmpp_iq_roster_query(), xmpp_massacre_roster(), xmpp_presence_notify(), and xmpp_wholist_presence_dump().
int CtdlIsSingleUser | ( | void | ) |
Definition at line 58 of file context.c.
References num_sessions, and want_single_user.
Referenced by do_housekeeping().
int CtdlIsUserLoggedIn | ( | char * | user_name | ) |
Definition at line 132 of file context.c.
References begin_critical_section(), ContextList, end_critical_section(), ctdluser::fullname, CitContext::next, S_SESSION_TABLE, and CitContext::user.
Referenced by rename_user().
int CtdlIsUserLoggedInByNum | ( | long | usernum | ) |
Definition at line 153 of file context.c.
References begin_critical_section(), ContextList, end_critical_section(), CitContext::next, S_SESSION_TABLE, CitContext::user, and ctdluser::usernum.
Referenced by purge_user().
int CtdlTerminateOtherSession | ( | int | session_num | ) |
Definition at line 72 of file context.c.
References begin_critical_section(), CC, ContextList, CitContext::cs_pid, end_critical_section(), CitContext::kill_me, KILLME_ADMIN_TERMINATE, KILLME_IDLE, CitContext::next, S_SESSION_TABLE, TERM_ALLOWED, TERM_FOUND, TERM_NOTALLOWED, CitContext::user, and ctdluser::usernum.
Referenced by cmd_term().
int CtdlTrySingleUser | ( | void | ) |
Definition at line 30 of file context.c.
References begin_critical_section(), end_critical_section(), S_SINGLE_USER, and want_single_user.
int CtdlWantSingleUser | ( | void | ) |
Definition at line 53 of file context.c.
References want_single_user.
Referenced by begin_session().
void dead_session_purge | ( | int | force | ) |
Definition at line 503 of file context.c.
References begin_critical_section(), CON_IDLE, ContextList, CitContext::cs_pid, end_critical_section(), free(), CitContext::kill_me, last_purge, CitContext::next, num_sessions, CitContext::prev, RemoveContext(), S_SESSION_TABLE, and CitContext::state.
Referenced by worker_thread().
void InitializeMasterCC | ( | void | ) |
Definition at line 557 of file context.c.
References CitContext::cs_pid, CitContext::internal_pgm, and masterCC.
Referenced by main().
CitContext * MyContext | ( | void | ) |
Definition at line 173 of file context.c.
References masterCC, and MyConKey.
Referenced by files_logout_hook().
void RemoveContext | ( | CitContext * | con | ) |
Definition at line 239 of file context.c.
References become_session(), CitContext::cached_msglist, client_close(), CitContext::cs_pid, CtdlUserLogout(), EVT_STOP, free(), CitContext::ldap_dn, CitContext::MigrateBuf, PerformSessionHooks(), CitContext::RecvBuf, CitContext::ServiceName, and CitContext::StatusMessage.
Referenced by context_cleanup(), and dead_session_purge().
void set_async_waiting | ( | struct CitContext * | ccptr | ) |
Definition at line 565 of file context.c.
References CitContext::async_waiting, CON_IDLE, CON_READY, CitContext::cs_pid, CitContext::is_async, and CitContext::state.
Referenced by add_xmsg_to_context(), and xmpp_queue_event().
void terminate_all_sessions | ( | void | ) |
Definition at line 217 of file context.c.
References begin_critical_section(), CitContext::client_socket, ContextList, CitContext::cs_pid, CitContext::curr_user, end_critical_section(), CitContext::next, and S_SESSION_TABLE.
Referenced by go_threading().
void terminate_idle_sessions | ( | void | ) |
Definition at line 183 of file context.c.
References begin_critical_section(), CC, ContextList, CtdlGetConfigLong(), CitContext::dont_term, end_critical_section(), CitContext::kill_me, KILLME_IDLE, CitContext::lastcmd, CitContext::next, and S_SESSION_TABLE.
Referenced by main().
CitContext* ContextList = NULL |
Definition at line 20 of file context.c.
Referenced by check_sched_shutdown(), CloneContext(), cmd_reqt(), context_cleanup(), CreateNewContext(), CtdlBumpNewMailCounter(), CtdlGetContextArray(), CtdlIsUserLoggedIn(), CtdlIsUserLoggedInByNum(), CtdlTerminateOtherSession(), dead_session_purge(), HuntBadSession(), send_instant_message(), terminate_all_sessions(), terminate_idle_sessions(), worker_thread(), xmpp_queue_event(), and xmpp_send_message().
time_t last_purge = 0 |
Definition at line 21 of file context.c.
Referenced by dead_session_purge(), and purge_databases().
CitContext masterCC |
Definition at line 19 of file context.c.
Referenced by InitializeMasterCC(), main(), and MyContext().
pthread_key_t MyConKey |
Definition at line 18 of file context.c.
Referenced by become_session(), init_sysdep(), MyContext(), and PerformSessionHooks().
int next_pid = 0 |
Definition at line 23 of file context.c.
Referenced by CloneContext(), and CreateNewContext().
int num_sessions = 0 |
Definition at line 22 of file context.c.
Referenced by begin_session(), CloneContext(), context_cleanup(), CreateNewContext(), CtdlGetContextArray(), CtdlIsSingleUser(), and dead_session_purge().
|
static |
Definition at line 26 of file context.c.
Referenced by CtdlEndSingleUser(), CtdlIsSingleUser(), CtdlTrySingleUser(), and CtdlWantSingleUser().