Mailing List Archive

Re: Apache module advice (fwd)
Patch on hyperreal; /httpd/incoming/patch.0.8.14.config_decline

---------- Forwarded message ----------
Date: Sat, 23 Sep 95 19:21:00 PDT
From: Bill Radcliffe <billr@corbis.com>
To: Mark J Cox <M.J.Cox@bradford.ac.uk>
Subject: Re: Apache module advice

Thanks for the response . I finally found the problem. I am using gcc
2.6.1 on SunOS 4.1.3. The code that dispatches to the various handlers
either does not compile right or is actually erroneous.

int
run_method (request_rec *r, int offset, int run_all)
{
module *modp;
for (modp = top_module; modp; modp = modp->next) {
handler mod_handler = *(handler *)(offset + (char *)(modp));

if (mod_handler) {
int result = (*mod_handler)(r);

if (result != DECLINED && (!run_all || result != OK))
return result;
}
}

return run_all ? OK : DECLINED;
}

The line "if (result != DECLINED && (!run_all || result != OK))" need to be
changed to " if ((result != DECLINED) && (!run_all || result != OK))"

The effect is that you could not REALLY decline from the translate phase and
have the next module pick up where you left off. This was driving me
crazy!!! I kept staring at it and staring at it and it looked correct!
Re: Apache module advice (fwd) [ In reply to ]
> The line "if (result != DECLINED && (!run_all || result != OK))" need to be
> changed to " if ((result != DECLINED) && (!run_all || result != OK))"

But these are equivalent. Is gcc really bugged here?

--
Ben Laurie Phone: +44 (181) 994 6435
Freelance Consultant Fax: +44 (181) 994 6472
and Technical Director Email: ben@algroup.co.uk (preferred)
A.L. Digital Ltd, benl@fear.demon.co.uk (backup)
London, England.

[.Note for the paranoid: "fear" as in "Fear and Loathing
in Las Vegas", "demon" as in Demon Internet Services, a
commercial Internet access provider.]
Re: Apache module advice (fwd) [ In reply to ]
> > The line "if (result != DECLINED && (!run_all || result != OK))" need to be
> > changed to " if ((result != DECLINED) && (!run_all || result != OK))"
>
> But these are equivalent. Is gcc really bugged here?

There are several well-documented optimisation bugs in gcc, mostly brought
about by the -O2 flag. Try recompiling with -O or no optomisation at all.

> Ben Laurie Phone: +44 (181) 994 6435

Ay.
Re: Apache module advice (fwd) [ In reply to ]
Accidentally sent to owner-new-httpd.

Brian

---------- Forwarded message ----------
Date: Mon, 25 Sep 95 09:49:00 PDT
From: Bill Radcliffe <billr@corbis.com>
To: owner-new-httpd <owner-new-httpd@hyperreal.com>
Subject: Re: Apache module advice (fwd)


This was a big surprise to me as well. I could not get my module to work
without this fix. I looked at the makefile and I am compiling with -g only -
so there should be no optimization problems!

My module depends on being able to replace the uri during the translation
phase and then DECLINE. This allows me to embed information in URLS that is
transparently removed during the translation phase.

P.S. I have finally given birth to a website at "http://www.corbis.com". You
can see what I am doing with URL translation there if you are interested. I
plan on releasing my modules after all the smoke clears here. There are a
number of things that need to be generalized for a wider audience, but it
should prove usefull. I hope to have this stuff ready for the contrib
directory before 1.0.

William T. Radcliffe Phone (206) 649-3381 Fax: (206) 643-9742
Principal Engineer billr@corbis.com
Corbis
Belleuve,WA
----------
From: owner-new-httpd
To: new-httpd
Subject: Re: Apache module advice (fwd)
Date: Monday, September 25, 1995 9:59AM

> The line "if (result != DECLINED && (!run_all || result != OK))" need to
be
> changed to " if ((result != DECLINED) && (!run_all || result != OK))"

But these are equivalent. Is gcc really bugged here?

--
Ben Laurie Phone: +44 (181) 994 6435
Freelance Consultant Fax: +44 (181) 994 6472
and Technical Director Email: ben@algroup.co.uk (preferred)
A.L. Digital Ltd, benl@fear.demon.co.uk (backup)
London, England.

[.Note for the paranoid: "fear" as in "Fear and Loathing
in Las Vegas", "demon" as in Demon Internet Services, a
commercial Internet access provider.]
Re: Apache module advice (fwd) [ In reply to ]
>
>
> Accidentally sent to owner-new-httpd.
>
> Brian
>
> ---------- Forwarded message ----------
> Date: Mon, 25 Sep 95 09:49:00 PDT
> From: Bill Radcliffe <billr@corbis.com>
> To: owner-new-httpd <owner-new-httpd@hyperreal.com>
> Subject: Re: Apache module advice (fwd)
>
>
> This was a big surprise to me as well. I could not get my module to work
> without this fix. I looked at the makefile and I am compiling with -g only -
> so there should be no optimization problems!

Perhaps a listing of the generated assembler for the two versions would
help to elucidate the problem.

>
> My module depends on being able to replace the uri during the translation
> phase and then DECLINE. This allows me to embed information in URLS that is
> transparently removed during the translation phase.

>
> P.S. I have finally given birth to a website at "http://www.corbis.com". You
> can see what I am doing with URL translation there if you are interested. I
> plan on releasing my modules after all the smoke clears here. There are a
> number of things that need to be generalized for a wider audience, but it
> should prove usefull. I hope to have this stuff ready for the contrib
> directory before 1.0.
>
> William T. Radcliffe Phone (206) 649-3381 Fax: (206) 643-9742
> Principal Engineer billr@corbis.com
> Corbis
> Belleuve,WA
> ----------
> From: owner-new-httpd
> To: new-httpd
> Subject: Re: Apache module advice (fwd)
> Date: Monday, September 25, 1995 9:59AM
>
> > The line "if (result != DECLINED && (!run_all || result != OK))" need to
> be
> > changed to " if ((result != DECLINED) && (!run_all || result != OK))"
>
> But these are equivalent. Is gcc really bugged here?
>
> --
> Ben Laurie Phone: +44 (181) 994 6435
> Freelance Consultant Fax: +44 (181) 994 6472
> and Technical Director Email: ben@algroup.co.uk (preferred)
> A.L. Digital Ltd, benl@fear.demon.co.uk (backup)
> London, England.
>
> [.Note for the paranoid: "fear" as in "Fear and Loathing
> in Las Vegas", "demon" as in Demon Internet Services, a
> commercial Internet access provider.]
>

--
Ben Laurie Phone: +44 (181) 994 6435
Freelance Consultant Fax: +44 (181) 994 6472
and Technical Director Email: ben@algroup.co.uk
A.L. Digital Ltd,
London, England.