mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
r21867: Simplify calling convention of timeout_processing. lp_deadtime is only
referenced in conn_idle_all().
(This used to be commit c0aaee6d36
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
80a78b0aa8
commit
2864d86b37
@ -187,12 +187,16 @@ void conn_close_all(void)
|
||||
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;
|
||||
|
||||
|
@ -1317,7 +1317,8 @@ void check_reload(time_t t)
|
||||
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 @@ static BOOL timeout_processing(int deadtime, int *select_timeout, time_t *last_t
|
||||
}
|
||||
|
||||
/* 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 @@ void smbd_process(void)
|
||||
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 @@ void smbd_process(void)
|
||||
|
||||
/* 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 @@ void smbd_process(void)
|
||||
#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 @@ void smbd_process(void)
|
||||
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 @@ void smbd_process(void)
|
||||
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. */
|
||||
|
Reference in New Issue
Block a user