Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 17741 invoked from network); 11 Apr 2006 17:29:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Apr 2006 17:29:41 -0000 Received: (qmail 53737 invoked by uid 500); 11 Apr 2006 17:29:03 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 53532 invoked by uid 500); 11 Apr 2006 17:29:02 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 53513 invoked by uid 99); 11 Apr 2006 17:29:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2006 10:29:02 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 11 Apr 2006 10:29:01 -0700 Received: (qmail 17183 invoked by uid 65534); 11 Apr 2006 17:28:31 -0000 Message-ID: <20060411172831.17017.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r393264 - in /httpd/httpd/branches/2.0.x: STATUS modules/experimental/util_ldap.c Date: Tue, 11 Apr 2006 17:28:03 -0000 To: cvs@httpd.apache.org From: trawick@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: trawick Date: Tue Apr 11 10:27:53 2006 New Revision: 393264 URL: http://svn.apache.org/viewcvs?rev=393264&view=rev Log: Backport from trunk and 2.2.x: mod_ldap: Brad's pool fixes to fix a race condition during first request as well as thread-safety issues between threads handling different vhosts at steady state Submitted by: bnicholes Reviewed by: trawick, gregames Modified: httpd/httpd/branches/2.0.x/STATUS httpd/httpd/branches/2.0.x/modules/experimental/util_ldap.c Modified: httpd/httpd/branches/2.0.x/STATUS URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/STATUS?rev=393264&r1=393263&r2=393264&view=diff ============================================================================== --- httpd/httpd/branches/2.0.x/STATUS (original) +++ httpd/httpd/branches/2.0.x/STATUS Tue Apr 11 10:27:53 2006 @@ -150,21 +150,6 @@ http://svn.apache.org/viewcvs?rev=386821&view=rev +1: wrowe, trawick - *) mod_ldap: Brad's pool fixes to fix a race condition during - first request as well as thread-safety issues between threads - handling different vhosts at steady state - trunk revision: - http://svn.apache.org/viewcvs.cgi?view=rev&rev=386477 - (there's some server config merge logic which does not apply - to 2.0) - 2.0 patch is at - http://people.apache.org/~trawick/20_ldap_pool.patch - Add also Greg's apr_pool_create comment: - http://svn.apache.org/viewcvs?rev=393028&view=rev - (not gonna create a new 20_ldap_pool.patch to integrate - that comment; should be applied separately) - +1: trawick, gregames, bnicholes - *) mod_proxy: Fix PR 11971 (HTTP proxy header "Via" with wrong hostname if ServerName not set or UseCanonicalName Off) by backporting r102320. Modified: httpd/httpd/branches/2.0.x/modules/experimental/util_ldap.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/modules/experimental/util_ldap.c?rev=393264&r1=393263&r2=393264&view=diff ============================================================================== --- httpd/httpd/branches/2.0.x/modules/experimental/util_ldap.c (original) +++ httpd/httpd/branches/2.0.x/modules/experimental/util_ldap.c Tue Apr 11 10:27:53 2006 @@ -394,9 +394,6 @@ #if APR_HAS_THREADS /* mutex lock this function */ - if (!st->mutex) { - apr_thread_mutex_create(&st->mutex, APR_THREAD_MUTEX_DEFAULT, st->pool); - } apr_thread_mutex_lock(st->mutex); #endif @@ -1387,7 +1384,13 @@ util_ldap_state_t *st = (util_ldap_state_t *)apr_pcalloc(p, sizeof(util_ldap_state_t)); - st->pool = p; + /* Create a per vhost pool for mod_ldap to use, serialized with + * st->mutex (also one per vhost) + */ + apr_pool_create(&st->pool, p); +#if APR_HAS_THREADS + apr_thread_mutex_create(&st->mutex, APR_THREAD_MUTEX_DEFAULT, st->pool); +#endif st->cache_bytes = 100000; st->search_cache_ttl = 600000000; @@ -1444,7 +1447,7 @@ /* If the cache file already exists then delete it. Otherwise we are * going to run into problems creating the shared memory. */ if (st->cache_file) { - char *lck_file = apr_pstrcat (st->pool, st->cache_file, ".lck", NULL); + char *lck_file = apr_pstrcat (ptemp, st->cache_file, ".lck", NULL); apr_file_remove(st->cache_file, ptemp); apr_file_remove(lck_file, ptemp); }