You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2003/11/25 16:46:37 UTC
cvs commit: httpd-2.0/modules/ssl config.m4 mod_ssl.dsp mod_ssl.h ssl_engine_config.c ssl_scache.c ssl_scache_shmcb.c ssl_scache_shmht.c ssl_util_table.c ssl_util_table.h
jorton 2003/11/25 07:46:37
Modified: . CHANGES
modules/ssl config.m4 mod_ssl.dsp mod_ssl.h
ssl_engine_config.c ssl_scache.c ssl_scache_shmcb.c
Removed: modules/ssl ssl_scache_shmht.c ssl_util_table.c
ssl_util_table.h
Log:
Remove shmht session cache in favour of shmcb; shmht has had
data corruption bugs since being apr_rmm'ified.
* config.m4, mod_ssl.dsp: Don't build ssl_util_table and
ssl_scache_shmht.
* ssl_util_table.h, ssl_util_table.c, ssl_scache_shmht.c: Removed
files.
* mod_ssl.h (SSLModConfigRec): Use a void * pointer for storing
the scache-specific data.
* ssl_engine_config.c (ssl_cmd_SSLSessionCache): Treat shmht: as
shmcb:.
* ssl_scache.c: Remove shmht hooks throughout.
* ssl_scache_shmcb.c: Remove casts to use the table_t * pointer as a
void *.
Revision Changes Path
1.1326 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1325
retrieving revision 1.1326
diff -u -u -r1.1325 -r1.1326
--- CHANGES 25 Nov 2003 12:46:32 -0000 1.1325
+++ CHANGES 25 Nov 2003 15:46:36 -0000 1.1326
@@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) mod_ssl: Remove the shmht session cache, shmcb should be used
+ instead. [Joe Orton]
+
*) mod_ssl: SSL_VERSION_LIBRARY is set to the version string from the
SSL library used at run-time, rather than at compile-time.
PR: 23956 [Eric Seidel <eseidel apple.com>]
1.18 +0 -2 httpd-2.0/modules/ssl/config.m4
Index: config.m4
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/config.m4,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -u -r1.17 -r1.18
--- config.m4 27 May 2003 19:28:39 -0000 1.17
+++ config.m4 25 Nov 2003 15:46:36 -0000 1.18
@@ -69,10 +69,8 @@
ssl_scache.lo dnl
ssl_scache_dbm.lo dnl
ssl_scache_shmcb.lo dnl
-ssl_scache_shmht.lo dnl
ssl_util.lo dnl
ssl_util_ssl.lo dnl
-ssl_util_table.lo dnl
"
dnl # hook module into the Autoconf mechanism (--enable-ssl option)
APACHE_MODULE(ssl, [SSL/TLS support (mod_ssl)], $ssl_objs, , no, [
1.25 +0 -9 httpd-2.0/modules/ssl/mod_ssl.dsp
Index: mod_ssl.dsp
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.dsp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -u -r1.24 -r1.25
--- mod_ssl.dsp 8 Sep 2003 16:03:49 -0000 1.24
+++ mod_ssl.dsp 25 Nov 2003 15:46:36 -0000 1.25
@@ -164,10 +164,6 @@
# End Source File
# Begin Source File
-SOURCE=.\ssl_scache_shmht.c
-# End Source File
-# Begin Source File
-
SOURCE=.\ssl_util.c
# End Source File
# Begin Source File
@@ -175,11 +171,6 @@
SOURCE=.\ssl_util_ssl.c
# End Source File
# Begin Source File
-
-SOURCE=.\ssl_util_table.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
# PROP Default_Filter "*.h"
# Begin Source File
1.140 +1 -3 httpd-2.0/modules/ssl/mod_ssl.h
Index: mod_ssl.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.h,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -u -r1.139 -r1.140
--- mod_ssl.h 12 Aug 2003 20:58:53 -0000 1.139
+++ mod_ssl.h 25 Nov 2003 15:46:36 -0000 1.140
@@ -101,7 +101,6 @@
#include "ssl_toolkit_compat.h"
#include "ssl_expr.h"
#include "ssl_util_ssl.h"
-#include "ssl_util_table.h"
/* The #ifdef macros are only defined AFTER including the above
* therefore we cannot include these system files at the top :-(
@@ -307,7 +306,6 @@
SSL_SCMODE_UNSET = UNSET,
SSL_SCMODE_NONE = 0,
SSL_SCMODE_DBM = 1,
- SSL_SCMODE_SHMHT = 2,
SSL_SCMODE_SHMCB = 3
} ssl_scmode_t;
@@ -391,7 +389,7 @@
int nSessionCacheDataSize;
apr_shm_t *pSessionCacheDataMM;
apr_rmm_t *pSessionCacheDataRMM;
- apr_table_t *tSessionCacheDataTable;
+ void *tSessionCacheDataTable;
ssl_mutexmode_t nMutexMode;
apr_lockmech_e nMutexMech;
const char *szMutexFile;
1.83 +1 -41 httpd-2.0/modules/ssl/ssl_engine_config.c
Index: ssl_engine_config.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_config.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -u -r1.82 -r1.83
--- ssl_engine_config.c 12 Aug 2003 20:58:53 -0000 1.82
+++ ssl_engine_config.c 25 Nov 2003 15:46:36 -0000 1.83
@@ -1006,48 +1006,8 @@
arg+4);
}
}
- else if ((arglen > 6) && strcEQn(arg, "shmht:", 6)) {
-#if !APR_HAS_SHARED_MEMORY
- return MODSSL_NO_SHARED_MEMORY_ERROR;
-#endif
- mc->nSessionCacheMode = SSL_SCMODE_SHMHT;
- colon = ap_strchr_c(arg, ':');
- mc->szSessionCacheDataFile =
- ap_server_root_relative(mc->pPool, colon+1);
- if (!mc->szSessionCacheDataFile) {
- return apr_psprintf(cmd->pool,
- "SSLSessionCache: Invalid cache file path %s",
- colon+1);
- }
- mc->tSessionCacheDataTable = NULL;
- mc->nSessionCacheDataSize = 1024*512; /* 512KB */
-
- if ((cp = strchr(mc->szSessionCacheDataFile, '('))) {
- *cp++ = NUL;
-
- if (!(cp2 = strchr(cp, ')'))) {
- return "SSLSessionCache: Invalid argument: "
- "no closing parenthesis";
- }
-
- *cp2 = NUL;
-
- mc->nSessionCacheDataSize = atoi(cp);
-
- if (mc->nSessionCacheDataSize < 8192) {
- return "SSLSessionCache: Invalid argument: "
- "size has to be >= 8192 bytes";
- }
-
- if (mc->nSessionCacheDataSize >= APR_SHM_MAXSIZE) {
- return apr_psprintf(cmd->pool,
- "SSLSessionCache: Invalid argument: "
- "size has to be < %d bytes on this "
- "platform", APR_SHM_MAXSIZE);
- }
- }
- }
else if (((arglen > 4) && strcEQn(arg, "shm:", 4)) ||
+ ((arglen > 6) && strcEQn(arg, "shmht:", 6)) ||
((arglen > 6) && strcEQn(arg, "shmcb:", 6))) {
#if !APR_HAS_SHARED_MEMORY
return MODSSL_NO_SHARED_MEMORY_ERROR;
1.16 +2 -18 httpd-2.0/modules/ssl/ssl_scache.c
Index: ssl_scache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_scache.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -u -r1.15 -r1.16
--- ssl_scache.c 3 Feb 2003 17:53:13 -0000 1.15
+++ ssl_scache.c 25 Nov 2003 15:46:36 -0000 1.16
@@ -87,8 +87,7 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
ssl_scache_dbm_init(s, p);
- else if ((mc->nSessionCacheMode == SSL_SCMODE_SHMHT) ||
- (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)) {
+ else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB) {
void *data;
const char *userdata_key = "ssl_scache_init";
@@ -98,10 +97,7 @@
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);
+ ssl_scache_shmcb_init(s, p);
}
}
@@ -111,8 +107,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
ssl_scache_dbm_kill(s);
- else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT)
- ssl_scache_shmht_kill(s);
else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)
ssl_scache_shmcb_kill(s);
return;
@@ -125,8 +119,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
rv = ssl_scache_dbm_store(s, id, idlen, expiry, sess);
- 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);
return rv;
@@ -139,8 +131,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
sess = ssl_scache_dbm_retrieve(s, id, idlen);
- 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);
return sess;
@@ -152,8 +142,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
ssl_scache_dbm_remove(s, id, idlen);
- 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);
return;
@@ -165,8 +153,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
ssl_scache_dbm_status(s, p, func, arg);
- 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);
return;
@@ -178,8 +164,6 @@
if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
ssl_scache_dbm_expire(s);
- else if (mc->nSessionCacheMode == SSL_SCMODE_SHMHT)
- ssl_scache_shmht_expire(s);
else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)
ssl_scache_shmcb_expire(s);
return;
1.18 +7 -21 httpd-2.0/modules/ssl/ssl_scache_shmcb.c
Index: ssl_scache_shmcb.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_scache_shmcb.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -u -r1.17 -r1.18
--- ssl_scache_shmcb.c 3 Feb 2003 17:53:13 -0000 1.17
+++ ssl_scache_shmcb.c 25 Nov 2003 15:46:36 -0000 1.18
@@ -399,11 +399,9 @@
"Shared memory session cache initialised");
/*
- * Success ... we hack the memory block into place by cheating for
- * now and stealing a member variable the original shared memory
- * cache was using. :-)
+ * Success ...
*/
- mc->tSessionCacheDataTable = (table_t *) shm_segment;
+ mc->tSessionCacheDataTable = shm_segment;
return;
}
@@ -422,13 +420,11 @@
time_t timeout, SSL_SESSION * pSession)
{
SSLModConfigRec *mc = myModConfig(s);
- void *shm_segment;
BOOL to_return = FALSE;
- /* We've kludged our pointer into the other cache's member variable. */
- shm_segment = (void *) mc->tSessionCacheDataTable;
ssl_mutex_on(s);
- if (!shmcb_store_session(s, shm_segment, id, idlen, pSession, timeout))
+ if (!shmcb_store_session(s, mc->tSessionCacheDataTable, id, idlen,
+ pSession, timeout))
/* in this cache engine, "stores" should never fail. */
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
"'shmcb' code was unable to store a "
@@ -445,13 +441,10 @@
SSL_SESSION *ssl_scache_shmcb_retrieve(server_rec *s, UCHAR *id, int idlen)
{
SSLModConfigRec *mc = myModConfig(s);
- void *shm_segment;
SSL_SESSION *pSession;
- /* We've kludged our pointer into the other cache's member variable. */
- shm_segment = (void *) mc->tSessionCacheDataTable;
ssl_mutex_on(s);
- pSession = shmcb_retrieve_session(s, shm_segment, id, idlen);
+ pSession = shmcb_retrieve_session(s, mc->tSessionCacheDataTable, id, idlen);
ssl_mutex_off(s);
if (pSession)
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
@@ -469,12 +462,9 @@
void ssl_scache_shmcb_remove(server_rec *s, UCHAR *id, int idlen)
{
SSLModConfigRec *mc = myModConfig(s);
- void *shm_segment;
- /* We've kludged our pointer into the other cache's member variable. */
- shm_segment = (void *) mc->tSessionCacheDataTable;
ssl_mutex_on(s);
- shmcb_remove_session(s, shm_segment, id, idlen);
+ shmcb_remove_session(s, mc->tSessionCacheDataTable, id, idlen);
ssl_mutex_off(s);
}
@@ -492,7 +482,6 @@
SHMCBQueue queue;
SHMCBCache cache;
SHMCBIndex *idx;
- void *shm_segment;
unsigned int loop, total, cache_total, non_empty_divisions;
int index_pct, cache_pct;
double expiry_total;
@@ -501,11 +490,8 @@
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"inside ssl_scache_shmcb_status");
- /* We've kludged our pointer into the other cache's member variable. */
- shm_segment = (void *) mc->tSessionCacheDataTable;
-
/* Get the header structure. */
- shmcb_get_header(shm_segment, &header);
+ shmcb_get_header(mc->tSessionCacheDataTable, &header);
total = cache_total = non_empty_divisions = 0;
average_expiry = max_expiry = min_expiry = 0;
expiry_total = 0;