On Tue, Sep 1, 2015 at 4:32 PM, <[email protected]> wrote:
> Author: elu
> Date: Tue Sep 1 14:32:38 2015
> New Revision: 1700578
>
> URL: http://svn.apache.org/r1700578
> Log:
> Fix mod_mem_cache caching incomplete responses on connection abort
>
> Modified:
> httpd/httpd/branches/2.2.x/modules/cache/mod_mem_cache.c
>
> Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_mem_cache.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_mem_cache.c?rev=1700578&r1=1700577&r2=1700578&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/modules/cache/mod_mem_cache.c (original)
> +++ httpd/httpd/branches/2.2.x/modules/cache/mod_mem_cache.c Tue Sep 1
> 14:32:38 2015
> @@ -763,6 +763,15 @@ static apr_status_t store_body(cache_han
> return APR_EGENERAL;
> }
> }
> + if (r->connection->aborted) {
Since store_body() does not use r->connection, don't we know from the
very beginning if r->connection->aborted?
If so, maybe we could fail there.
> + 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
>
>