X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcitserver.c;h=e8e310f0d40082d88c569262e69e293d6c7e9f42;hb=1421d26887f154439d2cd27075c7e85dc22f644f;hp=2f5f24690fa0b0277967e9344db044c48c9a3632;hpb=e0288cfdf0bfeed17641a79257c0e92c32630483;p=citadel.git diff --git a/citadel/citserver.c b/citadel/citserver.c index 2f5f24690..e8e310f0d 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -73,6 +73,7 @@ #include "policy.h" #include "control.h" #include "euidindex.h" +#include "context.h" #include "svn_revision.h" #ifndef HAVE_SNPRINTF @@ -82,8 +83,6 @@ #include "ctdl_module.h" -struct CitContext *ContextList = NULL; -struct CitContext* next_session = NULL; char *unique_session_numbers; int ScheduledShutdown = 0; time_t server_startup_time; @@ -251,46 +250,6 @@ void master_cleanup(int exitcode) { -/* - * Terminate a session. - */ -void RemoveContext (struct CitContext *con) -{ - if (con==NULL) { - CtdlLogPrintf(CTDL_ERR, - "WARNING: RemoveContext() called with NULL!\n"); - return; - } - CtdlLogPrintf(CTDL_DEBUG, "RemoveContext() session %d\n", con->cs_pid); - - /* Run any cleanup routines registered by loadable modules. - * Note: We have to "become_session()" because the cleanup functions - * might make references to "CC" assuming it's the right one. - */ - become_session(con); - logout(); - PerformSessionHooks(EVT_STOP); - become_session(NULL); - - CtdlLogPrintf(CTDL_NOTICE, "[%3d] Session ended.\n", con->cs_pid); - - /* If the client is still connected, blow 'em away. */ - CtdlLogPrintf(CTDL_DEBUG, "Closing socket %d\n", con->client_socket); - close(con->client_socket); - - /* If using AUTHMODE_LDAP, free the DN */ - if (con->ldap_dn) { - free(con->ldap_dn); - con->ldap_dn = NULL; - } - - CtdlLogPrintf(CTDL_DEBUG, "Done with RemoveContext()\n"); -} - - - - - /* * cmd_info() - tell the client about this server */ @@ -873,6 +832,7 @@ void cmd_down(char *argbuf) { { cprintf(Reply, CIT_OK + SERVER_SHUTTING_DOWN); } + CC->kill_me = 1; /* Even the DOWN command has to follow correct proceedure when disconecting */ CtdlThreadStopAll(); }