]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#3139, empty output buffer when sb_sasl_write fails
authorHoward Chu <hyc@openldap.org>
Fri, 14 May 2004 08:03:25 +0000 (08:03 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 14 May 2004 08:03:25 +0000 (08:03 +0000)
libraries/libldap/cyrus.c

index cb4a25c94bd44a3befc86090abcbab4e92db570f..2b632482a8ad05f259dbcdfd3648862d55391fee 100644 (file)
@@ -374,8 +374,11 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
        p->buf_out.buf_end = p->buf_out.buf_size;
 
        ret = ber_pvt_sb_do_write( sbiod, &p->buf_out );
-       if ( ret <= 0 )
+       if ( ret <= 0 ) {
+               /* caller will retry, so clear this buffer out */
+               p->buf_out.buf_ptr = p->buf_out.buf_end;
                return ret;
+       }
        return len;
 }