From: Edward Lu Date: Tue, 1 Sep 2015 14:32:38 +0000 (+0000) Subject: Fix mod_mem_cache caching incomplete responses on connection abort X-Git-Tag: 2.2.32~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c31477c0419c310c340dc8d704585289f0f594a;p=thirdparty%2Fapache%2Fhttpd.git Fix mod_mem_cache caching incomplete responses on connection abort git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1700578 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_mem_cache.c b/modules/cache/mod_mem_cache.c index b845b98330a..826c4afc0f4 100644 --- a/modules/cache/mod_mem_cache.c +++ b/modules/cache/mod_mem_cache.c @@ -763,6 +763,15 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r, apr_bucket_bri return APR_EGENERAL; } } + if (r->connection->aborted) { + ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, + "mem_cache: Discarding body for URL %s " + "because connection was aborted.", + obj->key); + /* No need to cleanup - obj->complete unset, so + * decrement_refcount will discard the object */ + return APR_EGENERAL; + } if (mobj->m_len > obj->count) { /* Caching a streamed response. Reallocate a buffer of the * correct size and copy the streamed response into that