httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: cvs commit: httpd-2.0/modules/filters mod_deflate.c
Date Sat, 17 Jul 2004 15:42:36 GMT
On Sat, 17 Jul 2004, [ISO-8859-15] André Malo wrote:

> * niq@apache.org wrote:
>
> >   +        f->ctx = ctx = (void*)-1;
>
> I personally consider defining arbitrary pointer values as bad style, though
> I'm not sure what the general opinion here is (if any).
>
> I'd suggest to use a static pointer, like a global
>
> static char foo_sentinel; /* choose a speaking name ;-) */
> /* and later */
> f->ctx = ctx = &foo_sentinel;
>
> Additionally - afair - the use of arbirtrary pointer values can even lead
> to bus errors on not-so-usual systems (loading undefined bits into an address
> register...).

Yes, you're right.

Actually this patch has a deeper problem, as does the patch it fixes.
Setting the headers at this point depends entirely on the behaviour
of the headers filter.  With current behaviour, the previous mod_deflate
was broken (because it could delay setting headers until after the
headers have been sent down the wire).  With my patch it might still
risk minor breakage (repeated gzip header) if the headers filter changes
sometime in future.

Any more issues with this?  If not I'll make nd's fix and leave it.

-- 
Nick Kew

Mime
View raw message