Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 31176 invoked from network); 2 Apr 2009 13:45:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 13:45:17 -0000 Received: (qmail 76517 invoked by uid 500); 2 Apr 2009 13:45:17 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 76469 invoked by uid 500); 2 Apr 2009 13:45:16 -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 76458 invoked by uid 99); 2 Apr 2009 13:45:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 13:45:16 +0000 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 13:45:08 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LpNDq-0008V2-VX for modules-dev@httpd.apache.org; Thu, 02 Apr 2009 06:44:46 -0700 Message-ID: <22848174.post@talk.nabble.com> Date: Thu, 2 Apr 2009 06:44:46 -0700 (PDT) From: Xiaobin To: modules-dev@httpd.apache.org Subject: Re: About the order of the processing of the http request In-Reply-To: <20170a030904020512w7b25e4bdwc8fc4ef1e4d8ae38@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: xiaobinshe@gmail.com References: <22845761.post@talk.nabble.com> <20170a030904020512w7b25e4bdwc8fc4ef1e4d8ae38@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Sorin Manolache wrote: >=20 > On Thu, Apr 2, 2009 at 13:28, Xiaobin wrote: >> >> Hi, everyone. >> >> I new to modlue developemnt of the Apache http server, and I have google= d >> this question and can't find the answer. Hope you can help me. Thx. >> >> I am confused with the order of the processing of the http request. >> >> Without the input/output filters, the order seems quick clear, when one >> http >> request comes, it will go through different kinds of hooks like "map to >> storage", "fixups" and "handler". And we can set some handlers to deal >> with >> these hooks. >> >> But what's the order after the introduction of the filter mechanism=EF= =BC=9F >> >> When will the input filters begin to work? >> After the handlers of the fixups hook has been called and before the >> handlers of the "handler" hook begin to work? >> Or in some other order? >> And how can we specify the order of the input filters? >> >> And for the output filters, when did they begin to work? Before or after >> the >> "log transaction" hook ? >> And also how can we specify the order of the output filters? >> >> Thank you very much for your help! >=20 > There are several types of filters: network, protocol, connection, > resource (the list is not exhaustive, check util_filters.h in the > apache sources). >=20 > The input headers of the request are read after the create_request > hook and before the post_read_request, quick_handler, translate_name, > map_to_storage, header_parser, access_checker, ..., fixups, > insert_filter, and handler hooks. >=20 > The output headers of the request are written during the handler > execution. >=20 > When the headers are read/written, the protocol filters are called. >=20 > The resource input/output filters are called only when you explicitly > read/write the body of the request. If you add filters with the > SetInputFilter/SetOutputFilter directives, the filter is added in the > insert_filter hook. This one is called after fixups and before > handler. Thus, you cannot use a filter added with > SetInputFilter/SetOutputFilter before the handler hook. >=20 > log_transaction is called after the request was served and the > response was written to the socket and the socket flushed. >=20 > If the filters are of the same type, they are run in the order they > were added. If they are of different types, then I think their type > takes precedence, but I am not sure of that. For output filters, > resource filters are called before network filters. >=20 > S > --=20 > A: Because it reverses the logical flow of conversation. > Q: Why is top-posting frowned upon? > A: Top-posting. > Q: What is the most annoying thing in e-mail? >=20 >=20 Thank you very much! So, the resouce/content input filter will be called after fixups hook and before handler hook, is this right? If this is right, is it possible to make the input filter run earlier? Like after the translate_name hook and before the map_to_storage hook? And I am not so understand about this part: "Thus, you cannot use a filter added with SetInputFilter/SetOutputFilter before the handler hook." Do you mean that in the httpd.conf file, the SetHandler instruction should be set before the SetInputFilter/SetOutputFilter instructions ? --=20 View this message in context: http://www.nabble.com/About-the-order-of-the-= processing-of-the-http-request-tp22845761p22848174.html Sent from the Apache HTTP Server - Module Writers mailing list archive at N= abble.com.