httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <>
Subject Re: Data are send in reverse order
Date Tue, 15 Sep 2009 10:58:56 GMT
Petr Hracek wrote:

> I do not understand of this thing.
> Could you please tell me if I have already connection between browser
> and apache server why I should use request_rec->output_filters instead
> of request_rec->connection->output_filters?
> I thought that if connection is established than request_rec->connection
> should be used, right?

Unfortunately not, no.

The HTTP protocol allows many requests to occur over the same
connection, and httpd models this by having a connection filter stack,
in which is created a per-request filter stack, one for each request.

The connection filter stack knows virtually nothing about HTTP, all the
filters that do know about HTTP - most specifically the filter that
writes headers - are part of the request filter stack.

If you write to the connection filter stack, you are bypassing all the
HTTP filters, and what you wrote appears on the socket immediately.
Later on in your code, something else is writing to the request filter
stack, and this causes the headers filter to output the headers, after
the data you've just written.


View raw message