mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Add support for distributed caching of SSL Sessions inside memcached, using apr_memcache, which is present in APR-Util 1.3/trunk.
This was originally written at ApacheCon US 2005 (San Diego), and was sent to the list: http://mail-archives.apache.org/mod_mbox/httpd-dev/200512.mbox/%3C439C6C07.9030904@force-elite.com%3E This version is slightly cleaned up, and of course, uses the now bundled apr_memcache, rather than an external dependency. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@545379 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -58,6 +58,10 @@ void ssl_scache_init(server_rec *s, apr_pool_t *p)
|
||||
#ifdef HAVE_DISTCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
ssl_scache_dc_init(s, p);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
ssl_scache_mc_init(s, p);
|
||||
#endif
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) {
|
||||
void *data;
|
||||
@@ -84,6 +88,10 @@ void ssl_scache_kill(server_rec *s)
|
||||
#ifdef HAVE_DISTCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
ssl_scache_dc_kill(s);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
ssl_scache_mc_kill(s);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -100,6 +108,10 @@ BOOL ssl_scache_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SSL_SE
|
||||
#ifdef HAVE_DISTCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
rv = ssl_scache_dc_store(s, id, idlen, expiry, sess);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
rv = ssl_scache_mc_store(s, id, idlen, expiry, sess);
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
@@ -116,6 +128,10 @@ SSL_SESSION *ssl_scache_retrieve(server_rec *s, UCHAR *id, int idlen)
|
||||
#ifdef HAVE_DISTCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
sess = ssl_scache_dc_retrieve(s, id, idlen);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
sess = ssl_scache_mc_retrieve(s, id, idlen);
|
||||
#endif
|
||||
return sess;
|
||||
}
|
||||
@@ -131,6 +147,10 @@ void ssl_scache_remove(server_rec *s, UCHAR *id, int idlen)
|
||||
#ifdef HAVE_DISTCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
ssl_scache_dc_remove(s, id, idlen);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
ssl_scache_mc_remove(s, id, idlen);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -162,6 +182,10 @@ static int ssl_ext_status_hook(request_rec *r, int flags)
|
||||
else if (sc->mc->nSessionCacheMode == SSL_SCMODE_DC)
|
||||
ssl_scache_dc_status(r, flags, r->pool);
|
||||
#endif
|
||||
#ifdef HAVE_SSL_CACHE_MEMCACHE
|
||||
else if (sc->mc->nSessionCacheMode == SSL_SCMODE_MC)
|
||||
ssl_scache_mc_status(r, flags, r->pool);
|
||||
#endif
|
||||
|
||||
ap_rputs("</td></tr>\n", r);
|
||||
ap_rputs("</table>\n", r);
|
||||
|
Reference in New Issue
Block a user