Make non blocking I/O work for accept BIOs.
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index d85555a..9141ec0 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c
@@ -206,6 +206,10 @@ BIO_set_retry_special(b); retry_reason=BIO_RR_SSL_X509_LOOKUP; break; + case SSL_ERROR_WANT_ACCEPT: + BIO_set_retry_special(b); + retry_reason=BIO_RR_ACCEPT; + break; case SSL_ERROR_WANT_CONNECT: BIO_set_retry_special(b); retry_reason=BIO_RR_CONNECT;
diff --git a/ssl/ssl.h b/ssl/ssl.h index 87e609e..2bc994a 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h
@@ -831,6 +831,7 @@ #define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ #define SSL_ERROR_ZERO_RETURN 6 #define SSL_ERROR_WANT_CONNECT 7 +#define SSL_ERROR_WANT_ACCEPT 8 #define SSL_CTRL_NEED_TMP_RSA 1 #define SSL_CTRL_SET_TMP_RSA 2
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index fec98dd..ed2b820 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c
@@ -1543,6 +1543,8 @@ reason=BIO_get_retry_reason(bio); if (reason == BIO_RR_CONNECT) return(SSL_ERROR_WANT_CONNECT); + else if (reason == BIO_RR_ACCEPT) + return(SSL_ERROR_WANT_ACCEPT); else return(SSL_ERROR_SYSCALL); /* unknown */ } @@ -1561,6 +1563,8 @@ reason=BIO_get_retry_reason(bio); if (reason == BIO_RR_CONNECT) return(SSL_ERROR_WANT_CONNECT); + else if (reason == BIO_RR_ACCEPT) + return(SSL_ERROR_WANT_ACCEPT); else return(SSL_ERROR_SYSCALL); }