From e76fe221b8912b2f94c0ac8ecbf59b940f11979c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 8 Jan 2001 21:19:15 +0000 Subject: Patch from Richard Bollinger for dead entries being left in connections tdb. Jeremy. (This used to be commit 48a3afcd4716a456c3072bf41450b361e4379be8) --- source3/smbd/connection.c | 2 +- source3/smbd/server.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index d150508cef..b0b4bbab7b 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -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; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 07e554c4fb..c895972b0e 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -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 -- cgit