You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by do...@apache.org on 2001/11/29 06:45:48 UTC
cvs commit: httpd-2.0/modules/ssl mod_ssl.h ssl_engine_config.c ssl_engine_kernel.c ssl_util.c
dougm 01/11/28 21:45:48
Modified: modules/ssl mod_ssl.h ssl_engine_config.c
ssl_engine_kernel.c ssl_util.c
Log:
ssl_util_getmodconfig() and ssl_util_getmodconfig_ssl() show up high
in the gprof profile. there's no need for the "global" SSLModConfigRec
to live in the s->process->pool userdata table. we now just point the
SSLSrvConfigRec in each server_rec.module_config to the SSLModConfigRec
so we can access it directly which is much faster.
Revision Changes Path
1.47 +2 -4 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.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- mod_ssl.h 2001/11/29 05:04:22 1.46
+++ mod_ssl.h 2001/11/29 05:45:48 1.47
@@ -200,9 +200,9 @@
(SSLConnRec *)ap_get_module_config(c->conn_config, &ssl_module)
#define myConnConfigSet(c, val) \
ap_set_module_config(c->conn_config, &ssl_module, val)
-#define myModConfig(srv) (SSLModConfigRec *)ssl_util_getmodconfig(srv, "ssl_module")
#define mySrvConfig(srv) (SSLSrvConfigRec *)ap_get_module_config(srv->module_config, &ssl_module)
#define myDirConfig(req) (SSLDirConfigRec *)ap_get_module_config(req->per_dir_config, &ssl_module)
+#define myModConfig(srv) (mySrvConfig((srv)))->mc
#define myCtxVarSet(mc,num,val) mc->rCtx.pV##num = val
#define myCtxVarGet(mc,num,type) (type)(mc->rCtx.pV##num)
@@ -498,6 +498,7 @@
* and all <VirtualHost> contexts)
*/
typedef struct {
+ SSLModConfigRec *mc;
const char *szVHostID;
int nVHostID_length;
BOOL bEnabled;
@@ -750,8 +751,5 @@
char *ssl_util_algotypestr(ssl_algo_t);
char *ssl_util_ptxtsub(apr_pool_t *, const char *, const char *, char *);
void ssl_util_thread_setup(server_rec *, apr_pool_t *);
-apr_status_t ssl_util_setmodconfig(server_rec *, const char *, SSLModConfigRec *);
-SSLModConfigRec *ssl_util_getmodconfig(server_rec *, const char *);
-SSLModConfigRec *ssl_util_getmodconfig_ssl(SSL *, const char *);
#endif /* __MOD_SSL_H__ */
1.19 +6 -2 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.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ssl_engine_config.c 2001/11/29 00:07:10 1.18
+++ ssl_engine_config.c 2001/11/29 05:45:48 1.19
@@ -107,9 +107,13 @@
(void)memset(mc->pTmpKeys, 0, SSL_TKPIDX_MAX*sizeof(void *));
/*
- * And push it into Apache's global context
+ * And push it into Apache's server config recs
*/
- ssl_util_setmodconfig(s, "ssl_module", mc);
+ while (s) {
+ SSLSrvConfigRec *sc = mySrvConfig(s);
+ sc->mc = mc;
+ s = s->next;
+ }
}
return;
}
1.32 +4 -2 httpd-2.0/modules/ssl/ssl_engine_kernel.c
Index: ssl_engine_kernel.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_kernel.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ssl_engine_kernel.c 2001/11/28 04:24:07 1.31
+++ ssl_engine_kernel.c 2001/11/29 05:45:48 1.32
@@ -1170,7 +1170,8 @@
*/
RSA *ssl_callback_TmpRSA(SSL *pSSL, int nExport, int nKeyLen)
{
- SSLModConfigRec *mc = ssl_util_getmodconfig_ssl(pSSL, "ssl_module");
+ conn_rec *c = (conn_rec *)SSL_get_app_data(pSSL);
+ SSLModConfigRec *mc = myModConfig(c->base_server);
RSA *rsa;
rsa = NULL;
@@ -1196,7 +1197,8 @@
*/
DH *ssl_callback_TmpDH(SSL *pSSL, int nExport, int nKeyLen)
{
- SSLModConfigRec *mc = ssl_util_getmodconfig_ssl(pSSL, "ssl_module");
+ conn_rec *c = (conn_rec *)SSL_get_app_data(pSSL);
+ SSLModConfigRec *mc = myModConfig(c->base_server);
DH *dh;
dh = NULL;
1.22 +0 -29 httpd-2.0/modules/ssl/ssl_util.c
Index: ssl_util.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_util.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ssl_util.c 2001/11/20 22:23:51 1.21
+++ ssl_util.c 2001/11/29 05:45:48 1.22
@@ -305,35 +305,6 @@
return cpResult;
}
-apr_status_t ssl_util_setmodconfig(server_rec *s, const char *key,
- SSLModConfigRec *mc)
-{
- return apr_pool_userdata_set((void *)mc, key, apr_pool_cleanup_null,
- s->process->pool);
-}
-
-SSLModConfigRec *ssl_util_getmodconfig(server_rec *s, const char *key)
-{
- SSLModConfigRec *mc = NULL;
-
- if (apr_pool_userdata_get((void **)&mc, key, s->process->pool)
- != APR_SUCCESS) {
- ssl_log(s, SSL_LOG_TRACE,
- "Unable to retrieve SSLModConfig from global pool");
- }
- return mc;
-}
-
-SSLModConfigRec *ssl_util_getmodconfig_ssl(SSL *ssl, const char *key)
-{
- conn_rec *c = (conn_rec *)SSL_get_app_data(ssl);
- SSLModConfigRec *mc = NULL;
-
- if (c != NULL)
- mc = ssl_util_getmodconfig(c->base_server, key);
- return mc;
-}
-
#if APR_HAS_THREADS
/*
* To ensure thread-safetyness in OpenSSL - work in progress