Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 95502 invoked from network); 8 Jul 2005 15:00:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Jul 2005 15:00:11 -0000 Received: (qmail 64978 invoked by uid 500); 8 Jul 2005 15:00:06 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 64934 invoked by uid 500); 8 Jul 2005 15:00:05 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 64921 invoked by uid 99); 8 Jul 2005 15:00:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2005 08:00:05 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jorton@redhat.com designates 66.187.233.31 as permitted sender) Received: from [66.187.233.31] (HELO mx1.redhat.com) (66.187.233.31) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2005 08:00:04 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j68F02YY030462; Fri, 8 Jul 2005 11:00:02 -0400 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j68F01V18035; Fri, 8 Jul 2005 11:00:01 -0400 Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.13.4/8.13.4/Submit) id j68F0095025793; Fri, 8 Jul 2005 16:00:00 +0100 X-Authentication-Warning: radish.cambridge.redhat.com: jorton set sender to jorton@redhat.com using -f Date: Fri, 8 Jul 2005 16:00:00 +0100 From: Joe Orton To: "William A. Rowe, Jr." Cc: dev@httpd.apache.org Subject: Re: [Patch 2.0] d2i_SSL_SESSION args for 0.9.7f-/0.9.7g/0.9.8 Message-ID: <20050708150000.GD21110@redhat.com> Mail-Followup-To: "William A. Rowe, Jr." , dev@httpd.apache.org References: <6.2.1.2.2.20050707172833.0667dd60@pop3.rowe-clan.net> <20050708064846.GA13209@redhat.com> <6.2.1.2.2.20050708090725.0595bd60@pop3.rowe-clan.net> <6.2.1.2.2.20050708095043.0631d870@pop3.rowe-clan.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6.2.1.2.2.20050708095043.0631d870@pop3.rowe-clan.net> User-Agent: Mutt/1.4.2.1i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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);