Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 54517 invoked by uid 500); 1 Jun 2001 18:33:50 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 51918 invoked from network); 1 Jun 2001 18:29:45 -0000 Date: Fri, 1 Jun 2001 11:32:07 -0700 (PDT) From: X-Sender: To: Cc: Subject: Re: cvs commit: httpd-2.0/modules/http http_request.c In-Reply-To: <3B17D156.41D4A842@sharp.fm> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Fri, 1 Jun 2001, Graham Leggett wrote: > rbb@covalent.net wrote: > > > > > void reset_filters(r) > > > > { > > > > ap_filter_t *f = r->output_filters; > > > > int has_core = 0, has_content = 0, has_http_header = 0; > > > > while (f) { > > > > ap_filter_t *f2 = f->next; > > > > ap_remove_filter(f); > > > > f = f2; > > > > } > > > > ap_add_output_filter("CORE", NULL, r, r->connection); > > > > ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection); > > > > ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection); > > > > } > > > > > > Won't this cause a problem if one of these basic filters threw the error > > > in the first place - when the filter was thrown away (and replaced) the > > > context would be thrown away too. Would this be a problem, or am I > > > missing something? > > > > The error is completely owned by the stuff in the request_rec by now. > > There shouldn't be anything in any of these three filters that is saved in > > the context pointer that we actually need to send out a valid error > > response. Remember, that those filters are storing information about the > > valid response, once we find an error we basically have a completely > > different response that we are sending, and any old information in the > > filter is invalid. > > Ok - so to sum up basically reset_filters() should remove all filters > from the stack, then add the three minimal basic filters, and run with > it from there...? Yep. Just makes the code easier by removing a bunch of if's. It also makes it very obvious just what the required filters are. If we ever need to add another required filter, it just gets added right there. Ryan _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------