Skip to content
Snippets Groups Projects
Commit d6a9d46f authored by David Bender's avatar David Bender Committed by Quanah Gibson-Mount
Browse files

ITS#7476 Prevent EINTR from stopping otherwise successful connect

parent 5bfe1c1f
No related branches found
No related tags found
No related merge requests found
......@@ -438,13 +438,21 @@ ldap_pvt_connect(LDAP *ld, ber_socket_t s,
if ( opt_tv && ldap_pvt_ndelay_on(ld, s) == -1 )
return ( -1 );
if ( connect(s, sin, addrlen) != AC_SOCKET_ERROR ) {
if ( opt_tv && ldap_pvt_ndelay_off(ld, s) == -1 )
return ( -1 );
return ( 0 );
}
do{
osip_debug(ld, "attempting to connect: \n", 0, 0, 0);
if ( connect(s, sin, addrlen) != AC_SOCKET_ERROR ) {
osip_debug(ld, "connect success\n", 0, 0, 0);
if ( opt_tv && ldap_pvt_ndelay_off(ld, s) == -1 )
return ( -1 );
return ( 0 );
}
err = sock_errno();
osip_debug(ld, "connect errno: %d\n", err, 0, 0);
} while(err == EINTR &&
LDAP_BOOL_GET( &ld->ld_options, LDAP_BOOL_RESTART ));
err = sock_errno();
if ( err != EINPROGRESS && err != EWOULDBLOCK ) {
return ( -1 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment