httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiaobin <xiaobin...@gmail.com>
Subject Re: About the order of the processing of the http request
Date Thu, 02 Apr 2009 13:44:46 GMT



Sorin Manolache wrote:
> 
> On Thu, Apr 2, 2009 at 13:28, Xiaobin <xiaobinshe@gmail.com> wrote:
>>
>> Hi, everyone.
>>
>> I new to modlue developemnt of the Apache http server, and I have googled
>> 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´╝č
>>
>> 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!
> 
> There are several types of filters: network, protocol, connection,
> resource (the list is not exhaustive, check util_filters.h in the
> apache sources).
> 
> 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.
> 
> The output headers of the request are written during the handler
> execution.
> 
> When the headers are read/written, the protocol filters are called.
> 
> 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.
> 
> log_transaction is called after the request was served and the
> response was written to the socket and the socket flushed.
> 
> 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.
> 
> S
> -- 
> 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?
> 
> 


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 ?
-- 
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 Nabble.com.


Mime
View raw message