Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix am_mod_cfg_rec not being reused.(#36) #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions auth_mellon_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2207,14 +2207,14 @@ void *auth_mellon_server_config(apr_pool_t *p, server_rec *s)
/* we want to keeep our global configuration of shared memory and
* mutexes, so we try to find it in the userdata before doing anything
* else */
apr_pool_userdata_get((void **)&mod, key, p);
apr_pool_userdata_get((void **)&mod, key, s->process->pool);
if (mod) {
srv->mc = mod;
return srv;
}

/* the module has not been initiated at all */
mod = apr_palloc(p, sizeof(*mod));
mod = apr_palloc(s->process->pool, sizeof(*mod));

mod->cache_size = 100; /* ought to be enough for everybody */
mod->lock_file = "/var/run/mod_auth_mellon.lock";
Expand All @@ -2232,7 +2232,7 @@ void *auth_mellon_server_config(apr_pool_t *p, server_rec *s)
mod->cache = NULL;
mod->lock = NULL;

apr_pool_userdata_set(mod, key, apr_pool_cleanup_null, p);
apr_pool_userdata_set(mod, key, apr_pool_cleanup_null, s->process->pool);

srv->mc = mod;

Expand Down
6 changes: 3 additions & 3 deletions mod_auth_mellon.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int am_global_init(apr_pool_t *conf, apr_pool_t *log,
* initialized.
*/
mod->init_cache_size = mod->cache_size;
mod->init_lock_file = apr_pstrdup(conf, mod->lock_file);
mod->init_lock_file = apr_pstrdup(s->process->pool, mod->lock_file);
mod->init_entry_size = mod->entry_size;
if (mod->init_entry_size < AM_CACHE_MIN_ENTRY_SIZE) {
mod->init_entry_size = AM_CACHE_MIN_ENTRY_SIZE;
Expand All @@ -100,7 +100,7 @@ static int am_global_init(apr_pool_t *conf, apr_pool_t *log,


/* Create the shared memory, exit if it fails. */
rv = apr_shm_create(&(mod->cache), mem_size, NULL, conf);
rv = apr_shm_create(&(mod->cache), mem_size, NULL, s->process->pool);

if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
Expand All @@ -117,7 +117,7 @@ static int am_global_init(apr_pool_t *conf, apr_pool_t *log,
rv = apr_global_mutex_create(&(mod->lock),
mod->init_lock_file,
APR_LOCK_DEFAULT,
conf);
s->process->pool);

if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
Expand Down