Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 29088 invoked by uid 6000); 26 Mar 1998 19:15:20 -0000 Received: (qmail 29080 invoked from network); 26 Mar 1998 19:15:19 -0000 Received: from twinlark.arctic.org (204.62.130.91) by taz.hyperreal.org with SMTP; 26 Mar 1998 19:15:19 -0000 Received: (qmail 4334 invoked by uid 500); 26 Mar 1998 19:30:14 -0000 Date: Thu, 26 Mar 1998 11:30:14 -0800 (PST) From: Dean Gaudet To: new-httpd@apache.org Subject: Re: API question In-Reply-To: Message-ID: X-Comment: Visit http://www.arctic.org/~dgaudet/legal for information regarding copyright and disclaimer. MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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. Dean 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 > priebe@wral-tv.com Raleigh, NC > see http://www.wral-tv.com/~priebe/ for public key > Signature by unknown keyid: 0x70FF3DA1 >