httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r808649 - /httpd/httpd/trunk/modules/cache/cache_util.c
Date Thu, 27 Aug 2009 21:44:48 GMT
Author: minfrin
Date: Thu Aug 27 21:44:48 2009
New Revision: 808649

URL: http://svn.apache.org/viewvc?rev=808649&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/modules/cache/cache_util.c

Modified: httpd/httpd/trunk/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/cache_util.c?rev=808649&r1=808648&r2=808649&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/cache_util.c (original)
+++ httpd/httpd/trunk/modules/cache/cache_util.c Thu Aug 27 21:44:48 2009
@@ -195,12 +195,19 @@
     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);



Mime
View raw message