Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 74207 invoked by uid 500); 5 Jun 2000 03:04:02 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 74196 invoked from network); 5 Jun 2000 03:04:02 -0000 Date: Sun, 4 Jun 2000 20:03:55 -0700 From: "Life is hard, and then you die" To: new-httpd@apache.org Subject: Re: recap of filtered I/O Message-ID: <20000604200354.A2219@innovation.ch> Mail-Followup-To: new-httpd@apache.org References: <20000604153810.D1800@innovation.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from gstein@lyra.org on Sun, Jun 04, 2000 at 04:16:21PM -0700 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N On Sun, Jun 04, 2000 at 04:16:21PM -0700, Greg Stein wrote: > On Sun, 4 Jun 2000, Life is hard, and then you die wrote: > >... > > On Sat, Jun 03, 2000 at 02:26:16PM -0700, Greg Stein wrote: > >... > > > *) how would my insert-100Mb-filter be written? > > > > I Ryan addressed this point with the filter being able to signal that > > it hasn't sent all yet. > > In the hook-based scheme, the hook is only called when the > content-generator writes some output (e.g. via ap_rwrite()). If the filter > isn't going to write all the data at that point, then when will it? > > content-generator: > ap_rwrite("foobarbleek"); > ap_rwrite("more stuff"); > > That 100Meg needs to go out before the "bleek" can be written. Either, it > gets completely dumped into an iovec[], or the hook calling will look > like: > > ap_rwrite: > iovec[0] = (buf, len) > run_hook(iovec, &more_to_write) > ap_bwrite(iovec) > while more_to_write: > iovec = empty > run_hook(iovec, &more_to_write) > ap_bwrite(iovec) > > That just seems a bit complicated :-) > > I'm not sure, but you might be confusing the "I have more to write" with > the concept of "I haven't processed all the input yet." [snip] Hmm, yes, I guess I was confusing the two. And yes, the above was about what I had thought would be done. Pretty? No. > [ both schemes can handle the "wait for the rest of the input" scenario; I > believe that the link-based approach is a bit easier, it that it > provides an explicit context pointer for maintaining this data; the > hook-based approach requires the filter to attach "user data" to the > request (which then prevents "SetFilters SSI PHP SSI" because there is > only one "SSI user data slot" ] Agreed - using the stack to hold the context is definitely easier. However, even the layer approach needs to attach user data to the request to keep state accross function calls (e.g. mod_include needs to remember the "