]> code.citadel.org Git - citadel.git/blobdiff - citadel/context.c
Generate wiki diffs using a temp file instead of a big string of realloc() calls.
[citadel.git] / citadel / context.c
index f4bf0cef404c17d28b642a578507e122cfb361ec..c77f3cdd2b007eb4fa8c5425ef3b0c63a1d3d16e 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 or -1, its already gone or was never there.
+        */
+       if (con->client_socket > 0)
+       {
+               syslog(LOG_NOTICE, "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);