Commit 48e7d1d0 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  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/modules/ssl@97423 13f79535-47bb-0310-9956-ffa450edef68
parent 1beb177b
Loading
Loading
Loading
Loading
+9 −1
Changes for ssl_engine_io.c: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -640,12 +640,17 @@ 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. */
                /* 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;
                }
            }
            else {
                if (*len > 0) {
                    inctx->rc = APR_SUCCESS;
@@ -684,11 +689,14 @@ 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 (inctx->block == APR_NONBLOCK_READ) {
                        if (*len > 0) {
                            inctx->rc = APR_SUCCESS;
                        }
                        break;
                    }
                    continue;
                }
                else {
                    ap_log_error(APLOG_MARK, APLOG_ERR, inctx->rc, c->base_server,
                                "SSL input filter read failed.");