You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/10/26 22:00:31 UTC

svn commit: r1844928 - /httpd/httpd/trunk/modules/ssl/ssl_engine_io.c

Author: ylavic
Date: Fri Oct 26 22:00:30 2018
New Revision: 1844928

URL: http://svn.apache.org/viewvc?rev=1844928&view=rev
Log:
mod_ssl: axe dead code.

No functional change, we never get there when *len > 0.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_io.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=1844928&r1=1844927&r2=1844928&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Fri Oct 26 22:00:30 2018
@@ -741,7 +741,7 @@ static apr_status_t ssl_io_input_read(bi
         rc = SSL_read(inctx->filter_ctx->pssl, buf + bytes, wanted - bytes);
 
         if (rc > 0) {
-            *len += rc;
+            *len = rc;
             if (inctx->mode == AP_MODE_SPECULATIVE) {
                 /* We want to rollback this read. */
                 char_buffer_write(inctx, buf, rc);
@@ -754,28 +754,17 @@ static apr_status_t ssl_io_input_read(bi
             if (rc == 0) {
                 /* If EAGAIN, we will loop given a blocking read,
                  * otherwise consider ourselves at EOF.
+                 * On win32 in particular, but perhaps on other kernels,
+                 * a blocking call isn't 'always' blocking.
                  */
                 if (APR_STATUS_IS_EAGAIN(inctx->rc)
                         || APR_STATUS_IS_EINTR(inctx->rc)) {
-                    /* Already read something, return APR_SUCCESS instead.
-                     * 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) {
                         break;
                     }
                 }
-                else {
-                    if (*len > 0) {
-                        inctx->rc = APR_SUCCESS;
-                        break;
-                    }
-                }
             }
+
             ssl_err = SSL_get_error(inctx->filter_ctx->pssl, rc);
             c = (conn_rec*)SSL_get_app_data(inctx->filter_ctx->pssl);
 
@@ -790,10 +779,6 @@ static apr_status_t ssl_io_input_read(bi
                  */
                 inctx->rc = APR_EAGAIN;
 
-                if (*len > 0) {
-                    inctx->rc = APR_SUCCESS;
-                    break;
-                }
                 if (inctx->block == APR_NONBLOCK_READ) {
                     break;
                 }
@@ -802,11 +787,6 @@ static apr_status_t ssl_io_input_read(bi
             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) {
                         break;
                     }