From: William A. Rowe Jr Date: Wed, 6 Nov 2002 07:44:11 +0000 (+0000) Subject: Per Justin's feedback, this still needed a little work to get the X-Git-Tag: 2.0.44~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=875f5df575432025349b57aeb6b20d6941867f19;p=apache Per Justin's feedback, this still needed a little work to get the four cases (block/nonblock read/nodata) straight. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97424 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 4c95d8772c..b9ade4dcba 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -644,10 +644,11 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, * On win32 in particular, but perhaps on other kernels, * a blocking call isn't 'always' blocking. */ + if (*len > 0) { + inctx->rc = APR_SUCCESS; + break; + } if (inctx->block == APR_NONBLOCK_READ) { - if (*len > 0) { - inctx->rc = APR_SUCCESS; - } break; } } @@ -676,26 +677,27 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, */ inctx->rc = APR_EAGAIN; + if (*len > 0) { + inctx->rc = APR_SUCCESS; + break; + } if (inctx->block == APR_NONBLOCK_READ) { - /* Already read something, return APR_SUCCESS instead. */ - if (*len > 0) { - inctx->rc = APR_SUCCESS; - } - break; /* non fatal error */ + break; } - continue; /* try again */ + continue; /* Blocking and nothing yet? Try again. */ } else if (ssl_err == SSL_ERROR_SYSCALL) { 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; + break; + } if (inctx->block == APR_NONBLOCK_READ) { - if (*len > 0) { - inctx->rc = APR_SUCCESS; - } break; } - continue; + continue; /* Blocking and nothing yet? Try again. */ } else { ap_log_error(APLOG_MARK, APLOG_ERR, inctx->rc, c->base_server,