]> git.sur5r.net Git - openldap/commitdiff
Fix large SASL reads. Use EAGAIN instead of EWOULDBLOCK (was right the
authorHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 10:11:54 +0000 (10:11 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 30 Aug 2002 10:11:54 +0000 (10:11 +0000)
first time after all. see read(2) and write(2)...)

libraries/libldap/cyrus.c
libraries/libldap/request.c

index 85b248de6715f102a7260043180e6186881bca82..b892accecdf488429f1e07c159a4baf5c08940d5 100644 (file)
@@ -257,7 +257,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
                        continue;
 #endif
                if ( ret <= 0 )
-                       return ret;
+                       return bufptr ? bufptr : ret;
 
                p->sec_buf_in.buf_ptr += ret;
        }
@@ -287,7 +287,7 @@ sb_sasl_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
                        continue;
 #endif
                if ( ret <= 0 )
-                       return ret;
+                       return bufptr ? bufptr : ret;
 
                p->sec_buf_in.buf_ptr += ret;
        }
@@ -335,7 +335,7 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
                        return ret;
                /* Still have something left?? */
                if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
-                       errno = EWOULDBLOCK;
+                       errno = EAGAIN;
                        return 0;
                }
        }
index 0ffd592b2187ecf700a2459bb079a813db059793..ed80127306a5653950f99cd1420d7ca0081fa8bc 100644 (file)
@@ -146,7 +146,7 @@ ldap_int_flush_request(
        LDAPConn *lc = lr->lr_conn;
 
        if ( ber_flush( lc->lconn_sb, lr->lr_ber, 0 ) != 0 ) {
-               if ( errno == EWOULDBLOCK ) {
+               if ( errno == EAGAIN ) {
                        /* need to continue write later */
                        lr->lr_status = LDAP_REQST_WRITING;
                        ldap_mark_select_write( ld, lc->lconn_sb );