Patch from Richard Bollinger for dead entries being left in connections tdb.
authorJeremy Allison <jra@samba.org>
Mon, 8 Jan 2001 21:19:15 +0000 (21:19 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 8 Jan 2001 21:19:15 +0000 (21:19 +0000)
Jeremy.

source/smbd/connection.c
source/smbd/server.c

index d150508cefb20a85702e4b8faca09a23e9294840..b0b4bbab7b7b67038e6263eae5e7f65f3f147444 100644 (file)
@@ -55,7 +55,7 @@ BOOL yield_connection(connection_struct *conn,char *name,int max_connections)
 
        ZERO_STRUCT(key);
        key.pid = sys_getpid();
-       if (conn) key.cnum = conn->cnum;
+       key.cnum = conn?conn->cnum:-1;
        fstrcpy(key.name, name);
 
        kbuf.dptr = (char *)&key;
index 07e554c4fbe6472348af7727320aed5bd02de885..c895972b0e3ea4832a62829ff501b1295b421f1d 100644 (file)
@@ -426,6 +426,11 @@ void exit_server(char *reason)
 
        conn_close_all();
 
+       /* delete our entry in the connections database. */
+       if (lp_status(-1)) {
+               yield_connection(NULL,"",MAXSTATUS);
+       }
+
     respond_to_all_remaining_local_messages();
 
 #ifdef WITH_DFS