mirror of
https://github.com/apache/httpd.git
synced 2025-07-23 01:08:51 +00:00
mod_slotmem_shm: follow up to r1702450.
r1702450 changed the behaviour of slotmem_{create,attach}() when given given an absolute (SHM file )name. Don't mangle the SHM file name in this case, it's up to the caller to provide a unique name per call when this matters. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703149 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -112,36 +112,43 @@ static int slotmem_filenames(apr_pool_t *pool,
|
||||
const char *fname = NULL, *pname = NULL;
|
||||
|
||||
if (slotname && *slotname && strcasecmp(slotname, "none") != 0) {
|
||||
fname = slotname;
|
||||
#if SLOTMEM_UNLINK_SEMANTIC
|
||||
/* Reuse the same file name for each generation. */
|
||||
fname = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX,
|
||||
fname, DEFAULT_SLOTMEM_SUFFIX,
|
||||
NULL);
|
||||
#else
|
||||
/* Each generation needs its own file name. */
|
||||
{
|
||||
if (slotname[0] != '/') {
|
||||
#if !SLOTMEM_UNLINK_SEMANTIC
|
||||
/* Each generation needs its own file name. */
|
||||
int generation = 0;
|
||||
ap_mpm_query(AP_MPMQ_GENERATION, &generation);
|
||||
fname = apr_psprintf(pool, "%s%s_%x%s", DEFAULT_SLOTMEM_PREFIX,
|
||||
fname, generation, DEFAULT_SLOTMEM_SUFFIX);
|
||||
}
|
||||
slotname, generation, DEFAULT_SLOTMEM_SUFFIX);
|
||||
#else
|
||||
/* Reuse the same file name for each generation. */
|
||||
fname = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX,
|
||||
slotname, DEFAULT_SLOTMEM_SUFFIX,
|
||||
NULL);
|
||||
#endif
|
||||
fname = ap_runtime_dir_relative(pool, fname);
|
||||
fname = ap_runtime_dir_relative(pool, fname);
|
||||
}
|
||||
else {
|
||||
/* Don't mangle the file name if given an absolute path, it's
|
||||
* up to the caller to provide a unique name when necessary.
|
||||
*/
|
||||
fname = slotname;
|
||||
}
|
||||
|
||||
if (persistname) {
|
||||
/* Persisted file names are immutable... */
|
||||
#if SLOTMEM_UNLINK_SEMANTIC
|
||||
#if !SLOTMEM_UNLINK_SEMANTIC
|
||||
if (slotname[0] != '/') {
|
||||
pname = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX,
|
||||
slotname, DEFAULT_SLOTMEM_SUFFIX,
|
||||
DEFAULT_SLOTMEM_PERSIST_SUFFIX,
|
||||
NULL);
|
||||
pname = ap_runtime_dir_relative(pool, pname);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
pname = apr_pstrcat(pool, fname,
|
||||
DEFAULT_SLOTMEM_PERSIST_SUFFIX,
|
||||
NULL);
|
||||
#else
|
||||
pname = apr_pstrcat(pool, DEFAULT_SLOTMEM_PREFIX,
|
||||
slotname, DEFAULT_SLOTMEM_SUFFIX,
|
||||
DEFAULT_SLOTMEM_PERSIST_SUFFIX,
|
||||
NULL);
|
||||
pname = ap_runtime_dir_relative(pool, pname);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user