httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r209530 - in /httpd/httpd/trunk/modules/ssl: ssl_scache_dbm.c ssl_scache_shmcb.c ssl_toolkit_compat.h
Date Wed, 06 Jul 2005 22:25:38 GMT
Author: wrowe
Date: Wed Jul  6 15:25:37 2005
New Revision: 209530

URL: http://svn.apache.org/viewcvs?rev=209530&view=rev
Log:

  Wrap this type in a macro since it seems to be bouncing from
  0.9.7g to 0.9.7h in const'ness.

PR: 34520

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
    httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c
    httpd/httpd/trunk/modules/ssl/ssl_toolkit_compat.h

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c?rev=209530&r1=209529&r2=209530&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache_dbm.c Wed Jul  6 15:25:37 2005
@@ -196,7 +196,7 @@
     apr_datum_t dbmkey;
     apr_datum_t dbmval;
     SSL_SESSION *sess = NULL;
-    UCHAR *ucpData;
+    MODSSL_D2I_DATUM_TYPE ucpData;
     int nData;
     time_t expiry;
     time_t now;
@@ -237,13 +237,14 @@
 
     /* parse resulting data */
     nData = dbmval.dsize-sizeof(time_t);
-    ucpData = (UCHAR *)malloc(nData);
+    ucpData = malloc(nData);
     if (ucpData == NULL) {
         apr_dbm_close(dbm);
         ssl_mutex_off(s);
         return NULL;
     }
-    memcpy(ucpData, (char *)dbmval.dptr+sizeof(time_t), nData);
+    /* Cast needed, ucpData may be const */
+    memcpy((UCHAR *)ucpData, (char *)dbmval.dptr+sizeof(time_t), nData);
     memcpy(&expiry, dbmval.dptr, sizeof(time_t));
 
     apr_dbm_close(dbm);

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c?rev=209530&r1=209529&r2=209530&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache_shmcb.c Wed Jul  6 15:25:37 2005
@@ -1184,7 +1184,7 @@
     SHMCBHeader *header;
     SSL_SESSION *pSession = NULL;
     unsigned int curr_pos, loop, count;
-    unsigned char *ptr;
+    MODSSL_D2I_DATUM_TYPE ptr;
     time_t now;
 
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
@@ -1262,7 +1262,7 @@
     SHMCBIndex *idx;
     SHMCBHeader *header;
     unsigned int curr_pos, loop, count;
-    unsigned char *ptr;
+    MODSSL_D2I_DATUM_TYPE ptr;
     BOOL to_return = FALSE;
 
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,

Modified: httpd/httpd/trunk/modules/ssl/ssl_toolkit_compat.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ssl/ssl_toolkit_compat.h?rev=209530&r1=209529&r2=209530&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_toolkit_compat.h (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_toolkit_compat.h Wed Jul  6 15:25:37 2005
@@ -78,12 +78,18 @@
 #define MODSSL_BIO_CB_ARG_TYPE const char
 #define MODSSL_CRYPTO_CB_ARG_TYPE const char
 #if (OPENSSL_VERSION_NUMBER < 0x00907000)
-#define MODSSL_INFO_CB_ARG_TYPE SSL*
+# define MODSSL_INFO_CB_ARG_TYPE SSL*
 #else
-#define MODSSL_INFO_CB_ARG_TYPE const SSL*
+# define MODSSL_INFO_CB_ARG_TYPE const SSL*
 #endif
 #define MODSSL_CLIENT_CERT_CB_ARG_TYPE X509
 #define MODSSL_PCHAR_CAST
+#if (OPENSSL_VERSION_NUMBER < 0x0090707f)
+# define MODSSL_D2I_DATUM_TYPE unsigned char *
+#else
+# define MODSSL_D2I_DATUM_TYPE const unsigned char *
+#endif
+
 
 #define modssl_X509_verify_cert X509_verify_cert
 
@@ -146,6 +152,7 @@
 #define MODSSL_INFO_CB_ARG_TYPE SSL*
 #define MODSSL_CLIENT_CERT_CB_ARG_TYPE void
 #define MODSSL_PCHAR_CAST (char *)
+#define MODSSL_D2I_DATUM_TYPE unsigned char *
 
 typedef int (modssl_read_bio_cb_fn)(char*,int,int);
 



Mime
View raw message