httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: Data are send in reverse order
Date Tue, 15 Sep 2009 09:07:06 GMT
Petr Hracek wrote:

> in my apache module (written in C) are sended data to the client side
> over buckets and brigades.
> Function for send these date is:
> apr_status_t send_data_to_client(request_rec *r, char * data_to_send,
> int length_data)
> {
>     apr_bucket_brigade * bb =
> apr_brigade_create(r->pool,r->connection->bucket_alloc);
>     apr_bucket * b =
> apr_bucket_immortal_create(data_to_send,length_data,r->connection->bucket_alloc);
>     APR_BRIGADE_INSERT_TAIL(bb,b);
>     ap_pass_brigade(r->connection->output_filters,bb);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     return OK;
> }
> 
> It is working but in the traces of application which receive the data
> from apache module the HTTP data are in reverse order.

At a quick glance, I would blame the line highlighted above - you are
trying to write your data directly to the connection filters, rather
than to the request filters. By doing that, your data is sent before the
request, not after, and so you see your data before the headers, not after.

Regards,
Graham
--

Mime
View raw message