The branch, master has been updated
       via  5b016db s3/libads: use monotonic clock for ldap connection timeouts
      from  f69085e s3: use monotonic clock for aio timeout

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5b016dbab852cd443c8f9049acb94a113de227e1
Author: Björn Jacke <[email protected]>
Date:   Tue Sep 7 02:15:09 2010 +0200

    s3/libads: use monotonic clock for ldap connection timeouts

-----------------------------------------------------------------------

Summary of changes:
 source3/include/ads.h       |    2 +-
 source3/libads/ldap.c       |    2 +-
 source3/libads/ldap_utils.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/ads.h b/source3/include/ads.h
index b45d53d..6ef5455 100644
--- a/source3/include/ads.h
+++ b/source3/include/ads.h
@@ -65,7 +65,7 @@ typedef struct ads_struct {
        struct {
                LDAP *ld;
                struct sockaddr_storage ss; /* the ip of the active connection, 
if any */
-               time_t last_attempt; /* last attempt to reconnect */
+               time_t last_attempt; /* last attempt to reconnect, monotonic 
clock */
                int port;
 
                enum ads_saslwrap_type wrap_type;
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 77ab51e..970f20a 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -596,7 +596,7 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
        char addr[INET6_ADDRSTRLEN];
 
        ZERO_STRUCT(ads->ldap);
-       ads->ldap.last_attempt  = time(NULL);
+       ads->ldap.last_attempt  = time_mono(NULL);
        ads->ldap.wrap_type     = ADS_SASLWRAP_TYPE_PLAIN;
 
        /* try with a user specified server */
diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c
index c0c1adb..0c07961 100644
--- a/source3/libads/ldap_utils.c
+++ b/source3/libads/ldap_utils.c
@@ -40,7 +40,7 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT 
*ads, const char *bind
        *res = NULL;
 
        if (!ads->ldap.ld &&
-           time(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
+           time_mono(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
                return ADS_ERROR(LDAP_SERVER_DOWN);
        }
 


-- 
Samba Shared Repository

Reply via email to