From b1ce9ad017556587ef990672af4ff133f221fe04 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 11 Oct 2002 19:18:07 +0000 Subject: [PATCH] TLS fix --- libraries/libldap/tls.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 68f7e09b59..3af0ac7613 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -645,8 +645,11 @@ sb_tls_bio_read( BIO *b, char *buf, int len ) ret = LBER_SBIOD_READ_NEXT( p->sbiod, buf, len ); BIO_clear_retry_flags( b ); - if ( ret < 0 && errno == EWOULDBLOCK ) { - BIO_set_retry_read( b ); + if ( ret < 0 ) { + int err = errno; + if ( err == EAGAIN || err == EWOULDBLOCK ) { + BIO_set_retry_read( b ); + } } return ret; @@ -669,8 +672,11 @@ sb_tls_bio_write( BIO *b, const char *buf, int len ) ret = LBER_SBIOD_WRITE_NEXT( p->sbiod, (char *)buf, len ); BIO_clear_retry_flags( b ); - if ( ret < 0 && errno == EWOULDBLOCK ) { - BIO_set_retry_write( b ); + if ( ret < 0 ) { + int err = errno; + if ( err == EAGAIN || err == EWOULDBLOCK ) { + BIO_set_retry_write( b ); + } } return ret; -- 2.39.5