r2180 - trunk/varnish-cache/lib/libvarnishapi
Poul-Henning Kamp
phk at phk.freebsd.dk
Sun Nov 4 11:49:20 CET 2007
In message <ujrk5p69b80.fsf at false.linpro.no>, =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= w
rites:
>"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
>> "Dag-Erling Sm=F8rgrav" <des at linpro.no> writes:
>> > A cast would be more appropriate... and we should probably use
>> > isprint() instead of hardcoding (*ptr >=3D ' ' && *ptr <=3D '~').
>> A cast we can discuss, but isprint() would be wrong because it would
>> take the locale into consideration and HTTP is specifically specified
>> in ASCII with no extension.
>
>We already force the time zone to UTC, there is no reason not to force
>the locale to "C".
>
>Alternatively, we can provide our own ASCII-only implementation - I
>really don't like (*ptr >=3D ' ' && *ptr <=3D '~').
I guess, strictly speaking that should be 0x20 and 0x7e... :-)
I actually have the beginning of a HTTP-oriented ctype over in cache_http.c
and I have been thinking about adding a couple of bits more and use that
throughout.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-commit
mailing list