You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2007/11/03 10:47:03 UTC

Re: svn commit: r591488 - in /httpd/httpd/trunk: CHANGES modules/ldap/util_ldap.c


On 11/02/2007 10:58 PM, covener@apache.org wrote:
> Author: covener
> Date: Fri Nov  2 14:58:57 2007
> New Revision: 591488
> 
> URL: http://svn.apache.org/viewvc?rev=591488&view=rev
> Log:
> fix pool misuse around mod_ldap's connection cache, previously pconf 
> could be used during request processing
> 
> (the apr_ldap_foo only need a pool for temporary data anyway)
> 
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/modules/ldap/util_ldap.c
> 

> Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=591488&r1=591487&r2=591488&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
> +++ httpd/httpd/trunk/modules/ldap/util_ldap.c Fri Nov  2 14:58:57 2007

> @@ -533,11 +533,19 @@
>           */
>          /* create the details to the pool in st */
>          l = apr_pcalloc(st->pool, sizeof(util_ldap_connection_t));
> +        if (apr_pool_create(&l->pool, st->pool) != APR_SUCCESS) { 

What is the purpose of creating a sub pool here? I don't see directly that
l->pool has a shorter live time than st->pool. Any pointers?

Regards

RĂ¼diger


Re: svn commit: r591488 - in /httpd/httpd/trunk: CHANGES modules/ldap/util_ldap.c

Posted by Eric Covener <co...@gmail.com>.
On 11/3/07, Ruediger Pluem <rp...@apache.org> wrote:
>
> What is the purpose of creating a sub pool here? I don't see directly that
> l->pool has a shorter live time than st->pool. Any pointers?
>

You are correct in that It is not required at the moment.  It's a
compromise between zapping the pool reference in that
per-ldap-connection data structure completely and leaving it to
accomodate a future change in the lifetime of entries in the ldap
connection pool.

In the interim, since the entire structure is essentially 'checked
out' of the connection pool, l->pool can at safely be used during
request processing.

-- 
Eric Covener
covener@gmail.com