httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: MODULE_MAGIC_AT_LEAST()
Date Thu, 22 Jun 2000 09:47:16 GMT
Agreed. Gotta start fresh with a new macro. I'll add some STATUS entries RSN.

Cheers,
-g

On Wed, Jun 21, 2000 at 09:19:39PM -0500, William A. Rowe, Jr. wrote:
> Rethinking,
> 
>   you can't fix it.  That is, it will always be wrong on
> old modules.  Rename it AP_MODULE_MAGIC_AT_LEAST(), add the
> major server rev (in case you are dealing with parallel
> versions), and you should be off to the races.
> 
>   I don't see why we shouldn't abandon, hard, the old macro
> name, since it was so essentially cracked.  Your call
> 
> Bill
> 
> > > -----Original Message-----
> > > From: Roy T. Fielding [mailto:fielding@kiwi.ICS.UCI.EDU]
> > > Sent: Wednesday, June 21, 2000 9:06 PM
> > > To: new-httpd@apache.org
> > > Subject: Re: MODULE_MAGIC_AT_LEAST() 
> > > 
> > > 
> > > Greg, this is still broken, right?  It sure looks broken.
> > > Let's fix it now in both 1.3 and 2.0.
> > > 
> > > ....Roy
> > > 
> > > In message 
> > > <Pine.LNX.4.10.10003300335430.13431-100000@nebula.lyra.org>,
> > > Greg Stein writes:
> > > >Has anybody noticed the logic is wrong for this macro? (in 
> > ap_mmn.h)
> > > >
> > > >Here is the current definition:
> > > >
> > > >/* Useful for testing for features. */
> > > >#define MODULE_MAGIC_AT_LEAST(major,minor)              \
> > > >    ((major) > MODULE_MAGIC_NUMBER_MAJOR                \
> > > >        || ((major) == MODULE_MAGIC_NUMBER_MAJOR        \
> > > >            && (minor) >= MODULE_MAGIC_NUMBER_MINOR))
> > > >
> > > >/* For example, suppose you wish to use the ap_overlap_tables
> > > >   function.  You can do this:
> > > >
> > > >#if MODULE_MAGIC_AT_LEAST(19980812,2)
> > > >    ... use ap_overlap_tables()
> > > >#else
> > > >    ... alternative code which doesn't use ap_overlap_tables()
> > > >#endif
> > > >
> > > >*/
> > > >
> > > >
> > > >However, the macro is checking if 19980812 is *greater* than 
> > > the server
> > > >version. If 19980812 is greater (the server is 
> > less/equal), then the
> > > >feature definition doesn't exist! The minor check is also 
> > incorrect.
> > > >
> > > >I propose that we patch the macro to:
> > > >#define MODULE_MAGIC_AT_LEAST(major,minor)              \
> > > >    ((major) < MODULE_MAGIC_NUMBER_MAJOR                \
> > > >        || ((major) == MODULE_MAGIC_NUMBER_MAJOR        \
> > > >            && (minor) <= MODULE_MAGIC_NUMBER_MINOR))
> > > >
> > > >
> > > >Or am I just looking at this wrong?  (which I doubt cuz we found it
> > > >didn't work when we tried it in the mod_dav code for testing if
> > > >case_preserved_filename exists).
> > > >
> > > >I don't see any code in the distribution which actually uses 
> > > this macro. I
> > > >doubt that third-party modules are using it since it appears 
> > > to have the
> > > >wrong test.
> > > >
> > > >Cheers,
> > > >-g
> > > >
> > > >
> > > >-- 
> > > >Greg Stein, http://www.lyra.org/
> > > >
> > > 
> > 

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message