You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Estrade Matthieu <es...@ifrance.com> on 2003/07/01 15:01:43 UTC

[PATCH] util_ldap_cache shm broken in apache 2.x

Hi,

I sent few weeks ago a patch for util_ldap shm cache which is broken in 
apache 2.0
The problem are:
 
shm file is unique for all httpd
-> i created a directive to specify a filename - creating default if not.

shm is initialized in child init hook
-> i move this to post_init hook

shm, rmm pointer are global and defined in util_ldap_cache.c
-> i created st->util_ldap_shm and st->util_ldap_rmm which are per root 
server address

All allocation or free with rmm are using global address
-> i made them using st->util_ldap_shm and rmm

The first patch i sent was my debug code, this one is cleaned and 
working with me in worker and prefork mpm
I would like to know if there is a reason that util_ldap.h is in 
include/ and all util_ldap code is in modules/experimental

Regards,

Matthieu



Re: [PATCH] util_ldap_cache shm broken in apache 2.x

Posted by Estrade Matthieu <es...@ifrance.com>.
Hi joe,

First, thanks for the answer.

I based my code on two examples:
First the broken util_ldap_cache_mgr.c and i just changed util_ldap_rmm 
by st->util_ldap_rmm.
Then on ssl_scache_shmht.c uring rmm to see if i have to check what 
return apr_rmm_malloc and calloc. (it's not done)

After this, i decided to not check it directly in my util_ald_alloc 
because of the example.

Matthieu

Joe Orton wrote:

>On Tue, Jul 01, 2003 at 03:01:43PM +0200, Estrade Matthieu wrote:
>...
>  
>
>> #if APR_HAS_SHARED_MEMORY
>>-    if (util_ldap_shm) {
>>-        return (void *)apr_rmm_addr_get(util_ldap_rmm, apr_rmm_calloc(util_ldap_rmm, size));
>>+    if (st->util_ldap_shm) {
>>+        return (void *)apr_rmm_addr_get(st->util_ldap_rmm, apr_rmm_calloc(st->util_ldap_rmm, size));
>>     } else {
>>    
>>
>
>Hi Matthieu - this will still break when the shmem segment fills up, the
>code needs to check for apr_rmm_malloc/calloc returning 0.
>
>joe
>_____________________________________________________________________
>Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
>http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
>
>  
>


_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


Re: [PATCH] util_ldap_cache shm broken in apache 2.x

Posted by Joe Orton <jo...@redhat.com>.
On Tue, Jul 01, 2003 at 03:01:43PM +0200, Estrade Matthieu wrote:
...
>  #if APR_HAS_SHARED_MEMORY
> -    if (util_ldap_shm) {
> -        return (void *)apr_rmm_addr_get(util_ldap_rmm, apr_rmm_calloc(util_ldap_rmm, size));
> +    if (st->util_ldap_shm) {
> +        return (void *)apr_rmm_addr_get(st->util_ldap_rmm, apr_rmm_calloc(st->util_ldap_rmm, size));
>      } else {

Hi Matthieu - this will still break when the shmem segment fills up, the
code needs to check for apr_rmm_malloc/calloc returning 0.

joe