old bug?

Jeremy Allison jeremy at valinux.com
Fri Jun 22 20:59:30 GMT 2001


Gerald Carter wrote:
> 
> I'm going through old mail and this was reported last december
> from Ying Chen <ying at almaden.ibm.com>
> 
> in smbd/process.c:smbd_process()
> (lines 1257-1265)
> 
> if ((num_smbs % 200) == 0) {
>    time_t new_check_time = time(NULL);
>    if(last_timeout_processing_time - new_check_time >=
>       (select_timeout/1000)) {
>         if(!timeout_processing( deadtime, &select_timeout,
>              &last_timeout_processing_time))
>            return;
>         num_smbs = 0; /* Reset smb counter. */
>         last_timeout_processing_time = new_check_time; /* Reset time. */
>      }
> }
> 
> The line
> 
> last_timeout_processing_time - new_check_time >= (select_timeout/1000))
> 
> Seems to have a logic bug.  if (last_timeout_processing_time <
> new_check_time), the result will always be negative and always less
> that (select_timeout/1000).

You're right. It should be 

if (new_check_time - last_timeout_processing_time >= (select_timeout/1000))

- I've fixed this in CVS.

Jeremy.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------




More information about the samba-technical mailing list