From: Howard Chu Date: Sat, 8 Oct 2005 18:19:50 +0000 (+0000) Subject: Don't set ndelay on socket connect if no timeout was specified X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~305 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fc79957ad63eab99a27306cc783da0342c610cae;p=openldap Don't set ndelay on socket connect if no timeout was specified --- diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 02eb7828aa..65341b5e84 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -232,11 +232,11 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s, osip_debug(ld, "ldap_connect_timeout: fd: %d tm: %ld async: %d\n", s, opt_tv ? tv.tv_sec : -1L, async); - if ( ldap_pvt_ndelay_on(ld, s) == -1 ) + if ( opt_tv && ldap_pvt_ndelay_on(ld, s) == -1 ) return ( -1 ); if ( connect(s, sin, addrlen) != AC_SOCKET_ERROR ) { - if ( ldap_pvt_ndelay_off(ld, s) == -1 ) + if ( opt_tv && ldap_pvt_ndelay_off(ld, s) == -1 ) return ( -1 ); return ( 0 ); }