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

  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
parent 48e7d1d0
Loading
Loading
Loading
Loading
+9 −7
Changes for ssl_engine_io.c: 9 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -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 (inctx->block == APR_NONBLOCK_READ) {
                if (*len > 0) {
                    inctx->rc = APR_SUCCESS;
                    break;
                }
                if (inctx->block == APR_NONBLOCK_READ) {
                    break;
                }
            }
@@ -676,26 +677,27 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx,
                 */
                inctx->rc = APR_EAGAIN;

                if (inctx->block == APR_NONBLOCK_READ) {
                    /* Already read something, return APR_SUCCESS instead. */
                if (*len > 0) {
                    inctx->rc = APR_SUCCESS;
                    break;
                }
                    break; /* non fatal error */
                if (inctx->block == APR_NONBLOCK_READ) {
                    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 (inctx->block == APR_NONBLOCK_READ) {
                    if (*len > 0) {
                        inctx->rc = APR_SUCCESS;
                        break;
                    }
                    if (inctx->block == APR_NONBLOCK_READ) {
                        break;
                    }
                    continue;
                    continue;  /* Blocking and nothing yet?  Try again. */
                }
                else {
                    ap_log_error(APLOG_MARK, APLOG_ERR, inctx->rc, c->base_server,