diff options
author | Doug MacEachern <dougm@apache.org> | 2002-03-15 00:31:23 +0100 |
---|---|---|
committer | Doug MacEachern <dougm@apache.org> | 2002-03-15 00:31:23 +0100 |
commit | 97b148c3b51dd80bff9008f68191aa392ad06a5a (patch) | |
tree | feb6e59615e6fec5372da19d6772d55fc3a34e3e /modules/ssl/ssl_scache.c | |
parent | FYI... (diff) | |
download | apache2-97b148c3b51dd80bff9008f68191aa392ad06a5a.tar.xz apache2-97b148c3b51dd80bff9008f68191aa392ad06a5a.zip |
PR:
Obtained from:
Submitted by: Madhusudan Mathihalli <madhusudan_mathihalli@hp.com>
Reviewed by: dougm
implement SSLSessionCache shmht and shmcb based on apr_rmm and apr_shm
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93942 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl/ssl_scache.c')
-rw-r--r-- | modules/ssl/ssl_scache.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/modules/ssl/ssl_scache.c b/modules/ssl/ssl_scache.c index b945ff64f7..839add7a62 100644 --- a/modules/ssl/ssl_scache.c +++ b/modules/ssl/ssl_scache.c @@ -75,12 +75,22 @@ void ssl_scache_init(server_rec *s, apr_pool_t *p) if (mc->nSessionCacheMode == SSL_SCMODE_DBM) ssl_scache_dbm_init(s, p); -#if 0 /* XXX */ - else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) - ssl_scache_shmht_init(s, p); - else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) - ssl_scache_shmcb_init(s, p); -#endif + else if ((mc->nSessionCacheMode == SSL_SCMODE_SHMHT) || + (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)) { + void *data; + const char *userdata_key = "ssl_scache_init"; + + apr_pool_userdata_get(&data, userdata_key, s->process->pool); + if (!data) { + apr_pool_userdata_setn((const void *)1, userdata_key, + apr_pool_cleanup_null, s->process->pool); + return; + } + if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) + ssl_scache_shmht_init(s, p); + else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) + ssl_scache_shmcb_init(s, p); + } return; } @@ -90,12 +100,10 @@ void ssl_scache_kill(server_rec *s) if (mc->nSessionCacheMode == SSL_SCMODE_DBM) ssl_scache_dbm_kill(s); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) ssl_scache_shmht_kill(s); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) ssl_scache_shmcb_kill(s); -#endif return; } @@ -106,12 +114,10 @@ BOOL ssl_scache_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SSL_SE if (mc->nSessionCacheMode == SSL_SCMODE_DBM) rv = ssl_scache_dbm_store(s, id, idlen, expiry, sess); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) rv = ssl_scache_shmht_store(s, id, idlen, expiry, sess); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) rv = ssl_scache_shmcb_store(s, id, idlen, expiry, sess); -#endif return rv; } @@ -122,12 +128,10 @@ SSL_SESSION *ssl_scache_retrieve(server_rec *s, UCHAR *id, int idlen) if (mc->nSessionCacheMode == SSL_SCMODE_DBM) sess = ssl_scache_dbm_retrieve(s, id, idlen); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) sess = ssl_scache_shmht_retrieve(s, id, idlen); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) sess = ssl_scache_shmcb_retrieve(s, id, idlen); -#endif return sess; } @@ -137,12 +141,10 @@ void ssl_scache_remove(server_rec *s, UCHAR *id, int idlen) if (mc->nSessionCacheMode == SSL_SCMODE_DBM) ssl_scache_dbm_remove(s, id, idlen); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) ssl_scache_shmht_remove(s, id, idlen); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) ssl_scache_shmcb_remove(s, id, idlen); -#endif return; } @@ -152,12 +154,10 @@ void ssl_scache_status(server_rec *s, apr_pool_t *p, void (*func)(char *, void * if (mc->nSessionCacheMode == SSL_SCMODE_DBM) ssl_scache_dbm_status(s, p, func, arg); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) ssl_scache_shmht_status(s, p, func, arg); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) ssl_scache_shmcb_status(s, p, func, arg); -#endif return; } @@ -167,12 +167,10 @@ void ssl_scache_expire(server_rec *s) if (mc->nSessionCacheMode == SSL_SCMODE_DBM) ssl_scache_dbm_expire(s); -#if 0 /* XXX */ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT) ssl_scache_shmht_expire(s); else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) ssl_scache_shmcb_expire(s); -#endif return; } |