+1 on the patch in general. It seems to work for NetWare. However, since we only build mod_ssl for 2.1/2.2 and only target openssl 0.9.8, I can't really comment on the 2.0 backport other than I expect it to work there as well.
Brad >>> [EMAIL PROTECTED] Friday, July 08, 2005 9:00:00 AM >>> On Fri, Jul 08, 2005 at 09:53:44AM -0500, William Rowe wrote: > > >At 01:48 AM 7/8/2005, Joe Orton wrote: > >>On Thu, Jul 07, 2005 at 06:51:04PM -0500, William Rowe wrote: > >>> > >>> This resolves build issues which caused errors in 0.9.7f and > >>> prior on Win32 and build failures on Netware. This patch > >>> correctly chooses the appropriate const-ness for 0.9.6, 0.9.7, > >>> or 0.9.8 OpenSSL. It needs to be verified on Netware since > >>> my Win32 builds completely clean. > >> > >>-1, this is barely readable, using a #define as previously or a typedef > >>in ssl_toolkit_compat.h is much cleaner. > > Ok, attached is a const-flag based solution buried back into > ssl_toolkit_compat.h, that I believe is the most readable. > > Comments/Votes? 2.0.x patch attached; 2.1 committed. +1 for 2.0.x if the below is changed to use (unsigned char *) rather than (UCHAR *) in the cast too. Thanks for fixing this! > --- ssl_scache_dbm.c (revision 209795) > +++ ssl_scache_dbm.c (working copy) > @@ -193,7 +193,7 @@ > apr_datum_t dbmkey; > apr_datum_t dbmval; > SSL_SESSION *sess = NULL; > - UCHAR *ucpData; > + MODSSL_D2I_SSL_SESSION_CONST unsigned char *ucpData; > int nData; > time_t expiry; > time_t now; > @@ -234,13 +234,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);