Commit a809c813 authored by Edward Lu's avatar Edward Lu
Browse files

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
parent 4a116104
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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