syslog(LOG_INFO, "Didn't terminate %d protected idle sessions;\n", killed);
}
+
+/*
+ * During shutdown, close the sockets of any sessions still connected.
+ */
void terminate_stuck_sessions(void)
{
+
+ return;
+ /* FIXME this function has been disabled because it is somehow being
+ * called at times other than server shutdown, which is throwing all
+ * the users off. EPIC FAIL!!!
+ */
+
CitContext *ccptr;
int killed = 0;
for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
if (ccptr->client_socket != -1)
{
+ syslog(LOG_INFO, "terminate_stuck_sessions() is murdering %s", ccptr->curr_user);
close(ccptr->client_socket);
ccptr->client_socket = -1;
killed++;
}
}
end_critical_section(S_SESSION_TABLE);
- if (killed > 0)
+ if (killed > 0) {
syslog(LOG_INFO, "Flushed %d stuck sessions\n", killed);
+ }
}
*/
void RemoveContext (CitContext *con)
{
+ const char *c;
if (con==NULL) {
- syslog(LOG_ERR,
- "WARNING: RemoveContext() called with NULL!\n");
+ syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!\n");
return;
}
- syslog(LOG_DEBUG, "RemoveContext() session %d\n", con->cs_pid);
+ c = con->ServiceName;
+ if (c == NULL)
+ c = "WTF?";
+ syslog(LOG_DEBUG, "RemoveContext(%s) session %d\n", c, con->cs_pid);
+ cit_backtrace ();
/* Run any cleanup routines registered by loadable modules.
* Note: We have to "become_session()" because the cleanup functions
syslog(LOG_NOTICE, "[%3d] Session ended.\n", con->cs_pid);
- /*
- * If the client is still connected, blow 'em away.
- * if the socket is 0, its already gone or was never there.
- */
- if (con->client_socket != 0)
- {
- syslog(LOG_DEBUG, "Closing socket %d\n", con->client_socket);
- close(con->client_socket);
- }
+ /* If the client is still connected, blow 'em away. */
+ client_close();
/* If using AUTHMODE_LDAP, free the DN */
if (con->ldap_dn) {