Don't close 0-filedescriptors on session killing, its our indicator for not here...
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 10 May 2011 22:03:20 +0000 (22:03 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 20:15:23 +0000 (20:15 +0000)
citadel/context.c

index f4bf0cef404c17d28b642a578507e122cfb361ec..527828898fd9e58cdb4ac4defb163dfcd86ce69c 100644 (file)
@@ -357,6 +357,16 @@ void RemoveContext (CitContext *con)
 
        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.
+        */
+       CtdlLogPrintf(CTDL_DEBUG, "Closing socket %d\n", con->client_socket);
+       if (con->client_socket != 0)
+       {
+               close(con->client_socket);
+       }
+
        /* If using AUTHMODE_LDAP, free the DN */
        if (con->ldap_dn) {
                free(con->ldap_dn);