diff options
author | Joe Orton <jorton@apache.org> | 2004-11-14 17:20:01 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-11-14 17:20:01 +0000 |
commit | 67af6e5e14fe3496e7dd4483b5e296aefef27504 (patch) | |
tree | 71606353c3f528477bfb5fcf089895c840c887e5 | |
parent | 92a4eacd1d91407f786cb9f12902857dc03813a9 (diff) | |
download | httpd-67af6e5e14fe3496e7dd4483b5e296aefef27504.tar.gz |
Fix handling of non-blocking reads in mod_ssl (triggered by recent
change to mod_proxy_http):
* modules/ssl/ssl_engine_io.c (bio_filter_in_read): Return an error if
the read would block so that the SSL_read() caller checks for
SSL_ERROR_WANT_READ, rather than 0, which is treated like EOF.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@105768 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | ssl_engine_io.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ssl_engine_io.c b/ssl_engine_io.c index 1af89ed550..fd5be72f0f 100644 --- a/ssl_engine_io.c +++ b/ssl_engine_io.c @@ -488,12 +488,14 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) AP_MODE_READBYTES, block, inl); - /* Not a problem, there was simply no data ready yet. - */ + /* If the read returns EAGAIN or success with an empty + * brigade, return an error after setting the retry flag; + * SSL_read() will then return -1, and SSL_get_error() will + * indicate SSL_ERROR_WANT_READ. */ if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc) || (inctx->rc == APR_SUCCESS && APR_BRIGADE_EMPTY(inctx->bb))) { BIO_set_retry_read(bio); - return 0; + return -1; } if (inctx->rc != APR_SUCCESS) { |