summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2009-08-27 23:44:48 +0200
committerGraham Leggett <minfrin@apache.org>2009-08-27 23:44:48 +0200
commit2e32dbe9b5a9f93cda405e9b21701889552783ab (patch)
treec5767c192d8791d7dc1f267a85ab936b0bcb1b89
parentDocument limitation to ProxyPassMatch directive. (diff)
downloadapache2-2e32dbe9b5a9f93cda405e9b21701889552783ab.tar.xz
apache2-2e32dbe9b5a9f93cda405e9b21701889552783ab.zip
When attempting to set the stale lock, we will pass try_lock twice. If we
already have the lock the first time, we must also have the lock the second time. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808649 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/cache/cache_util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c
index e287553ccd..73cf7b8951 100644
--- a/modules/cache/cache_util.c
+++ b/modules/cache/cache_util.c
@@ -195,12 +195,19 @@ CACHE_DECLARE(apr_status_t) ap_cache_try_lock(cache_server_conf *conf,
apr_finfo_t finfo;
finfo.mtime = 0;
apr_file_t *lockfile;
+ void *dummy;
if (!conf || !conf->lock || !conf->lockpath) {
/* no locks configured, leave */
return APR_SUCCESS;
}
+ /* lock already obtained earlier? if so, success */
+ apr_pool_userdata_get(&dummy, CACHE_LOCKFILE_KEY, r->pool);
+ if (dummy) {
+ return APR_SUCCESS;
+ }
+
/* create the key if it doesn't exist */
if (!key) {
cache_generate_key(r, r->pool, &key);