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 2011/04/03 15:36:25 UTC

Re: svn commit: r1087862 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c


On 04/01/2011 09:25 PM, jim@apache.org wrote:
> Author: jim
> Date: Fri Apr  1 19:25:19 2011
> New Revision: 1087862
> 
> URL: http://svn.apache.org/viewvc?rev=1087862&view=rev
> Log:
> More cleanups at cleanup... move to using pconf and then remove
> any file-based shms
> 
> Modified:
>     httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
> 
> Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=1087862&r1=1087861&r2=1087862&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
> +++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Fri Apr  1 19:25:19 2011
> @@ -57,6 +57,7 @@ typedef struct {
>  
>  struct ap_slotmem_instance_t {
>      char                 *name;       /* per segment name */
> +    int                  fbased;      /* filebased? */
>      void                 *shm;        /* ptr to memory segment (apr_shm_t *) */
>      void                 *base;       /* data set start */
>      apr_pool_t           *gpool;      /* per segment global pool */
> @@ -211,12 +212,15 @@ static apr_status_t cleanup_slotmem(void
>              if (AP_SLOTMEM_IS_PERSIST(next)) {
>                  store_slotmem(next);
>              }
> +            if (next->fbased) {
> +                apr_shm_remove(next->name, next->gpool);
> +            }

Why is this needed? Doesn't do apr_shm_destroy this automatically?

> @@ -436,6 +443,7 @@ static apr_status_t slotmem_attach(ap_sl
>      res = (ap_slotmem_instance_t *) apr_pcalloc(gpool,
>                                                  sizeof(ap_slotmem_instance_t));
>      res->name = apr_pstrdup(gpool, fname);
> +    res->fbased = 1;

Why is this always fbased?

Regards

RĂ¼diger

Re: svn commit: r1087862 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c

Posted by Jim Jagielski <ji...@apache.org>.
On Apr 3, 2011, at 9:36 AM, Ruediger Pluem wrote:

>> @@ -436,6 +443,7 @@ static apr_status_t slotmem_attach(ap_sl
>>     res = (ap_slotmem_instance_t *) apr_pcalloc(gpool,
>>                                                 sizeof(ap_slotmem_instance_t));
>>     res->name = apr_pstrdup(gpool, fname);
>> +    res->fbased = 1;
> 

Basically, fbased is simply a flag to determine whether or
not the apr_shm_create() used a real name or NULL.