httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/ssl README mod_ssl.h ssl_scache_dbm.c ssl_util_sdbm.c ssl_util_sdbm.h
Date Sat, 05 May 2001 15:26:06 GMT
rse         01/05/05 08:26:06

  Modified:    modules/ssl README mod_ssl.h ssl_scache_dbm.c
  Removed:     modules/ssl ssl_util_sdbm.c ssl_util_sdbm.h
  Log:
  Axe out SSL_USE_SDBM stuff, i.e., get rid of the local SDBM copy and use
  APR's DBM API instead. The remaining question just is whether APR's DBM
  allows "larger" things like SSL sessions to be stored...
  
  Revision  Changes    Path
  1.7       +7 -0      httpd-2.0/modules/ssl/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/README,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- README	2001/05/05 15:10:58	1.6
  +++ README	2001/05/05 15:26:06	1.7
  @@ -147,4 +147,11 @@
   
    o The complete EAPI-based SSL_VENDOR stuff was removed.
    o The complete EAPI-based SSL_COMPAT stuff was removed.
  +
  + MAJOR CHANGES 
  +
  + The following major changes were made between mod_ssl 2.x
  + from Apache 1.3 and this mod_ssl version for Apache 2.0:
  +
  + o The DBM based session cache is now based on APR's DBM API only.
    
  
  
  
  1.7       +0 -27     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_ssl.h	2001/05/05 15:10:58	1.6
  +++ mod_ssl.h	2001/05/05 15:26:06	1.7
  @@ -327,35 +327,9 @@
   #ifndef WIN32
   #define SSL_DBM_FILE_MODE ( S_IRUSR|S_IWUSR )
   #else
  -#define SSL_USE_SDBM
   #define SSL_DBM_FILE_MODE ( _S_IREAD|_S_IWRITE )
   #endif
   
  -#ifdef SSL_USE_SDBM
  -#include "ssl_util_sdbm.h"
  -#define ssl_dbm_open     sdbm_open
  -#define ssl_dbm_close    sdbm_close
  -#define ssl_dbm_store    sdbm_store
  -#define ssl_dbm_fetch    sdbm_fetch
  -#define ssl_dbm_delete   sdbm_delete
  -#define ssl_dbm_firstkey sdbm_firstkey
  -#define ssl_dbm_nextkey  sdbm_nextkey
  -#define SSL_DBM_FILE_SUFFIX_DIR ".dir"
  -#define SSL_DBM_FILE_SUFFIX_PAG ".pag"
  -#else /* !SSL_USE_SDBM */
  -#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) \
  -    && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
  -#include <db1/ndbm.h>
  -#else
  -#include <ndbm.h>
  -#endif
  -#define ssl_dbm_open     dbm_open
  -#define ssl_dbm_close    dbm_close
  -#define ssl_dbm_store    dbm_store
  -#define ssl_dbm_fetch    dbm_fetch
  -#define ssl_dbm_delete   dbm_delete
  -#define ssl_dbm_firstkey dbm_firstkey
  -#define ssl_dbm_nextkey  dbm_nextkey
   #if !defined(SSL_DBM_FILE_SUFFIX_DIR) && !defined(SSL_DBM_FILE_SUFFIX_PAG)
   #if defined(DBM_SUFFIX)
   #define SSL_DBM_FILE_SUFFIX_DIR DBM_SUFFIX
  @@ -368,7 +342,6 @@
   #define SSL_DBM_FILE_SUFFIX_PAG ".pag"
   #endif
   #endif
  -#endif /* !SSL_USE_SDBM */
   
   /*
    * Check for OpenSSL version 
  
  
  
  1.4       +42 -42    httpd-2.0/modules/ssl/ssl_scache_dbm.c
  
  Index: ssl_scache_dbm.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_scache_dbm.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_scache_dbm.c	2001/05/05 10:12:07	1.3
  +++ ssl_scache_dbm.c	2001/05/05 15:26:06	1.4
  @@ -64,7 +64,7 @@
   void ssl_scache_dbm_init(server_rec *s, pool *p)
   {
       SSLModConfigRec *mc = myModConfig();
  -    DBM *dbm;
  +    apr_dbm_t *dbm;
   
       /* for the DBM we need the data file */
       if (mc->szSessionCacheDataFile == NULL) {
  @@ -74,7 +74,7 @@
   
       /* open it once to create it and to make sure it _can_ be created */
       ssl_mutex_on(s);
  -    if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +    if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                               O_RDWR|O_CREAT, SSL_DBM_FILE_MODE)) == NULL) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot create SSLSessionCache DBM file `%s'",
  @@ -82,7 +82,7 @@
           ssl_mutex_off(s);
           return;
       }
  -    ssl_dbm_close(dbm);
  +    apr_dbm_close(dbm);
   
   #if !defined(OS2) && !defined(WIN32)
       /*
  @@ -135,9 +135,9 @@
   BOOL ssl_scache_dbm_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SSL_SESSION
*sess)
   {
       SSLModConfigRec *mc = myModConfig();
  -    DBM *dbm;
  -    datum dbmkey;
  -    datum dbmval;
  +    apr_dbm_t *dbm;
  +    apr_datum_t dbmkey;
  +    apr_datum_t dbmval;
       UCHAR ucaData[SSL_SESSION_MAX_DER];
       int nData;
       UCHAR *ucp;
  @@ -147,7 +147,7 @@
       nData = i2d_SSL_SESSION(sess, &ucp);
   
       /* be careful: do not try to store too much bytes in a DBM file! */
  -#ifdef SSL_USE_SDBM
  +#ifdef PAIRMAX
       if ((idlen + nData) >= PAIRMAX)
           return FALSE;
   #else
  @@ -169,7 +169,7 @@
   
       /* and store it to the DBM file */
       ssl_mutex_on(s);
  -    if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +    if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                               O_RDWR, SSL_DBM_FILE_MODE)) == NULL) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot open SSLSessionCache DBM file `%s' for writing (store)",
  @@ -178,16 +178,16 @@
           free(dbmval.dptr);
           return FALSE;
       }
  -    if (ssl_dbm_store(dbm, dbmkey, dbmval, DBM_INSERT) < 0) {
  +    if (apr_dbm_store(dbm, dbmkey, dbmval, DBM_INSERT) < 0) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot store SSL session to DBM file `%s'",
                   mc->szSessionCacheDataFile);
  -        ssl_dbm_close(dbm);
  +        apr_dbm_close(dbm);
           ssl_mutex_off(s);
           free(dbmval.dptr);
           return FALSE;
       }
  -    ssl_dbm_close(dbm);
  +    apr_dbm_close(dbm);
       ssl_mutex_off(s);
   
       /* free temporary buffers */
  @@ -202,9 +202,9 @@
   SSL_SESSION *ssl_scache_dbm_retrieve(server_rec *s, UCHAR *id, int idlen)
   {
       SSLModConfigRec *mc = myModConfig();
  -    DBM *dbm;
  -    datum dbmkey;
  -    datum dbmval;
  +    apr_dbm_t *dbm;
  +    apr_datum_t dbmkey;
  +    apr_datum_t dbmval;
       SSL_SESSION *sess = NULL;
       UCHAR *ucpData;
       int nData;
  @@ -220,7 +220,7 @@
   
       /* and fetch it from the DBM file */
       ssl_mutex_on(s);
  -    if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +    if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                               O_RDONLY, SSL_DBM_FILE_MODE)) == NULL) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot open SSLSessionCache DBM file `%s' for reading (fetch)",
  @@ -228,8 +228,8 @@
           ssl_mutex_off(s);
           return NULL;
       }
  -    dbmval = ssl_dbm_fetch(dbm, dbmkey);
  -    ssl_dbm_close(dbm);
  +    dbmval = apr_dbm_fetch(dbm, dbmkey);
  +    apr_dbm_close(dbm);
       ssl_mutex_off(s);
   
       /* immediately return if not found */
  @@ -260,8 +260,8 @@
   void ssl_scache_dbm_remove(server_rec *s, UCHAR *id, int idlen)
   {
       SSLModConfigRec *mc = myModConfig();
  -    DBM *dbm;
  -    datum dbmkey;
  +    apr_dbm_t *dbm;
  +    apr_datum_t dbmkey;
   
       /* create DBM key and values */
       dbmkey.dptr  = (char *)id;
  @@ -269,7 +269,7 @@
   
       /* and delete it from the DBM file */
       ssl_mutex_on(s);
  -    if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +    if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                               O_RDWR, SSL_DBM_FILE_MODE)) == NULL) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot open SSLSessionCache DBM file `%s' for writing (delete)",
  @@ -277,8 +277,8 @@
           ssl_mutex_off(s);
           return;
       }
  -    ssl_dbm_delete(dbm, dbmkey);
  -    ssl_dbm_close(dbm);
  +    apr_dbm_delete(dbm, dbmkey);
  +    apr_dbm_close(dbm);
       ssl_mutex_off(s);
   
       return;
  @@ -289,15 +289,15 @@
       SSLModConfigRec *mc = myModConfig();
       SSLSrvConfigRec *sc = mySrvConfig(s);
       static time_t tLast = 0;
  -    DBM *dbm;
  -    datum dbmkey;
  -    datum dbmval;
  +    apr_dbm_t *dbm;
  +    apr_datum_t dbmkey;
  +    apr_datum_t dbmval;
       pool *p;
       time_t tExpiresAt;
       int nElements = 0;
       int nDeleted = 0;
       int bDelete;
  -    datum *keylist;
  +    apr_datum_t *keylist;
       int keyidx;
       int i;
       time_t tNow;
  @@ -336,7 +336,7 @@
   
           /* pass 1: scan DBM database */
           keyidx = 0;
  -        if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +        if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                                   O_RDWR, SSL_DBM_FILE_MODE)) == NULL) {
               ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                       "Cannot open SSLSessionCache DBM file `%s' for scanning",
  @@ -344,11 +344,11 @@
               ap_destroy_pool(p);
               break;
           }
  -        dbmkey = ssl_dbm_firstkey(dbm);
  +        dbmkey = apr_dbm_firstkey(dbm);
           while (dbmkey.dptr != NULL) {
               nElements++;
               bDelete = FALSE;
  -            dbmval = ssl_dbm_fetch(dbm, dbmkey);
  +            dbmval = apr_dbm_fetch(dbm, dbmkey);
               if (dbmval.dsize <= sizeof(time_t) || dbmval.dptr == NULL)
                   bDelete = TRUE;
               else {
  @@ -365,12 +365,12 @@
                           break;
                   }
               }
  -            dbmkey = ssl_dbm_nextkey(dbm);
  +            dbmkey = apr_dbm_nextkey(dbm);
           }
  -        ssl_dbm_close(dbm);
  +        apr_dbm_close(dbm);
   
           /* pass 2: delete expired elements */
  -        if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +        if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                                   O_RDWR, SSL_DBM_FILE_MODE)) == NULL) {
               ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                       "Cannot re-open SSLSessionCache DBM file `%s' for expiring",
  @@ -379,10 +379,10 @@
               break;
           }
           for (i = 0; i < keyidx; i++) {
  -            ssl_dbm_delete(dbm, keylist[i]);
  +            apr_dbm_delete(dbm, keylist[i]);
               nDeleted++;
           }
  -        ssl_dbm_close(dbm);
  +        apr_dbm_close(dbm);
   
           /* destroy temporary pool */
           ap_destroy_pool(p);
  @@ -400,9 +400,9 @@
   void ssl_scache_dbm_status(server_rec *s, pool *p, void (*func)(char *, void *), void *arg)
   {
       SSLModConfigRec *mc = myModConfig();
  -    DBM *dbm;
  -    datum dbmkey;
  -    datum dbmval;
  +    apr_dbm_t *dbm;
  +    apr_datum_t dbmkey;
  +    apr_datum_t dbmval;
       int nElem;
       int nSize;
       int nAverage;
  @@ -410,7 +410,7 @@
       nElem = 0;
       nSize = 0;
       ssl_mutex_on(s);
  -    if ((dbm = ssl_dbm_open(mc->szSessionCacheDataFile,
  +    if ((dbm = apr_dbm_open(mc->szSessionCacheDataFile,
                               O_RDONLY, SSL_DBM_FILE_MODE)) == NULL) {
           ssl_log(s, SSL_LOG_ERROR|SSL_ADD_ERRNO,
                   "Cannot open SSLSessionCache DBM file `%s' for status retrival",
  @@ -418,15 +418,15 @@
           ssl_mutex_off(s);
           return;
       }
  -    dbmkey = ssl_dbm_firstkey(dbm);
  -    for ( ; dbmkey.dptr != NULL; dbmkey = ssl_dbm_nextkey(dbm)) {
  -        dbmval = ssl_dbm_fetch(dbm, dbmkey);
  +    dbmkey = apr_dbm_firstkey(dbm);
  +    for ( ; dbmkey.dptr != NULL; dbmkey = apr_dbm_nextkey(dbm)) {
  +        dbmval = apr_dbm_fetch(dbm, dbmkey);
           if (dbmval.dptr == NULL)
               continue;
           nElem += 1;
           nSize += dbmval.dsize;
       }
  -    ssl_dbm_close(dbm);
  +    apr_dbm_close(dbm);
       ssl_mutex_off(s);
       if (nSize > 0 && nElem > 0)
           nAverage = nSize / nElem;
  
  
  

Mime
View raw message