On Tue, Apr 15, 2008 at 3:19 PM, Mark Stosberg <[EMAIL PROTECTED]> wrote:
>  It seems that using CGI, it is too late return a true 404 once the script
> is processing the request.

I thought mod_cgi would handle this, actually.  It parses your header
output.  Apache::Registry has trouble emulating that, as discussed on
this list in the past.

>  However, I don't think I'm doing the ideal think in mod_perl, because it
>  behaves strangely in some cases. Two specific cases:
>
>  If I use GET on the command line, instead of 404, I'll get back this:
>  "500 EOF when chunk header expected"

You're not using Registry here, right?  Is it possible that something
is using your status header as a return code from a mod_perl handler?
Those don't always match.

The best source for examples of how to do this correctly is probably
the mod_perl Developer's Cookbook.  I don't have mine handy, but
that's where I'd like first if you have it.

>  More troubling is the behavior I see in the browser: The first time I
>  access the script that would through this 404 in mod_perl, it works.
>  Then for attempts 2 through 6 return internal server errors complaining
>  about "can't locate modules". Starting on load 7, the pages are returned
>  reliably with the 404 error. WTF?

I'm not familiar with that one.  What's the full text of the error message?

>  In my case, I'm
>  hoping to trigger the internal ErrorDocument 404 page instead of
>  re-inventingt that wheel.

I'm not sure you can do that.  I know you can set the ErrorDocument
for a specific block ($r->custom_response), but I don't think you can
just hand off to ErrorDocument because it's tied into the default
handler.  I don't remember this well, so checking one of the books or
the list archive is your best bet.

- Perrin

Reply via email to