]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport r808723, which was applied to trunk but not added to the backport
authorGraham Leggett <minfrin@apache.org>
Sun, 28 Feb 2010 13:25:53 +0000 (13:25 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 28 Feb 2010 13:25:53 +0000 (13:25 +0000)
proposal below. Fixes a compiler warning on v2.2 reported by Rainer Jung.
mod_cache: Introduce the thundering herd lock, a mechanism to keep
the flood of requests at bay that strike a backend webserver as
a cached entity goes stale.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@917177 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_util.c

index 41eab93a2256c67463bf29f1134211c209c8ca98..cb3d56537d6427e00adcb6b67c922b3715f59e21 100644 (file)
@@ -249,8 +249,8 @@ CACHE_DECLARE(apr_status_t) ap_cache_try_lock(cache_server_conf *conf,
                      lockname);
         return status;
     }
-    if (APR_SUCCESS == status && ((now - finfo.mtime) > conf->lockmaxage)
-            || (now < finfo.mtime)) {
+    if ((status == APR_SUCCESS) && (((now - finfo.mtime) > conf->lockmaxage)
+                                  || (now < finfo.mtime))) {
         ap_log_error(APLOG_MARK, APLOG_INFO, status, r->server,
                      "Cache lock file for '%s' too old, removing: %s",
                      r->uri, lockname);