From f0c57edf1cbe3e397e0f67c34c1916c3b2d9a036 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Thu, 21 Jan 2016 13:14:07 +0000 Subject: [PATCH] handling TIMEUP on SSL inputs by allowing later retries git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725940 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/ssl/ssl_engine_io.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGES b/CHANGES index e83d781ab5..43f88aa085 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_ssl: handle TIMEOUT on empty SSL input as non-fatal, returning + APR_TIMEUP and preserving connection state for later retry. + [Stefan Eissing] + *) ap_expr: expression support for r->kept_body if it exists. [Jim Jagielski] diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index c86bdb0e4e..99a4982938 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -506,6 +506,12 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) return -1; } + if (block == APR_BLOCK_READ + && APR_STATUS_IS_TIMEUP(inctx->rc) + && APR_BRIGADE_EMPTY(inctx->bb)) { + /* don't give up, just return the timeout */ + return -1; + } if (inctx->rc != APR_SUCCESS) { /* Unexpected errors discard the brigade */ apr_brigade_cleanup(inctx->bb); @@ -722,6 +728,10 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx, } continue; /* Blocking and nothing yet? Try again. */ } + else if (APR_STATUS_IS_TIMEUP(inctx->rc)) { + /* just return it, the calling layer might be fine with it, + and we do not want to bloat the log. */ + } else { ap_log_cerror(APLOG_MARK, APLOG_INFO, inctx->rc, c, APLOGNO(01991) "SSL input filter read failed."); -- 2.40.0