httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_scache_dbm.c
Date Wed, 10 Sep 2003 14:21:12 GMT
jim         2003/09/10 07:21:12

  Modified:    modules/ssl ssl_scache_dbm.c
  Log:
  These silent errors have bitten me a few times, now that we
  use APR'd dbm. mod_ssl had hacked sdbm for larger sizes.
  
  Revision  Changes    Path
  1.20      +19 -4     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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ssl_scache_dbm.c	3 Sep 2003 19:27:08 -0000	1.19
  +++ ssl_scache_dbm.c	10 Sep 2003 14:21:12 -0000	1.20
  @@ -145,18 +145,30 @@
       apr_status_t rv;
   
       /* streamline session data */
  -    if ((nData = i2d_SSL_SESSION(sess, NULL)) > sizeof(ucaData))
  +    if ((nData = i2d_SSL_SESSION(sess, NULL)) > sizeof(ucaData)) {
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "streamline session data size too large: %d > %d",
  +                 nData, sizeof(ucaData));
           return FALSE;
  +    }
       ucp = ucaData;
       i2d_SSL_SESSION(sess, &ucp);
   
       /* be careful: do not try to store too much bytes in a DBM file! */
   #ifdef PAIRMAX
  -    if ((idlen + nData) >= PAIRMAX)
  +    if ((idlen + nData) >= PAIRMAX) {
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "data size too large for DBM session cache: %d >= %d",
  +                 (idlen + nData), PAIRMAX);
           return FALSE;
  +    }
   #else
  -    if ((idlen + nData) >= 950 /* at least less than approx. 1KB */)
  +    if ((idlen + nData) >= 950 /* at least less than approx. 1KB */) {
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "data size too large for DBM session cache: %d >= %d",
  +                 (idlen + nData), 950);
           return FALSE;
  +    }
   #endif
   
       /* create DBM key */
  @@ -166,8 +178,11 @@
       /* create DBM value */
       dbmval.dsize = sizeof(time_t) + nData;
       dbmval.dptr  = (char *)malloc(dbmval.dsize);
  -    if (dbmval.dptr == NULL)
  +    if (dbmval.dptr == NULL) {
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "malloc error creating DBM value");
           return FALSE;
  +    }
       memcpy((char *)dbmval.dptr, &expiry, sizeof(time_t));
       memcpy((char *)dbmval.dptr+sizeof(time_t), ucaData, nData);
   
  
  
  

Mime
View raw message