Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 80079 invoked by uid 500); 2 Aug 2001 19:33:12 -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 80068 invoked from network); 2 Aug 2001 19:33:12 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Ryan Bloom Reply-To: rbb@covalent.net Organization: Covalent Technologies To: new-httpd@apache.org, Sapan.Bhatia@nokia.com Subject: Re: Persistent cgi...? Date: Thu, 2 Aug 2001 12:32:40 -0700 X-Mailer: KMail [version 1.2] References: <98C7D2E5BCD2374C9AAE0BCD2E9C1DD90535A7@esebe013.NOE.Nokia.com> In-Reply-To: <98C7D2E5BCD2374C9AAE0BCD2E9C1DD90535A7@esebe013.NOE.Nokia.com> MIME-Version: 1.0 Message-Id: <01080212324008.16100@koj.rkbloom.net> Content-Transfer-Encoding: 8bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Status: O X-Status: X-Keywords: X-UID: 65 The content-length filter handles this for you. Basically, the content-length filter reads from the pipe bucket until it doesn't get data. Once it doesn't get data, it flushes the data that it has, and waits for more data. IOW, you shouldn't have to do anything. :-) Ryan On Thursday 02 August 2001 04:44, Sapan.Bhatia@nokia.com wrote: > Hi, > > I need to write a module to accomodate persistent connections to > cgi-scripts for an http-like protocol in Apache 2.0... > > Is that sort of thing provided for in the CGI/1.1 spec? I've gone through > the specs and they don't say anything about a CGI (or for that matter any > server-side-scripting environment) scripts having to terminate before the > server actually pushes the output to the client... > So if I'm running a script that takes a finite amount of time to finish > processing a web of URLs in some way, then shouldn't it be able to give me > feedback AS the script processes the URLs? If so, then shouldn't there be > some sort of provision in mod_cgi? > > i.e., mod_cgi calls apr_bucket_pipe_create after a script has been run and > headers from stdout scanned, but the flush-bucket is passed AFTER this > pipe-bucket... which means that even if a script, that might run for > several minutes, might fflush(stdout) several times, output will still loop > about in core_output_filter in core.c... > > Is there any way of getting around this?? > > One way I could think of was to read the script output in cgi_handler and > call create_transient_bucket instead of a creating a piped bucket, but I > don't know how that'll affect performance... Also - is there some way for a > module to determine when a connection has been reset by the browser, so > that mod_cgi could actually kill the script when that happens? > > -Sapan -- _____________________________________________________________________________ Ryan Bloom rbb@apache.org Covalent Technologies rbb@covalent.net -----------------------------------------------------------------------------