From 010dbff2cc5e845471c757fb8fe6dcfa0fea714b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 29 Aug 2002 10:12:35 +0000 Subject: [PATCH] Fix ITS#1983, in sb_sasl_write, set errno = EAGAIN to tell upper layers to retry partial writes --- libraries/libldap/cyrus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 1e6e9f42cf..34cc0d8e42 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -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. */ -- 2.39.5