]> git.sur5r.net Git - openldap/commitdiff
Don't set ndelay on socket connect if no timeout was specified
authorHoward Chu <hyc@openldap.org>
Sat, 8 Oct 2005 18:19:50 +0000 (18:19 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 8 Oct 2005 18:19:50 +0000 (18:19 +0000)
libraries/libldap/os-ip.c

index 02eb7828aa55cd73c98f109681fbe636a5268f37..65341b5e846d3f82d0c943bc94dbfb33b14be771 100644 (file)
@@ -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 );
        }