From 60eda291ab17161806dec9b1b5f4661baa929f7d Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 28 Mar 2003 00:43:26 +0000 Subject: [PATCH] Per JimJ's review - we prefer posix over semv, fcntl over flock, and semv requires no file. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99100 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_engine_config.c | 54 ++++++++++++--------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index f9ceb41315..6b4e87eed2 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -405,55 +405,39 @@ const char *ssl_cmd_SSLMutex(cmd_parms *cmd, if (!strcasecmp(meth, "default") || !strcasecmp(meth, "yes")) { mc->nMutexMech = APR_LOCK_DEFAULT; } -#if APR_HAS_FLOCK_SERIALIZE - else if (!strcasecmp(meth, "flock") && file) { - mc->nMutexMech = APR_LOCK_FLOCK; - } -#endif #if APR_HAS_FCNTL_SERIALIZE - else if (!strcasecmp(meth, "fcntl") && file) { + else if ((!strcasecmp(meth, "fcntl") || !strcasecmp(meth, "file")) && file) { mc->nMutexMech = APR_LOCK_FCNTL; } #endif -#if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM) - else if (!strcasecmp(meth, "sysvsem") && file) { - mc->nMutexMech = APR_LOCK_SYSVSEM; +#if APR_HAS_FLOCK_SERIALIZE + else if ((!strcasecmp(meth, "flock") || !strcasecmp(meth, "file")) && file) { + mc->nMutexMech = APR_LOCK_FLOCK; } #endif #if APR_HAS_POSIXSEM_SERIALIZE - else if (!strcasecmp(meth, "posixsem")) { + else if (!strcasecmp(meth, "posixsem") || !strcasecmp(meth, "sem")) { mc->nMutexMech = APR_LOCK_POSIXSEM; - mc->szMutexFile = apr_pstrdup(cmd->server->process->pool, file); - file = NULL; + /* Posix/SysV semaphores aren't file based, use the literal name + * if provided and fall back on APR's default if not. Today, APR + * will ignore it, but once supported it has an absurdly short limit. + */ + if (file) { + mc->szMutexFile = apr_pstrdup(cmd->server->process->pool, file); + + file = NULL; + } + } +#endif +#if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM) + else if (!strcasecmp(meth, "sysvsem") || !strcasecmp(meth, "sem")) { + mc->nMutexMech = APR_LOCK_SYSVSEM; } #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE else if (!strcasecmp(meth, "pthread")) { mc->nMutexMech = APR_LOCK_PROC_PTHREAD; } -#endif -#if APR_HAS_FLOCK_SERIALIZE - else if (!strcasecmp(meth, "file") && file) { - mc->nMutexMech = APR_LOCK_FLOCK; - } -#elif APR_HAS_FCNTL_SERIALIZE - else if (!strcasecmp(meth, "file") && file) { - mc->nMutexMech = APR_LOCK_FCNTL; - } -#endif -#if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM) - else if (!strcasecmp(meth, "sem")) { - mc->nMutexMech = APR_LOCK_SYSVSEM; - } -#elif APR_HAS_POSIXSEM_SERIALIZE - else if (!strcasecmp(meth, "sem")) { - mc->nMutexMech = APR_LOCK_POSIXSEM; - /* Posix/SysV semaphores aren't file based, use the literal name - * if provided and fall back on APR's default if not. - */ - mc->szMutexFile = apr_pstrdup(cmd->server->process->pool, file); - file = NULL; - } #endif else { return apr_pstrcat(cmd->pool, "Invalid SSLMutex argument ", arg_, -- 2.40.0