I wrote here earlier about using ap_run_sub_req to send a response to a client, and I receieved excellent advice, thank you. There is one thing I was wondering. I see that the Encoding is chunked. I would prefer to set the Content-Length to the correct length, rather than use chunked encoding. How can I do this (other than reading the brigades, then running ap_set_content)?
You don't really have the ability to directly control this.
The content-length filter in combination with ap_set_keepalive determine whether chunking is used. Generally speaking, if the first ap_pass_brigade call contains the EOS, Content-Length will be sent. Otherwise, if the client is HTTP/1.1, it'll use chunking. If it is HTTP/1.0, then Connection: Close will be used.
Note that HTTP/1.1 mandates support for chunked-encoding. If the client does not use HTTP/1.0, chunked support will not be sent. -- justin
