X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fcontext.c;h=527828898fd9e58cdb4ac4defb163dfcd86ce69c;hb=678419c0cdd4f83ff3bbe56ff960f15d2fffce20;hp=f4bf0cef404c17d28b642a578507e122cfb361ec;hpb=eabf7bb3a19613dd4c8538fded0caba333830e4b;p=citadel.git diff --git a/citadel/context.c b/citadel/context.c index f4bf0cef4..527828898 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -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);