mod_slotmem_shm: follow up tp r1822509.

Do not bind attached slotmems to the global list, they should be detached with
the given pool (pchild) is cleaned up, but not destroyed/removed (doubly) with
pglobal.

[Reverted by r1831868]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823415 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2018-02-06 23:37:25 +00:00
parent 23c83331bc
commit dfc538ce4e

View File

@ -579,7 +579,7 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
}
/* next try to attach to existing shared memory */
rv = apr_shm_attach(&shm, fname, gpool);
rv = apr_shm_attach(&shm, fname, pool);
if (rv != APR_SUCCESS) {
return rv;
}
@ -589,8 +589,8 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
ptr = (char *)desc + AP_SLOTMEM_OFFSET;
/* For the chained slotmem stuff */
res = apr_pcalloc(gpool, sizeof(ap_slotmem_instance_t));
res->name = apr_pstrdup(gpool, fname);
res = apr_pcalloc(pool, sizeof(ap_slotmem_instance_t));
res->name = apr_pstrdup(pool, fname);
res->fbased = 1;
res->shm = shm;
res->persist = (void *)ptr;
@ -601,12 +601,6 @@ static apr_status_t slotmem_attach(ap_slotmem_instance_t **new,
res->pool = pool;
res->inuse = ptr + (desc->size * desc->num);
res->next = NULL;
if (globallistmem == NULL) {
globallistmem = res;
}
else {
next->next = res;
}
*new = res;
*item_size = desc->size;