diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2002-11-06 08:29:36 +0100 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2002-11-06 08:29:36 +0100 |
commit | 0e489c76d22b83e8771b87e67cd0cc4effeae5c4 (patch) | |
tree | f45b3966c3e1db7eabefd1e7913dd43367a54f77 /modules/ssl | |
parent | errno? EINTR? what planet was this code on :-? Normalize the (diff) | |
download | apache2-0e489c76d22b83e8771b87e67cd0cc4effeae5c4.tar.xz apache2-0e489c76d22b83e8771b87e67cd0cc4effeae5c4.zip |
Rule one of winsock and other one-offs (even unix EINTR) ... blocking
isn't necessarily blocking. Should not have changed this in the prior
commit, and adding the same retry to the -1/EAGAIN|EINTR case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97423 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl')
-rw-r--r-- | modules/ssl/ssl_engine_io.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index c2f0ce824d..4c95d8772c 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -640,11 +640,16 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, */ if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc)) { - /* Already read something, return APR_SUCCESS instead. */ - if (*len > 0) { - inctx->rc = APR_SUCCESS; + /* Already read something, return APR_SUCCESS instead. + * On win32 in particular, but perhaps on other kernels, + * a blocking call isn't 'always' blocking. + */ + if (inctx->block == APR_NONBLOCK_READ) { + if (*len > 0) { + inctx->rc = APR_SUCCESS; + } + break; } - break; } else { if (*len > 0) { @@ -684,10 +689,13 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, if (APR_STATUS_IS_EAGAIN(inctx->rc) || APR_STATUS_IS_EINTR(inctx->rc)) { /* Already read something, return APR_SUCCESS instead. */ - if (*len > 0) { - inctx->rc = APR_SUCCESS; + if (inctx->block == APR_NONBLOCK_READ) { + if (*len > 0) { + inctx->rc = APR_SUCCESS; + } + break; } - break; + continue; } else { ap_log_error(APLOG_MARK, APLOG_ERR, inctx->rc, c->base_server, |