httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject Re: MODULE_MAGIC_AT_LEAST()
Date Thu, 22 Jun 2000 02:05:52 GMT
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/
>


Mime
View raw message