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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9d40ecc2b9f02a953aa7ba598198bf9e1c3d5f2;p=thirdparty%2Fapache%2Fhttpd.git 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/modules/ssl@97424 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_engine_io.c b/ssl_engine_io.c index 4c95d8772cf..b9ade4dcba7 100644 --- a/ssl_engine_io.c +++ b/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,