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 2002/03/10 01:22:07 UTC
cvs commit: httpd-2.0/modules/ssl mod_ssl.c ssl_engine_kernel.c ssl_engine_vars.c
dougm 02/03/09 16:22:07
Modified: modules/ssl mod_ssl.c ssl_engine_kernel.c ssl_engine_vars.c
Log:
don't allocate SSLConnRec unless ssl is enabled on this vhost.
also provides a shorter shortcut for mod_ssl hooks to decline if ssl
is not enabled.
Revision Changes Path
1.46 +8 -7 httpd-2.0/modules/ssl/mod_ssl.c
Index: mod_ssl.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- mod_ssl.c 27 Feb 2002 19:51:33 -0000 1.45
+++ mod_ssl.c 10 Mar 2002 00:22:07 -0000 1.46
@@ -224,19 +224,20 @@
SSLSrvConfigRec *sc = mySrvConfig(c->base_server);
SSL *ssl;
char *cpVHostMD5;
- SSLConnRec *sslconn = apr_pcalloc(c->pool, sizeof(*sslconn));
-
- /*
- * Create SSL context
- */
- myConnConfigSet(c, sslconn);
- sslconn->log_level = sc->nLogLevel;
+ SSLConnRec *sslconn;
/*
* Immediately stop processing if SSL is disabled for this connection
*/
if (sc == NULL || !sc->bEnabled)
return DECLINED;
+
+ /*
+ * Create SSL context
+ */
+ sslconn = apr_pcalloc(c->pool, sizeof(*sslconn));
+ myConnConfigSet(c, sslconn);
+ sslconn->log_level = sc->nLogLevel;
/*
* Remember the connection information for
1.43 +6 -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.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- ssl_engine_kernel.c 25 Feb 2002 04:23:03 -0000 1.42
+++ ssl_engine_kernel.c 10 Mar 2002 00:22:07 -0000 1.43
@@ -171,6 +171,10 @@
SSLConnRec *sslconn = myConnConfig(r->connection);
SSL *ssl;
+ if (!sslconn) {
+ return DECLINED;
+ }
+
/*
* Get the SSL connection structure and perform the
* delayed interlinking from SSL back to request_rec
@@ -233,7 +237,7 @@
{
SSLConnRec *sslconn = myConnConfig(r->connection);
- if (sslconn->ssl == NULL)
+ if (!sslconn || !sslconn->ssl)
return DECLINED;
/*
@@ -332,7 +336,7 @@
dc = myDirConfig(r);
sc = mySrvConfig(r->server);
sslconn = myConnConfig(r->connection);
- ssl = sslconn->ssl;
+ ssl = sslconn ? sslconn->ssl : NULL;
if (ssl != NULL)
ctx = SSL_get_SSL_CTX(ssl);
1.13 +1 -1 httpd-2.0/modules/ssl/ssl_engine_vars.c
Index: ssl_engine_vars.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_vars.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ssl_engine_vars.c 17 Jan 2002 04:03:09 -0000 1.12
+++ ssl_engine_vars.c 10 Mar 2002 00:22:07 -0000 1.13
@@ -679,7 +679,7 @@
char *result;
result = NULL;
- if (sslconn->ssl != NULL)
+ if (sslconn && sslconn->ssl)
result = ssl_var_lookup(r->pool, r->server, r->connection, r, a);
if (result != NULL && result[0] == NUL)
result = NULL;