httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r545610 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_kernel.c ssl_private.h ssl_scache.c ssl_scache_dbm.c
Date Fri, 08 Jun 2007 20:18:18 GMT
Author: pquerna
Date: Fri Jun  8 13:18:17 2007
New Revision: 545610

URL: http://svn.apache.org/viewvc?view=rev&rev=545610
Log:
For the DBM SSL Session Cache, propogate down pools to use for allocations.  In most cases,
we can use the conn_rec::pool, but for ssl_callback_DelSessionCacheEntry, we still use the
long lived configuration pool, but this change at least makes it easier to fix in the future.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
    httpd/httpd/trunk/modules/ssl/ssl_private.h
    httpd/httpd/trunk/modules/ssl/ssl_scache.c
    httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c?view=diff&rev=545610&r1=545609&r2=545610
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c Fri Jun  8 13:18:17 2007
@@ -1638,7 +1638,7 @@
 
     timeout += modssl_session_get_time(session);
 
-    rc = ssl_scache_store(s, id, idlen, timeout, session);
+    rc = ssl_scache_store(s, id, idlen, timeout, session, conn->pool);
 
     ssl_session_log(s, "SET", id, idlen,
                     rc == TRUE ? "OK" : "BAD",
@@ -1716,7 +1716,8 @@
     id = SSL_SESSION_get_session_id(session);
     idlen = SSL_SESSION_get_session_id_length(session);
 
-    ssl_scache_remove(s, id, idlen);
+    /* TODO: Do we need a temp pool here, or are we always shutting down? */
+    ssl_scache_remove(s, id, idlen, sc->mc->pPool);
 
     ssl_session_log(s, "REM", id, idlen,
                     "OK", "dead", 0);

Modified: httpd/httpd/trunk/modules/ssl/ssl_private.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_private.h?view=diff&rev=545610&r1=545609&r2=545610
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_private.h (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_private.h Fri Jun  8 13:18:17 2007
@@ -575,17 +575,22 @@
 void         ssl_scache_init(server_rec *, apr_pool_t *);
 void         ssl_scache_status_register(apr_pool_t *p);
 void         ssl_scache_kill(server_rec *);
-BOOL         ssl_scache_store(server_rec *, UCHAR *, int, time_t, SSL_SESSION *);
+BOOL         ssl_scache_store(server_rec *, UCHAR *, int,
+                              time_t, SSL_SESSION *, apr_pool_t *);
 SSL_SESSION *ssl_scache_retrieve(server_rec *, UCHAR *, int, apr_pool_t *);
-void         ssl_scache_remove(server_rec *, UCHAR *, int);
+void         ssl_scache_remove(server_rec *, UCHAR *, int,
+                               apr_pool_t *);
 
 char        *ssl_scache_id2sz(UCHAR *, int);
 void         ssl_scache_dbm_init(server_rec *, apr_pool_t *);
 void         ssl_scache_dbm_kill(server_rec *);
-BOOL         ssl_scache_dbm_store(server_rec *, UCHAR *, int, time_t, SSL_SESSION *);
-SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *, UCHAR *, int);
-void         ssl_scache_dbm_remove(server_rec *, UCHAR *, int);
-void         ssl_scache_dbm_status(request_rec *r, int flags, apr_pool_t *pool);
+BOOL         ssl_scache_dbm_store(server_rec *, UCHAR *, int,
+                                  time_t, SSL_SESSION *, apr_pool_t *);
+SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *, UCHAR *, int,
+                                     apr_pool_t *);
+void         ssl_scache_dbm_remove(server_rec *, UCHAR *, int,
+                                   apr_pool_t *);
+void         ssl_scache_dbm_status(request_rec *r, int flags, apr_pool_t *);
 
 void         ssl_scache_shmcb_init(server_rec *, apr_pool_t *);
 void         ssl_scache_shmcb_kill(server_rec *);

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_scache.c?view=diff&rev=545610&r1=545609&r2=545610
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache.c Fri Jun  8 13:18:17 2007
@@ -96,13 +96,15 @@
     return;
 }
 
