On Fri, Apr 23, 2010 at 11:25 AM, Brian J. France <[email protected]> wrote: > > On Apr 23, 2010, at 10:08 AM, William A. Rowe Jr. wrote: > >> On 4/23/2010 9:03 AM, Brian J. France wrote: >>> >>> You can build a module that is able to insert a trailer by adding a filter >>> and ap_hook_create_request call. >> >> But doesn't this defeat the purpose of using a modular server >> architecture? It seems this should be a facility of the core HTTP >> filter, if anyone wants to offer the patch for 2.3. > > > I agree, my module was more of a proof of concept that I can do it and then > get some other server to able able to use it. > > Not sure what the best solution would be because multiple things need to > happen. First part is you have to force chunk encoding either by removing > content_length filter or tweaking the code to not add it if doing a trailer > (which you might not know until it is time to insert a tailer). > > Then you have to tweak modules/http/chunk_filter.c to allow others to insert > a trailer, like adding a ap_hook_http_trailer or a optional function for > inserting it. I don't know if multiple modules should be allowed to add a > trailer, if you do how to you join them since a trailer is nothing but a > string ending with ASCII_CRLF (just strcat?). Should we just grab > r->notes['http_trailer'] and let modules just add/set/append values? > > I think there is a bigger design discussion that should happen, but I might > have a patch down the road as a starter if all goes well at work.
This is probably naive, but something to take pot shots at... use r->trailers_out non-empty r->trailers_out could force chunked encoding, as well as convey the trailers themselves 500 error if trailers set by the time chunking decision is made and caller can't handle consider logging msg if trailers found after response already started but trailers can't be sent for some reason (i.e., output filter adds trailer but trailers can't be sent) suppress-trailers or similar envvar probably needed for problematic clients
