summaryrefslogtreecommitdiff
path: root/source3/smbd/conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/conn.c')
-rw-r--r--source3/smbd/conn.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index b41467f02c..5aa8901d59 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -154,8 +154,9 @@ find_again:
}
/****************************************************************************
-close all conn structures
+ Close all conn structures.
****************************************************************************/
+
void conn_close_all(void)
{
connection_struct *conn, *next;
@@ -178,13 +179,20 @@ BOOL conn_idle_all(time_t t, int deadtime)
for (conn=Connections;conn;conn=next) {
next=conn->next;
+
+ /* Update if connection wasn't idle. */
+ if (conn->lastused != conn->lastused_count) {
+ conn->lastused = t;
+ }
+
/* close dirptrs on connections that are idle */
- if ((t-conn->lastused) > DPTR_IDLE_TIMEOUT)
+ if ((t-conn->lastused) > DPTR_IDLE_TIMEOUT) {
dptr_idlecnum(conn);
+ }
- if (conn->num_files_open > 0 ||
- (t-conn->lastused)<deadtime)
+ if (conn->num_files_open > 0 || (t-conn->lastused)<deadtime) {
allidle = False;
+ }
}
/*