From modules-dev-return-178-apmail-httpd-modules-dev-archive=httpd.apache.org@httpd.apache.org Wed Nov 29 22:14:02 2006 Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 51978 invoked from network); 29 Nov 2006 22:14:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2006 22:14:02 -0000 Received: (qmail 7879 invoked by uid 500); 29 Nov 2006 22:14:10 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 7861 invoked by uid 500); 29 Nov 2006 22:14:10 -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 7852 invoked by uid 99); 29 Nov 2006 22:14:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Nov 2006 14:14:10 -0800 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 [80.229.52.226] (HELO grimnir.webthing.com) (80.229.52.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Nov 2006 14:13:59 -0800 Received: from grimnir.webthing.com (localhost [127.0.0.1]) by grimnir.webthing.com (Postfix) with ESMTP id 820B92136 for ; Wed, 29 Nov 2006 22:13:35 +0000 (GMT) Date: Wed, 29 Nov 2006 22:13:35 +0000 From: Nick Kew To: modules-dev@httpd.apache.org Subject: Re: One character per brigade? Message-ID: <20061129221335.58486b14@grimnir> In-Reply-To: <6BC4FD4291950A4A8C3A43237BDAC81C013854@emailmn.mqsoftware.com> References: <6BC4FD4291950A4A8C3A43237BDAC81C013854@emailmn.mqsoftware.com> Organization: WebThing X-Mailer: Sylpheed-Claws 2.5.0-rc3 (GTK+ 2.10.6; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, 29 Nov 2006 16:04:21 -0600 "Tess Flynn" wrote: > > If you're just examining the data but not modifying it, you don't > > want to mess about with new brigades. > > I was pointed in that direction by this post: > http://marc.theaimsgroup.com/?l=apache-modules&m=108029424904988&w=2 > > I was using the new brigade only as a buffer. Your original post didn't make it clear (to me) you had any good reason to buffer the data. > I could have done this > as a memory block within my ctx, but it didn't seem as efficient > given I didn't know how many buckets the request was broken across. > After I reached the end of the input, my plan was to run > apr_brigade_flatten() against the brigade buffer to get the final > string. If you need the complete data as a string, that's right. If you can avoid buffering the data, it's better. > I need to run an XPath against the content of both the > request and the reply, so I can't have an incomplete document. You don't run an XPath on a string; you run it on a DOM tree. Why not feed the incoming data directly into your XML parser rather than buffer a string? See for example mod_transform. > > Take a look at mod_diagnostics, which reports on exactly the data > > you're looking for, and might be a good startingpoint for your > > module. > > Maybe I'm missing the point, but I don't quite see how > mod_diagnostics will help me. It doesn't seem to gather the entire > request or reply, but operates on each bucket individually. That suggestion was for your task as it appeared before you mentioned buffering and XPath. -- Nick Kew Application Development with Apache - the Apache Modules Book http://www.apachetutor.org/