svn commit: samba r21867 - in branches/SAMBA_3_0/source/smbd: .
vlendec at samba.org
vlendec at samba.org
Sun Mar 18 10:09:16 GMT 2007
Author: vlendec
Date: 2007-03-18 10:09:16 +0000 (Sun, 18 Mar 2007)
New Revision: 21867
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21867
Log:
Simplify calling convention of timeout_processing. lp_deadtime is only
referenced in conn_idle_all().
Modified:
branches/SAMBA_3_0/source/smbd/conn.c
branches/SAMBA_3_0/source/smbd/process.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/conn.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/conn.c 2007-03-18 09:54:18 UTC (rev 21866)
+++ branches/SAMBA_3_0/source/smbd/conn.c 2007-03-18 10:09:16 UTC (rev 21867)
@@ -187,12 +187,16 @@
Idle inactive connections.
****************************************************************************/
-BOOL conn_idle_all(time_t t, int deadtime)
+BOOL conn_idle_all(time_t t)
{
+ int deadtime = lp_deadtime()*60;
pipes_struct *plist = NULL;
BOOL allidle = True;
connection_struct *conn, *next;
+ if (deadtime <= 0)
+ deadtime = DEFAULT_SMBD_TIMEOUT;
+
for (conn=Connections;conn;conn=next) {
next=conn->next;
Modified: branches/SAMBA_3_0/source/smbd/process.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/process.c 2007-03-18 09:54:18 UTC (rev 21866)
+++ branches/SAMBA_3_0/source/smbd/process.c 2007-03-18 10:09:16 UTC (rev 21867)
@@ -1317,7 +1317,8 @@
Process any timeout housekeeping. Return False if the caller should exit.
****************************************************************************/
-static BOOL timeout_processing(int deadtime, int *select_timeout, time_t *last_timeout_processing_time)
+static BOOL timeout_processing(int *select_timeout,
+ time_t *last_timeout_processing_time)
{
static time_t last_keepalive_sent_time = 0;
static time_t last_idle_closed_check = 0;
@@ -1382,7 +1383,7 @@
}
/* check for connection timeouts */
- allidle = conn_idle_all(t, deadtime);
+ allidle = conn_idle_all(t);
if (allidle && conn_num_open()>0) {
DEBUG(2,("Closing idle connection 2.\n"));
@@ -1541,13 +1542,9 @@
max_recv = MIN(lp_maxxmit(),BUFFER_SIZE);
while (True) {
- int deadtime = lp_deadtime()*60;
int select_timeout = setup_select_timeout();
int num_echos;
- if (deadtime <= 0)
- deadtime = DEFAULT_SMBD_TIMEOUT;
-
errno = 0;
/* free up temporary memory */
@@ -1556,7 +1553,8 @@
/* Did someone ask for immediate checks on things like blocking locks ? */
if (select_timeout == 0) {
- if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+ if(!timeout_processing(&select_timeout,
+ &last_timeout_processing_time))
return;
num_smbs = 0; /* Reset smb counter. */
}
@@ -1568,7 +1566,8 @@
#endif
while (!receive_message_or_smb(InBuffer,BUFFER_SIZE+LARGE_WRITEX_HDR_SIZE,select_timeout)) {
- if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+ if(!timeout_processing(&select_timeout,
+ &last_timeout_processing_time))
return;
num_smbs = 0; /* Reset smb counter. */
}
@@ -1589,7 +1588,7 @@
process_smb(InBuffer, OutBuffer);
if (smb_echo_count != num_echos) {
- if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+ if(!timeout_processing( &select_timeout, &last_timeout_processing_time))
return;
num_smbs = 0; /* Reset smb counter. */
}
@@ -1606,7 +1605,9 @@
if ((num_smbs % 200) == 0) {
time_t new_check_time = time(NULL);
if(new_check_time - last_timeout_processing_time >= (select_timeout/1000)) {
- if(!timeout_processing( deadtime, &select_timeout, &last_timeout_processing_time))
+ if(!timeout_processing(
+ &select_timeout,
+ &last_timeout_processing_time))
return;
num_smbs = 0; /* Reset smb counter. */
last_timeout_processing_time = new_check_time; /* Reset time. */
More information about the samba-cvs
mailing list