]> code.citadel.org Git - citadel.git/commitdiff
more logging and testing
authorArt Cancro <ajc@citadel.org>
Thu, 17 Mar 2011 03:07:23 +0000 (23:07 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 17 Mar 2011 03:07:23 +0000 (23:07 -0400)
citadel/context.c
citadel/user_ops.c

index 1c8a48a25d6456c8511ee39115ff8f88036dc26d..d74fe3575fed2437640e151c8cdbca9af85dccb2 100644 (file)
@@ -334,8 +334,7 @@ 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;
        }
        c = con->ServiceName;
@@ -356,8 +355,10 @@ void RemoveContext (CitContext *con)
        syslog(LOG_NOTICE, "[%3d] Session ended.\n", con->cs_pid);
 
        /* If the client is still connected, blow 'em away. */
-       syslog(LOG_DEBUG, "Closing socket %d\n", con->client_socket);
-       close(con->client_socket);
+       if (con->client_socket != (-1)) {
+               syslog(LOG_DEBUG, "Closing socket %d\n", con->client_socket);
+               if (close(con->client_socket)) syslog(LOG_NOTICE, "close() : %s", strerror(errno));
+       }
 
        /* If using AUTHMODE_LDAP, free the DN */
        if (con->ldap_dn) {
index 7eefb54eb8240359e8c70aef6d4b1c007db17f99..d7f88ad4dc79e1fa94d39d00a69044925db64bd2 100644 (file)
@@ -778,7 +778,9 @@ void CtdlUserLogout(void)
 {
        CitContext *CCC = MyContext();
 
-       syslog(LOG_DEBUG, "CtdlUserLogout() logging out <%s>\n", CCC->curr_user);
+       syslog(LOG_DEBUG, "CtdlUserLogout() logging out <%s> from session %d",
+               CCC->curr_user, CCC->cs_pid
+       );
 
        /*
         * If there is a download in progress, abort it.