Attempt to fix the crash that results from a new sessions context
authorDave West <davew@uncensored.citadel.org>
Sat, 30 Jan 2010 16:11:50 +0000 (16:11 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 30 Jan 2010 16:11:50 +0000 (16:11 +0000)
not existing before the command loop is entered.
This fixes a theoretical non atomic opperation but does not seem
to cause unwanted side effects. Lets see if it cures the problem
on those systems that are seeing it regularly.

citadel/sysdep.c

index 3d2db7da8d565170816a83fdd35054d4ce094d09..d3f13aba5e88fd09fcffa9bb3883905c6bcf880d 100644 (file)
@@ -925,7 +925,7 @@ do_select:  force_purge = 0;
                begin_critical_section(S_SESSION_TABLE);
                for (ptr = ContextList; ptr != NULL; ptr = ptr->next) {
                        /* Dont select on dead sessions only truly idle ones */
-                       if ((ptr->state == CON_IDLE)) {
+                       if ((ptr->state == CON_IDLE) && (CC->kill_me == 0)) {
                                FD_SET(ptr->client_socket, &readfds);
                                if (ptr->client_socket > highest)
                                        highest = ptr->client_socket;