]> git.sur5r.net Git - openldap/commitdiff
ITS#6639 set sock err to EAGAIN on partial write
authorHoward Chu <hyc@openldap.org>
Sun, 12 Sep 2010 10:09:45 +0000 (10:09 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 12 Sep 2010 10:09:45 +0000 (10:09 +0000)
libraries/libldap/sasl.c

index 6aa8cce49791cda8720636d6f88c8589c4cee24d..8856ef78d556b74607390d2e2b548460565af3b7 100644 (file)
@@ -733,8 +733,9 @@ sb_sasl_generic_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
                return ret;
        } else if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
                /* partial write? pretend nothing got written */
-               len2 = 0;
                p->flags |= LDAP_PVT_SASL_PARTIAL_WRITE;
+               sock_errset(EAGAIN);
+               len2 = -1;
        }
 
        /* return number of bytes encoded, not written, to ensure