]> granicus.if.org Git - apache/commitdiff
* Handle the cases "no proxy request" and "reverse proxy request" in the same
authorRuediger Pluem <rpluem@apache.org>
Wed, 17 May 2006 19:16:43 +0000 (19:16 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 17 May 2006 19:16:43 +0000 (19:16 +0000)
  manner, when setting scheme and port_str. This is needed because if a cached
  entry is looked up by mod_cache's quick handler r->proxyreq
  is still unset in the reverse proxy case as it only gets set in the
  translate name hook (either by ProxyPass or mod_rewrite) which is run
  after the quick handler hook. This is different to the forward proxy
  case where it gets set before the quick handler is run (in the
  post_read_request hook).
  If a cache entry is created by the CACHE_SAVE filter we always have
  r->proxyreq set correctly.
  Also set scheme to ap_http_scheme(r) instead of "http" to handle SSL
  correctly.

PR: 39593

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@407357 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/cache_storage.c

diff --git a/CHANGES b/CHANGES
index fff36d68b0da7675c3e3f1dab01d80d74441856c..c1093c7ed9bc69698e6ed9125c7c0470d06dc3f3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_cache: Make caching of reverse SSL proxies possible again. PR 39593.
+     [Ruediger Pluem]
+
   *) Add support for fcgi:// proxies to mod_rewrite.
      [Markus Schiegl <ms schiegl.com>]
 
index 94beaffc6864eb93fc7f55d419159e6a7c4c13fd..9db8bbba6b4ffda4858ce2ce46bee420b0a944cb 100644 (file)
@@ -364,8 +364,13 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
         hostname = "_default_";
     }
 
-    /* Copy the scheme, ensuring that it is lower case. If the parsed uri
-     * contains no string or if this is not a proxy request.
+    /*
+     * Copy the scheme, ensuring that it is lower case. If the parsed uri
+     * contains no string or if this is not a proxy request get the http
+     * scheme for this request. As r->parsed_uri.scheme is not set if this
+     * is a reverse proxy request, it is ensured that the cases
+     * "no proxy request" and "reverse proxy request" are handled in the same
+     * manner (see above why this is needed).
      */
     if (r->proxyreq && r->parsed_uri.scheme) {
         /* Copy the scheme */
@@ -375,15 +380,18 @@ apr_status_t cache_generate_key_default(request_rec *r, apr_pool_t* p,
         }
     }
     else {
-        scheme = "http";
+        scheme = ap_http_scheme(r);
     }
 
-    /* If the content is locally generated, use the port-number of the
-     * current server. Otherwise. copy the URI's port-string (which may be a
-     * service name). If the URI contains no port-string, use apr-util's
-     * notion of the default port for that scheme - if available.
+    /*
+     * If this is a proxy request, but not a reverse proxy request (see comment
+     * above why these cases must be handled in the same manner), copy the
+     * URI's port-string (which may be a service name). If the URI contains
+     * no port-string, use apr-util's notion of the default port for that
+     * scheme - if available. Otherwise use the port-number of the current
+     * server.
      */
-    if(r->proxyreq) {
+    if(r->proxyreq && (r->proxyreq != PROXYREQ_REVERSE)) {
         if (r->parsed_uri.port_str) {
             port_str = apr_pcalloc(p, strlen(r->parsed_uri.port_str) + 2);
             port_str[0] = ':';