httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: API question
Date Thu, 26 Mar 1998 19:30:14 GMT
You could say the docs are wrong.  For many requests, no attempt is made
to generate the "file does not exist" error until the handler is already
run.  For files it's definately the case that rr->finfo.st_mode == 0 is an
indicator the file doesn't exist.  But for more complex URIs this may not
be the case.  It's a flaw in the API.

run_sub_req() may not actually do the error handling the way you want... 
you may want to just punt your handler if rr->finfo.st_mode == 0 and let
the core take over with error messages. 


On Thu, 26 Mar 1998, Jason S. Priebe wrote:

> Hope this is the appropriate place for this question.  I'm working to
> make my mod_trailer comply with the API, per Dean's suggestions.  I'm
> looking at the API docs regarding sub_req_lookup_uri(), and they say
> that this routine does everything up to actually sending a response.
> I took this to mean that if I do the following:
>   rr = sub_req_lookup_uri(my_uri, r);
> then rr->status would be of some use.  Unfortunately, if I make a
> request to the server for a non-existent document, rr->status contains
> '200', so it isn't giving me useful information.
> However, rr->finfo.st_mode _does_ appear to be useful, since it is
> properly set to 0 when I request the non-existent document.  So I
> modified my code to use the value of rr->finfo.st_mode to determine
> whether to call send_http_header().  If rr->finfo.st_mode == 0, then
> I assume that when I call run_sub_req(rr), an error handler will
> take over and send the appropriate headers.
> Can anybody shed some light on this?
> --------------------------------------------------
> Jason Priebe                           WRAL OnLine
>                     Raleigh, NC
> see for public key                
> Signature by unknown keyid: 0x70FF3DA1

View raw message