]> git.sur5r.net Git - openldap/commitdiff
ITS#8167 Fix non-blocking TLS with referrals
authorIan Puleston <ipuleston@SonicWALL.com>
Fri, 19 Sep 2014 01:48:50 +0000 (18:48 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 11 Oct 2017 19:45:36 +0000 (12:45 -0700)
libraries/libldap/tls2.c

index bb385f4a837fe174097ae0b17fa38a7014e4da64..d48e2fb2555dff7cd60c35c252206071819404ab 100644 (file)
@@ -854,7 +854,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
         * Use non-blocking io during SSL Handshake when a timeout is configured
         */
        if ( ld->ld_options.ldo_tm_net.tv_sec >= 0 ) {
-               ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_SET_NONBLOCK, sb );
+               ber_sockbuf_ctrl( sb, LBER_SB_OPT_SET_NONBLOCK, (void*)1 );
                ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_FD, &sd );
                tv = ld->ld_options.ldo_tm_net;
                tv0 = tv;
@@ -889,7 +889,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
                        break;
                } else {
                        /* ldap_int_poll called ldap_pvt_ndelay_off */
-                       ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_SET_NONBLOCK, sb );
+                       ber_sockbuf_ctrl( sb, LBER_SB_OPT_SET_NONBLOCK, (void*)1 );
                        ret = ldap_int_tls_connect( ld, conn, host );
                        if ( ret > 0 ) { /* need to call tls_connect once more */
                                struct timeval curr_time_tv, delta_tv;
@@ -937,7 +937,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
                }
        }
        if ( ld->ld_options.ldo_tm_net.tv_sec >= 0 ) {
-               ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_SET_NONBLOCK, NULL );
+               ber_sockbuf_ctrl( sb, LBER_SB_OPT_SET_NONBLOCK, NULL );
        }
 #endif /* LDAP_USE_NON_BLOCKING_TLS */