From modules-dev-return-4096-apmail-httpd-modules-dev-archive=httpd.apache.org@httpd.apache.org Tue Sep 25 12:53:52 2012 Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D61FCD397 for ; Tue, 25 Sep 2012 12:53:52 +0000 (UTC) Received: (qmail 98073 invoked by uid 500); 25 Sep 2012 12:53:52 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 98042 invoked by uid 500); 25 Sep 2012 12:53:52 -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 98017 invoked by uid 99); 25 Sep 2012 12:53:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 12:53:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [195.190.10.232] (HELO mail.bulb.hr) (195.190.10.232) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 12:53:43 +0000 Received: from [192.168.100.38] ([141.138.11.38]) (authenticated bits=0) by mail.bulb.hr (5/8.14.4) with ESMTP id q8PCrLFW004918 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=OK) for ; Tue, 25 Sep 2012 14:53:22 +0200 Message-ID: <5061A8D6.1010607@bulb.hr> Date: Tue, 25 Sep 2012 14:51:34 +0200 From: Ivan Prostran User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120910 Thunderbird/15.0.1 MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: Input filters that alter content-length References: <5061924B.9070201@bulb.hr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on ravel.bulb.hr X-Old-Spam-Status: No, score=1.0 required=20.0 tests=ALL_TRUSTED, DATE_IN_FUTURE_96_Q autolearn=disabled version=3.3.1 On 09/25/12 14:04, Ben Noordhuis wrote: > On Tue, Sep 25, 2012 at 1:15 PM, Ivan Prostran wrote: >> Hi, >> >> I have the following scenario : >> >> - Apache/2.2.19 (Solaris 10 SPARC) >> >> SetInputFilter alterxmlbody (AP_FTYPE_RESOURCE) >> SetHandler weblogic-handler >> >> >> The handler forwards requests to multiple weblogic servers >> and the filter itself analyzes and/or changes the POST data >> in a way that the length of the incoming request may be changed. >> >> The question is : >> >> What is the proper and legitimate way to deal with this situation? >> >> >> Should the input filter set the new CL value in "headers_in" before >> returning from the callback, or just remove it from the list? >> >> >> apr_off_t length; >> apr_brigade_length (bb,1,&length); >> apr_table_setn(f->r->headers_in, "Content-Length", apr_off_t_toa(f->r->pool, >> length)); >> >> Unfortunately, this approach breaks the pipeline because sometimes >> the filter needs to buffer data over more than one call, but I do not >> consider this as a problem. >> >> or >> >> apr_table_unset(f->r->headers_in, "Content-Length"); > You didn't tell how your handler works (how it forwards the request) > but removing the Content-Length header is probably easiest. To my knowledge this can be done as follows: - When "ap_init_filter_func" callback is invoked (before the handler requests data from the client) - within "ap_in_filter_func" callback. I tried but it didn't help, infact it didn't work at all. > Does the > upstream server understand HTTP/1.1 or HTTP/1.0 with a TE header? Yes, It understands HTTP/1.1. Do you suggest chunked transfer encoding? Thanks for the help. Best regards, Ivan