[PATCH] ldap rebind sleep

Stefan Metzmacher metze at metzemix.de
Wed Nov 12 04:13:17 GMT 2003


Andrew Bartlett wrote:

>On Wed, 2003-11-12 at 11:39, Stefan Metzmacher wrote:
>  
>
>>Stefan Metzmacher wrote:
>>
>>    
>>
>>>Stefan Metzmacher wrote:
>>>
>>>      
>>>
>>>>Hi Guenther, Hi Andrew,
>>>>
>>>>here's the ldap rebind sleep patch
>>>>
>>>>gd: can you test it and report if it works ok,
>>>>because I modified my old version a bit.
>>>>        
>>>>
>>>Here's a new version
>>>it now hold the timestamp of the last rebind and waits before the next 
>>>search
>>>and compares the timestamp with the current time
>>>and use the MIN() of the timediff and lp_ldap_rebind_sleep() as 
>>>argument of msleep()
>>>      
>>>
>>so 3rd version...
>>this works hopefully.
>>the lp_ldap_rebind_sleep() is 1000 by default == 1 sec = 1000 msec == 
>>1000000 usec
>>
>>gd: can you find out how long a standart replication takes, we then can 
>>use 2 * replication time for the sleep time
>>    
>>
>
>The main problem I see with this patch is that we need to use
>sys_usleep() for portability, and it only allows usleep() to a value of
>1000000, which I think it 1 second.  
>
>Anyway, why not use the msleep we already use in the ldap code?  It
>isn't exactly like we need to be in any was precise about this :-)
>  
>
no problem

then it's

sleep_time = ((1000*lp_ldap_rebind_sleep())-tdiff)/1000;
msleep(sleep_time);

do we have a sys_msleep() also?


-- 

metze

-------------------------------------------
Stefan (metze) Metzmacher <metze at metzemix.de>





More information about the samba-technical mailing list