diff options
author | Jeremy Allison <jra@samba.org> | 2003-01-17 06:34:22 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-01-17 06:34:22 +0000 |
commit | 2b79854f068c99b2881a02371b4bc7dd00a4e5aa (patch) | |
tree | c7adf9e6543407fdfa20f8655417a4882c5e5a3d | |
parent | e35a8a43031bec62a1e4f508434fb9efb3b3cd67 (diff) | |
download | samba-2b79854f068c99b2881a02371b4bc7dd00a4e5aa.tar.gz samba-2b79854f068c99b2881a02371b4bc7dd00a4e5aa.tar.bz2 samba-2b79854f068c99b2881a02371b4bc7dd00a4e5aa.zip |
Fix reference count bug where smbd's would not terminate with no
open resources.
Jeremy.
(This used to be commit b7e5a2c5474e9edd8fa783462af8986b6bd426a5)
-rw-r--r-- | source3/rpc_server/srv_lsa_hnd.c | 17 | ||||
-rw-r--r-- | source3/smbd/conn.c | 13 |
2 files changed, 12 insertions, 18 deletions
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index 2d04d72323..814fa60aab 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -137,14 +137,6 @@ BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *) DLIST_ADD(p->pipe_handles->Policy, pol); p->pipe_handles->count++; - /* - * Ensure we don't idle this connection if a handle is open. - * Increment the number of files open on the first handle create. - */ - - if (p->pipe_handles->count == 1) - p->conn->num_files_open++; - *hnd = pol->pol_hnd; DEBUG(4,("Opened policy hnd[%d] ", (int)p->pipe_handles->count)); @@ -212,15 +204,6 @@ BOOL close_policy_hnd(pipes_struct *p, POLICY_HND *hnd) p->pipe_handles->count--; - /* - * Ensure we can idle this connection if this is the last handle. - * Decrement the number of files open on the last handle delete. - */ - - if (p->pipe_handles->count == 0) - p->conn->num_files_open--; - - DLIST_REMOVE(p->pipe_handles->Policy, pol); ZERO_STRUCTP(pol); diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 22407348e8..c771f1254b 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -136,10 +136,12 @@ void conn_close_all(void) } /**************************************************************************** -idle inactive connections + Idle inactive connections. ****************************************************************************/ + BOOL conn_idle_all(time_t t, int deadtime) { + pipes_struct *plist = NULL; BOOL allidle = True; connection_struct *conn, *next; @@ -154,6 +156,15 @@ BOOL conn_idle_all(time_t t, int deadtime) allidle = False; } + /* + * Check all pipes for any open handles. We cannot + * idle with a handle open. + */ + + for (plist = get_first_internal_pipe(); plist; plist = get_next_internal_pipe(plist)) + if (plist->pipe_handles && plist->pipe_handles->count) + allidle = False; + return allidle; } |