Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 97235 invoked from network); 10 Apr 2007 06:20:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Apr 2007 06:20:52 -0000 Received: (qmail 59894 invoked by uid 500); 10 Apr 2007 06:20:59 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 59658 invoked by uid 500); 10 Apr 2007 06:20:58 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 59649 invoked by uid 99); 10 Apr 2007 06:20:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 23:20:58 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [199.203.54.245] (HELO vl654.host245.netvision.net.il) (199.203.54.245) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 23:20:51 -0700 Received: from [192.168.2.115] (bzq-88-154-105-253.red.bezeqint.net [88.154.105.253]) (authenticated bits=0) by mail1.mirimar.net (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id l3A6KMqM031900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 10 Apr 2007 09:20:23 +0300 Message-ID: <461B2CA6.50406@beamartyr.net> Date: Tue, 10 Apr 2007 09:20:22 +0300 From: Issac Goldstand Organization: Mirimar Networks User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: server side includes References: <8d38ca0a0704091257ledcea7aj5d3e3a6e834871f0@mail.gmail.com> <461AA2A4.7010909@beamartyr.net> <20070409222556.20d6f669@grimnir> In-Reply-To: <20070409222556.20d6f669@grimnir> X-Enigmail-Version: 0.94.2.0 OpenPGP: url=http://www.beamartyr.net/pubkey.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.90.1/3058/Mon Apr 9 22:45:50 2007 on hector.mirimar.net X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Nick Kew wrote: > On Mon, 09 Apr 2007 23:31:32 +0300 > Issac Goldstand wrote: > >> You'd probably just use output filters to parse the output stream and >> add content according to what you find... I don't have a C example, >> but do have a Perl example (string parsing is just soooo much more >> trivial with Perl than C) at >> http://search.cpan.org/src/ISAAC/Apache-UploadMeter-0.9915/lib/Apache/UploadMeter.pm >> (search for "### Output filters"). One replaces a "custom" tag, and >> one simply includes HTML at the beginning of > > You can't just do that in any language unless you make a BIG performance > sacrifice. The basic problem is that "", or any other pattern of > more than one byte, might be split over more than one call to your > filter function. Techniques for dealing with that are of course > described in my book. I do consider that. After reading the buckets (And before analyzing them), I do $buf = ${$f->ctx}{leftover}.$buf if defined(${$f->ctx}{leftover}); (prepend f->ctx->leftover onto buf) and anything leftover that doesn't include a full HTML tag goes to ${$f->ctx}{leftover} = $buf || undef; Of course, if we had a big resource with no HTML, we'd be in pretty big trouble as everything would go into leftover, but this particular module doesn't, in general, need to deal with that particular problem - at least not where this filter might be injected. > > >> Sam Carleton wrote: >>> As I sit here on hold, I started thinking about my little apache >>> module again. I recall reading in "Writing Apache Modules in Perl >>> and C" how with Perl it is quick and easy to create a server side > > That book is very, very old. Apache 1.x didn't have filters, so > SSI was altogether more primitive. > >>> include handler, I think that is what it was called. How would one >>> go about doing that in a C module? Are there any examples? > > ... and I don't know what it refers to as an SSI handler (I expect > a primitive mod_include alternative). > It is exactly that, IIRC. It's been a few years since I read the eagle book. Issac