[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr_strnatcasecmp vs. strcasecmp

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-15 23:30:47 CET

David James wrote:
>
> I see that httpd recently switched from 'apr_strnatcasecmp' to
> 'strcasecmp'. Would this introduce problems on OS400 V5R4?
>
> See http://svn.apache.org/viewcvs?rev=230708&view=rev

The log message says:

   End apr_natstrcasecmp, backporting part of r216111 (there may remain
   other apr_natstrcasecmp abuse in other files).

   Still unsure if apr_strnatcasecmp of the hostname is deliberate to
   handle leading 0's in ip addresses, so leaving that single use case.

I see from the implementation that apr_strnatcasecmp does not ignore leading
zeros, it treats them as significant, as if this were the fractional part of a
number, effectively doing the same as a character-by-character comparison.
Therefore that is not a reason for using it to compare IP addresses for equality.

I see in today's snapshot that such a comparison is still in
httpd/modules/proxy/proxy_util.c.

If someone here is in contact with the HTTPD developers, you might like to pass
on this message to them.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 15 23:33:31 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.