-BOOL ssl_scache_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SSL_SESSION *sess)
+BOOL ssl_scache_store(server_rec *s, UCHAR *id, int idlen,
+                      time_t expiry, SSL_SESSION *sess,
+                      apr_pool_t *p)
 {
     SSLModConfigRec *mc = myModConfig(s);
     BOOL rv = FALSE;
 
     if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
-        rv = ssl_scache_dbm_store(s, id, idlen, expiry, sess);
+        rv = ssl_scache_dbm_store(s, id, idlen, expiry, sess, p);
     else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)
         rv = ssl_scache_shmcb_store(s, id, idlen, expiry, sess);
 #ifdef HAVE_DISTCACHE
@@ -123,7 +125,7 @@
     SSL_SESSION *sess = NULL;
 
     if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
-        sess = ssl_scache_dbm_retrieve(s, id, idlen);
+        sess = ssl_scache_dbm_retrieve(s, id, idlen, p);
     else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)
         sess = ssl_scache_shmcb_retrieve(s, id, idlen);
 #ifdef HAVE_DISTCACHE
@@ -137,12 +139,13 @@
     return sess;
 }
 
-void ssl_scache_remove(server_rec *s, UCHAR *id, int idlen)
+void ssl_scache_remove(server_rec *s, UCHAR *id, int idlen,
+                       apr_pool_t *p)
 {
     SSLModConfigRec *mc = myModConfig(s);
 
     if (mc->nSessionCacheMode == SSL_SCMODE_DBM)
-        ssl_scache_dbm_remove(s, id, idlen);
+        ssl_scache_dbm_remove(s, id, idlen, p);
     else if (mc->nSessionCacheMode == SSL_SCMODE_SHMCB)
         ssl_scache_shmcb_remove(s, id, idlen);
 #ifdef HAVE_DISTCACHE

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c?view=diff&rev=545610&r1=545609&r2=545610
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c Fri Jun  8 13:18:17 2007
@@ -102,7 +102,9 @@
     return;
 }
 
-BOOL ssl_scache_dbm_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SSL_SESSION
*sess)
+BOOL ssl_scache_dbm_store(server_rec *s, UCHAR *id, int idlen,
+                          time_t expiry, SSL_SESSION *sess,
+                          apr_pool_t *p)
 {
     SSLModConfigRec *mc = myModConfig(s);
     apr_dbm_t *dbm;
@@ -159,7 +161,7 @@
     /* and store it to the DBM file */
     ssl_mutex_on(s);
     if ((rv = apr_dbm_open(&dbm, mc->szSessionCacheDataFile,
-            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, mc->pPool)) != APR_SUCCESS) {
+            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
                      "Cannot open SSLSessionCache DBM file `%s' for writing "
                      "(store)",
@@ -189,7 +191,8 @@
     return TRUE;
 }
 
-SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *s, UCHAR *id, int idlen)
+SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *s, UCHAR *id, int idlen,
+                                     apr_pool_t *p)
 {
     SSLModConfigRec *mc = myModConfig(s);
     apr_dbm_t *dbm;
@@ -215,7 +218,7 @@
      */
     ssl_mutex_on(s);
     if ((rc = apr_dbm_open(&dbm, mc->szSessionCacheDataFile,
-            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, mc->pPool)) != APR_SUCCESS) {
+            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
                      "Cannot open SSLSessionCache DBM file `%s' for reading "
                      "(fetch)",
@@ -254,7 +257,7 @@
     /* make sure the stuff is still not expired */
     now = time(NULL);
     if (expiry <= now) {
-        ssl_scache_dbm_remove(s, id, idlen);
+        ssl_scache_dbm_remove(s, id, idlen, p);
         return NULL;
     }
 
@@ -264,7 +267,8 @@
     return sess;
 }
 
-void ssl_scache_dbm_remove(server_rec *s, UCHAR *id, int idlen)
+void ssl_scache_dbm_remove(server_rec *s, UCHAR *id, int idlen,
+                           apr_pool_t *p)
 {
     SSLModConfigRec *mc = myModConfig(s);
     apr_dbm_t *dbm;
@@ -278,7 +282,7 @@
     /* and delete it from the DBM file */
     ssl_mutex_on(s);
     if ((rv = apr_dbm_open(&dbm, mc->szSessionCacheDataFile,
-            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, mc->pPool)) != APR_SUCCESS) {
+            APR_DBM_RWCREATE, SSL_DBM_FILE_MODE, p)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
                      "Cannot open SSLSessionCache DBM file `%s' for writing "
                      "(delete)",



Mime
View raw message