mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
The mutex must be pool-managed, not ssl managed. We are encountering
segfaults on Win32 when the cleanup of the mutex occurs after the pool was destroyed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92818 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -733,7 +733,6 @@ int ssl_mutex_init(server_rec *, apr_pool_t *);
|
|||||||
int ssl_mutex_reinit(server_rec *, apr_pool_t *);
|
int ssl_mutex_reinit(server_rec *, apr_pool_t *);
|
||||||
int ssl_mutex_on(server_rec *);
|
int ssl_mutex_on(server_rec *);
|
||||||
int ssl_mutex_off(server_rec *);
|
int ssl_mutex_off(server_rec *);
|
||||||
int ssl_mutex_kill(server_rec *);
|
|
||||||
|
|
||||||
/* Logfile Support */
|
/* Logfile Support */
|
||||||
void ssl_log_open(server_rec *, server_rec *, apr_pool_t *);
|
void ssl_log_open(server_rec *, server_rec *, apr_pool_t *);
|
||||||
|
@@ -970,9 +970,9 @@ void ssl_init_Child(apr_pool_t *p, server_rec *s)
|
|||||||
/* XXX: there should be an ap_srand() function */
|
/* XXX: there should be an ap_srand() function */
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
|
|
||||||
/* open the mutex lockfile */
|
/* open the mutex lockfile */
|
||||||
ssl_mutex_reinit(s, p);
|
ssl_mutex_reinit(s, p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
apr_status_t ssl_init_ChildKill(void *data)
|
apr_status_t ssl_init_ChildKill(void *data)
|
||||||
@@ -992,8 +992,6 @@ apr_status_t ssl_init_ModuleKill(void *data)
|
|||||||
*/
|
*/
|
||||||
ssl_scache_kill(s);
|
ssl_scache_kill(s);
|
||||||
|
|
||||||
ssl_mutex_kill(s);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Destroy the temporary keys and params
|
* Destroy the temporary keys and params
|
||||||
*/
|
*/
|
||||||
|
@@ -68,6 +68,7 @@ int ssl_mutex_init(server_rec *s, apr_pool_t *p)
|
|||||||
|
|
||||||
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
|
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT,
|
if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT,
|
||||||
mc->szMutexFile, p) != APR_SUCCESS)
|
mc->szMutexFile, p) != APR_SUCCESS)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -80,6 +81,7 @@ int ssl_mutex_reinit(server_rec *s, apr_pool_t *p)
|
|||||||
|
|
||||||
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
|
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (apr_lock_child_init(&mc->pMutex, mc->szMutexFile, p) != APR_SUCCESS)
|
if (apr_lock_child_init(&mc->pMutex, mc->szMutexFile, p) != APR_SUCCESS)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -111,18 +113,3 @@ int ssl_mutex_off(server_rec *s)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ssl_mutex_kill(server_rec *s)
|
|
||||||
{
|
|
||||||
SSLModConfigRec *mc = myModConfig(s);
|
|
||||||
|
|
||||||
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
|
|
||||||
return TRUE;
|
|
||||||
/* XXX: currently mutex is not created until 2nd pass at startup */
|
|
||||||
if (!mc->pMutex)
|
|
||||||
return TRUE;
|
|
||||||
if (apr_lock_destroy(mc->pMutex) != APR_SUCCESS)
|
|
||||||
return FALSE;
|
|
||||||
mc->pMutex = NULL;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user