[SCM] Debian packaging for apache2 branch, squeeze, updated. 71849f7217cf0153d2fad36cf5c995b5967a58a3

Stefan Fritsch sf at sfritsch.de
Sat Jul 28 19:07:53 UTC 2012


The following commit has been merged in the squeeze branch:
commit 71849f7217cf0153d2fad36cf5c995b5967a58a3
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Sat Jul 28 21:03:37 2012 +0200

    mod_cache: Prevent Partial Content responses from being cached and
    served as normal response. Closes: #671204

diff --git a/debian/changelog b/debian/changelog
index 0fade41..3a2e962 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ apache2 (2.2.16-6+squeeze8) UNRELEASED; urgency=low
 
   * Send 408 status instead of 400 if reading of a request fails with a
     timeout. This allows browsers to retry. Closes: #677086
+  * mod_cache: Prevent Partial Content responses from being cached and served
+    as normal response. Closes: #671204
 
  -- Stefan Fritsch <sf at debian.org>  Sat, 28 Jul 2012 20:53:03 +0200
 
diff --git a/debian/patches/00list b/debian/patches/00list
index 1d81b61..733e804 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -37,6 +37,7 @@
 093_CVE-2012-0031.dpatch
 094_CVE-2012-0053.dpatch
 095_send_408_status.dpatch
+096_mod_cache_partial_content-2.2.x.dpatch
 099_config_guess_sub_update
 200_cp_suexec.dpatch
 201_build_suexec-custom.dpatch
diff --git a/debian/patches/096_mod_cache_partial_content-2.2.x.dpatch b/debian/patches/096_mod_cache_partial_content-2.2.x.dpatch
new file mode 100755
index 0000000..b95756e
--- /dev/null
+++ b/debian/patches/096_mod_cache_partial_content-2.2.x.dpatch
@@ -0,0 +1,74 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add r1343951 from upstream branch 2.2.x
+## DP: Debian bug #671204
+
+*) mod_disk_cache, mod_mem_cache: Decline the opportunity to cache if the
+   response is a 206 Partial Content. This stops a reverse proxied partial
+   response from becoming cached, and then being served in subsequent
+   responses. [Graham Leggett]
+
+
+Index: a/modules/cache/mod_cache.c
+===================================================================
+--- a/modules/cache/mod_cache.c	(revision 1176912)
++++ a/modules/cache/mod_cache.c	(working copy)
+@@ -473,7 +473,8 @@
+          * We include 304 Not Modified here too as this is the origin server
+          * telling us to serve the cached copy.
+          */
+-        if (exps != NULL || cc_out != NULL) {
++        if ((exps != NULL || cc_out != NULL)
++            && r->status != HTTP_PARTIAL_CONTENT) {
+             /* We are also allowed to cache any response given that it has a
+              * valid Expires or Cache Control header. If we find a either of
+              * those here,  we pass request through the rest of the tests. From
+@@ -486,6 +487,9 @@
+              * include the following: an Expires header (section 14.21); a
+              * "max-age", "s-maxage",  "must-revalidate", "proxy-revalidate",
+              * "public" or "private" cache-control directive (section 14.9).
++             *
++             * But do NOT store 206 responses in any case since we
++             * don't (yet) cache partial responses.
+              */
+         }
+         else {
+Index: modules/cache/mod_mem_cache.c
+===================================================================
+--- a/modules/cache/mod_mem_cache.c	(revision 1176912)
++++ a/modules/cache/mod_mem_cache.c	(working copy)
+@@ -313,6 +313,14 @@
+     cache_object_t *obj, *tmp_obj;
+     mem_cache_object_t *mobj;
+ 
++    /* we don't support caching of range requests (yet) */
++    if (r->status == HTTP_PARTIAL_CONTENT) {
++        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
++                     "disk_cache: URL %s partial content response not cached",
++                     key);
++        return DECLINED;
++    }
++
+     if (len == -1) {
+         /* Caching a streaming response. Assume the response is
+          * less than or equal to max_streaming_buffer_size. We will
+Index: modules/cache/mod_disk_cache.c
+===================================================================
+--- a/modules/cache/mod_disk_cache.c	(revision 1176912)
++++ a/modules/cache/mod_disk_cache.c	(working copy)
+@@ -330,6 +330,14 @@
+         return DECLINED;
+     }
+ 
++    /* we don't support caching of range requests (yet) */
++    if (r->status == HTTP_PARTIAL_CONTENT) {
++        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
++                     "disk_cache: URL %s partial content response not cached",
++                     key);
++        return DECLINED;
++    }
++
+     /* Allocate and initialize cache_object_t and disk_cache_object_t */
+     h->cache_obj = obj = apr_pcalloc(r->pool, sizeof(*obj));
+     obj->vobj = dobj = apr_pcalloc(r->pool, sizeof(*dobj));

-- 
Debian packaging for apache2



More information about the Pkg-apache-commits mailing list