openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/myldap.c
void myldap_immediate_reconnect(void)
{
    int i;
    time_t t;
    t = time(NULL) - nslcd_cfg->reconnect_retrytime;
    pthread_mutex_lock(&uris_mutex);
    for (i = 0; i < (NSS_LDAP_CONFIG_MAX_URIS + 1); i++)
    {
        /* only adjust failing connections that are in a hard fail state */
        if ((nslcd_cfg->uris[i].lastfail > t) &&
            (nslcd_cfg->uris[i].lastfail >
             (nslcd_cfg->uris[i].firstfail + nslcd_cfg->reconnect_retrytime)))
        {
            /* move lastfail back to ensure quick retry */
            log_log(LOG_DEBUG,
                    "moving lastfail of %s %d second(s) back to force retry",
                    nslcd_cfg->uris[i].uri,
                    (int)(nslcd_cfg->uris[i].lastfail - t));
            nslcd_cfg->uris[i].lastfail = t;
        }
    }
    pthread_mutex_unlock(&uris_mutex);
}
/* force quick retries of all failing LDAP servers */
force quick retries of all failing LDAP servers
force quick retries of all failing LDAP servers
void myldap_immediate_reconnect(void)
{
    int i;
    time_t t;
    t = time(NULL) - nslcd_cfg->reconnect_retrytime;
    pthread_mutex_lock(&uris_mutex);
    for (i = 0; i < (NSS_LDAP_CONFIG_MAX_URIS + 1); i++)
    {
        if ((nslcd_cfg->uris[i].lastfail > t) &&
            (nslcd_cfg->uris[i].lastfail >
             (nslcd_cfg->uris[i].firstfail + nslcd_cfg->reconnect_retrytime)))
        {
            log_log(LOG_DEBUG,
                    "moving lastfail of %s %d second(s) back to force retry",
                    nslcd_cfg->uris[i].uri,
                    (int)(nslcd_cfg->uris[i].lastfail - t));
            nslcd_cfg->uris[i].lastfail = t;
        }
    }
    pthread_mutex_unlock(&uris_mutex);
}
void myldap_immediate_reconnect ( void ) { int i ; time_t t ; t = time ( NULL ) - nslcd_cfg -> reconnect_retrytime ; pthread_mutex_lock ( & uris_mutex ) ; for ( i = 0 ; i < ( NSS_LDAP_CONFIG_MAX_URIS + 1 ) ; i ++ ) { if ( ( nslcd_cfg -> uris [ i ] . lastfail > t ) && ( nslcd_cfg -> uris [ i ] . lastfail > ( nslcd_cfg -> uris [ i ] . firstfail + nslcd_cfg -> reconnect_retrytime ) ) ) { log_log ( LOG_DEBUG , " " , nslcd_cfg -> uris [ i ] . uri , ( int ) ( nslcd_cfg -> uris [ i ] . lastfail - t ) ) ; nslcd_cfg -> uris [ i ] . lastfail = t ; } } pthread_mutex_unlock ( & uris_mutex ) ; }
force quick retries of all failing LDAP servers
force quick retries of all failing LDAP servers
/* only adjust failing connections that are in a hard fail state */ /* move lastfail back to ensure quick retry */