Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED934F73D for ; Wed, 1 May 2013 14:20:54 +0000 (UTC) Received: (qmail 44380 invoked by uid 500); 1 May 2013 14:20:54 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 44272 invoked by uid 500); 1 May 2013 14:20:54 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 44263 invoked by uid 99); 1 May 2013 14:20:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 14:20:54 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of covener@gmail.com designates 209.85.212.41 as permitted sender) Received: from [209.85.212.41] (HELO mail-vb0-f41.google.com) (209.85.212.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 May 2013 14:20:48 +0000 Received: by mail-vb0-f41.google.com with SMTP id f13so1248236vbg.14 for ; Wed, 01 May 2013 07:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=TWbMsgaSm4tBipo5qsX5eY9Ow0NQCYZfZdqsBtWDz4Q=; b=K2g8FWjXKBKXZdJFp3UCZDcIGWXlffGRcbHMw7NGFx5HNIF3RhRJGfyURVNAkj36kj fYn7k7E6HwtTPOMknbtuzPlCJyk3liCAUpBZJ6JzH8wAJPQ3adihf4biNqDVDcUf5vX5 XgdxGh+lx2IM9FHQ9ImB/X5bSTo930cm2phd2b8xhFNXJU5GNc2S6JPfjc2ayTZqQei3 3gpdIQ+8sCOlzW8cKs4NGoA+KFp0+7+o7L06J/tMhIS5XPBUWKC7Nzcxfu0VjO7tx3Wo j0P2Bp5UeGRmEbLUkIjJ82ph0cGs4ZFybodKPETp4zKjACnqXkT5uNpwVB2RpuTXR9MC S4+A== MIME-Version: 1.0 X-Received: by 10.52.97.8 with SMTP id dw8mr762154vdb.91.1367418028146; Wed, 01 May 2013 07:20:28 -0700 (PDT) Received: by 10.58.234.5 with HTTP; Wed, 1 May 2013 07:20:28 -0700 (PDT) In-Reply-To: <51811A0C.5040604@yuhu.biz> References: <5180C2EE.4030407@yuhu.biz> <51811A0C.5040604@yuhu.biz> Date: Wed, 1 May 2013 10:20:28 -0400 Message-ID: Subject: Re: input filter problem From: Eric Covener To: Marian Marinov Cc: dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org > I understand that, however I don't understand how to make my module run the > input_filters without consuming the request. > > What I mean is that if I add the following, it will consume the actual > request. > > rv = ap_get_brigade(r->input_filters, bb, AP_MODE_READBYTES, > APR_BLOCK_READ, HUGE_STRING_LEN); > > if (rv != APR_SUCCESS) { > ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "Error reading > request entity data"); > return HTTP_INTERNAL_SERVER_ERROR; > } > > for (bucket = APR_BRIGADE_FIRST(bb); bucket != > APR_BRIGADE_SENTINEL(bb); bucket = APR_BUCKET_NEXT(bucket)) { > const char *data; > apr_size_t len; > > Do you have any suggestions? I didn't realize your handler returned DECLINED. Either it will run before the post body is read, or it will not run at all. You can't really write anything that runs before the real handler that also notices something your input filter will change. There is a module in 2.4 that allows the request body to be buffered, but I don't know much about it. http://httpd.apache.org/docs/trunk/mod/mod_buffer.html I guess it mostly depends on what you expect to do with the information outside of the filter. -- Eric Covener covener@gmail.com