From: Brian Pane Date: Sat, 14 Sep 2002 04:51:55 +0000 (+0000) Subject: Remove the setting of the status line from the cache in mod_disk_cache, X-Git-Tag: 2.0.42~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ffc50f03ba3c4027062691ab8ce84e16e9a0b35;p=apache Remove the setting of the status line from the cache in mod_disk_cache, because this was causing 200s to be sent on responses that were really 304s Submitted by: Kris Verbeeck Reviewed by: Brian Pane git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96803 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 15d07aede8..22344d10a4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Changes with Apache 2.0.42 + + *) Fixed mod_disk_cache's generation of 304s + [Kris Verbeeck ] + Changes with Apache 2.0.41 *) Add support for using fnmatch patterns in the final path diff --git a/modules/experimental/mod_disk_cache.c b/modules/experimental/mod_disk_cache.c index 5b0a4eeeb0..f028f45f51 100644 --- a/modules/experimental/mod_disk_cache.c +++ b/modules/experimental/mod_disk_cache.c @@ -484,17 +484,15 @@ static apr_status_t read_headers(cache_handle_t *h, request_rec *r) r->status = atoi(urlbuff); /* Save status line into request rec */ - rv = apr_file_gets(&urlbuff[0], urllen, dobj->hfd); /* Read status line */ + /* Read and ignore the status line (This request might result in a + * 304, so we don't necessarily want to retransmit a 200 from the cache.) + */ + rv = apr_file_gets(&urlbuff[0], urllen, dobj->hfd); if (rv != APR_SUCCESS) { /* XXX log message */ return rv; } - if ((temp = strchr(&urlbuff[0], '\n')) != NULL) /* trim off new line character */ - *temp = '\0'; /* overlay it with the null terminator */ - - r->status_line = apr_pstrdup(r->pool, urlbuff); /* Save status line into request rec */ - h->req_hdrs = apr_table_make(r->pool, 20); /*