]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#1983, in sb_sasl_write, set errno = EAGAIN to tell upper layers to
authorHoward Chu <hyc@openldap.org>
Thu, 29 Aug 2002 10:12:35 +0000 (10:12 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 29 Aug 2002 10:12:35 +0000 (10:12 +0000)
retry partial writes

libraries/libldap/cyrus.c

index 1e6e9f42cf31f5d322753bd82766dc7f09b196d9..34cc0d8e422df5eb1ebde2c29b015a6f93c568fd 100644 (file)
@@ -331,8 +331,13 @@ sb_sasl_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
        /* Are there anything left in the buffer? */
        if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
                ret = ber_pvt_sb_do_write( sbiod, &p->buf_out );
-               if ( ret <= 0 )
+               if ( ret < 0 )
                        return ret;
+               /* Still have something left?? */
+               if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
+                       errno = EAGAIN;
+                       return 0;
+               }
        }
 
        /* now encode the next packet. */