On 4/18/24 9:32 AM, minf...@apache.org wrote:
> Added: apr/apr/trunk/ldap/apr_ldap.c
> URL: 
> http://svn.apache.org/viewvc/apr/apr/trunk/ldap/apr_ldap.c?rev=1917094&view=auto
> ==============================================================================
> --- apr/apr/trunk/ldap/apr_ldap.c (added)
> +++ apr/apr/trunk/ldap/apr_ldap.c Thu Apr 18 07:32:13 2024

> +
> +
> +
> +APU_DECLARE_LDAP(apr_status_t) apr_ldap_connect(apr_pool_t *pool,
> +                                                apr_ldap_t *ldap,
> +                                                apr_interval_time_t timeout,
> +                                                apu_err_t *err)
> +{
> +    LDAP *ld = ldap->ld;
> +
> +#if APR_HAS_MICROSOFT_LDAPSDK
> +    struct timeval tv, *tvptr;
> +
> +    if (timeout < 0) {
> +        tvptr = NULL;
> +    }
> +    else {
> +        tv.tv_sec = (long) apr_time_sec(timeout);
> +        tv.tv_usec = (long) apr_time_usec(timeout);
> +        tvptr = &tv;
> +    }
> +
> +    err->rc = ldap_connect(ld, tvptr);
> +
> +#else
> +
> +#ifdef LDAP_OPT_NETWORK_TIMEOUT
> +    {
> +        struct timeval tv, *tvptr;
> +
> +        if (timeout < 0) {
> +            tvptr = NULL;
> +        }
> +        else {
> +            tv.tv_sec = (long) apr_time_sec(timeout);
> +            tv.tv_usec = (long) apr_time_usec(timeout);
> +            tvptr = &tv;
> +        }
> +
> +        err->rc = ldap_set_option(ldap->ld, LDAP_OPT_NETWORK_TIMEOUT, tvptr);
> +        if (err->rc != LDAP_SUCCESS) {
> +            err->msg = ldap_err2string(err->rc);
> +            err->reason = "LDAP: Could not set network timeout";
> +            return APR_EINVAL;
> +        }
> +    }
> +#endif
> +
> +    err->rc = ldap_connect(ld);

This code is compiled with openldap and ldap_connect does not seem to be 
present with openldap at least not with 2.4.46 which is
delivered with RedHat 8. I can see it though in openldap 2.6.6 which is 
delivered with RedHat 9

ldap/apr_ldap.c: In function ‘apr__ldap_connect’:
ldap/apr_ldap.c:1091:15: warning: implicit declaration of function 
‘ldap_connect’; did you mean ‘ldap_cancel’?
[-Wimplicit-function-declaration]
     err->rc = ldap_connect(ld);
               ^~~~~~~~~~~~
               ldap_cancel

Regards

Rüdiger

Reply via email to