Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 16857 invoked from network); 15 Oct 2006 21:47:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Oct 2006 21:47:58 -0000 Received: (qmail 4913 invoked by uid 500); 15 Oct 2006 21:47:58 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 4877 invoked by uid 500); 15 Oct 2006 21:47: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 4867 invoked by uid 99); 15 Oct 2006 21:47:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Oct 2006 14:47:57 -0700 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [193.165.253.198] (HELO router.ktorech.net) (193.165.253.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Oct 2006 14:47:57 -0700 Received: from [10.14.0.113] (helo=localhost.localdomain) by router.ktorech.net with esmtp (Exim 4.50) id 1GZDpV-0004gW-Q2 for modules-dev@httpd.apache.org; Sun, 15 Oct 2006 23:47:33 +0200 Received: from jeword by localhost.localdomain with local (Exim 4.63) (envelope-from ) id 1GZDpX-0003kj-Oy for modules-dev@httpd.apache.org; Sun, 15 Oct 2006 23:47:35 +0200 Date: Sun, 15 Oct 2006 23:47:35 +0200 From: Vlastimil Pavicek To: modules-dev@httpd.apache.org Subject: Re: Traversing the bucket brigade from last to first in the output filter Message-ID: <20061015214735.GA13526@shi> Mail-Followup-To: modules-dev@httpd.apache.org References: <20061014092317.GA5420@shi> <200610141140.26050.nick@webthing.com> <20061014202046.GA13508@shi> <200610152054.46062.nick@webthing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200610152054.46062.nick@webthing.com> X-ICQ: 316944760 User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thank you for your reply, I will try to answer your questions. > > I got following for the first bucket in this brigade just when I got it: > > APR_BUCKET_IS_FILE -> 1 > > OK, a static file. > > > There are two buckets sized 18567 and 0. > > FILE + EOS. > > > > > b=APR_BRIGADE_LAST(bb); > > > > > > If we hypothesize that your input was a single bucket, then it's > > > 3*100 + LAST. And what's wrong is the size of LAST at this point. > > > Is LAST by any chance a Heap bucket? > > So how exactly did you read that last bucket, and what exactly > did the read function return? Perhaps you could put your demo > source code up where we can look at it. Source code is at http://www.volny.cz/jeword/a/mod_txt.c Some of you might not see this code for the first time :) The problematic traversal starts at line 222. > > LAST (size 0): > > APR_BUCKET_IS_METADATA -> 1 > > APR_BUCKET_IS_EOS -> 1 > > > > LAST->PREV (size 8000) > > APR_BUCKET_IS_HEAP -> 1 > > I'd guess that's *after* reading it? What does it look like before? Before reading: LAST (size 0): APR_BUCKET_IS_METADATA -> 1 APR_BUCKET_IS_EOS -> 1 LAST->PREV (size 8000): APR_BUCKET_IS_FILE -> 1 LAST->PREV->PREV (size 100): APR_BUCKET_IS_FILE -> 1 LAST->PREV->PREV->PREV (size 100): APR_BUCKET_IS_FILE -> 1 LAST->PREV->PREV->PREV->PREV (size 100): APR_BUCKET_IS_FILE -> 1 The brigade stays truncated. Thank to all for their effort, I look forward to the explanation Vlastimil Pavicek, CTU Prague