Commit 824dbd9b authored by Doug MacEachern's avatar Doug MacEachern
Browse files

PR:

Obtained from:
Submitted by:
Reviewed by:
ssl_io_input_read now returns APR_EOF if ssl_io_hook_read returns 0
bytes for a reason other than SSL_ERROR_WANT_READ.  this should
prevent a possible endless loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@94519 13f79535-47bb-0310-9956-ffa450edef68
parent 181920ee
Loading
Loading
Loading
Loading
+5 −1
Changes for ssl_engine_io.c: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ static int ssl_io_hook_read(SSL *ssl, char *buf, int len)

    rc = SSL_read(ssl, buf, len);

    if (rc < 0) {
    if (rc <= 0) {
        int ssl_err = SSL_get_error(ssl, rc);

        if (ssl_err == SSL_ERROR_WANT_READ) {
@@ -674,6 +674,10 @@ static apr_status_t ssl_io_input_read(ssl_io_input_ctx_t *ctx,
            char_buffer_write(&ctx->cbuf, buf, rc);
        }
    }
    else if ((rc == 0) && (errno != EINTR)) {
        /* something other than SSL_ERROR_WANT_READ */
        return APR_EOF;
    }
    else if ((rc == -1) && (ctx->inbio.rc == APR_SUCCESS)) {
        /*
         * bucket read from socket was successful,