[PATCH 1 of 2] HTTP: add support for trailers in HTTP responses

shuxinyang shuxinyang.oss at gmail.com
Mon Jun 27 18:53:00 UTC 2016

Hi, Piotr and Maxim:

 > to Maxim's question about "does trailer has real-world use" first.

At least we do, some info is available only after the entire body is 
sent. Trailer is a viable and convenient
solution for that matter, albeit it is not the only solution for it.  I 
cannot "leak" more info as I don't know if
I'm allowed say more about it. The bottom line is we did use trailer 
header in some situations.

To Piotr:

   > parsing of "TE" header is done in <somewhere>
   As far as I can understand, your change is just to add trailer 
headers (not including the part that paring incoming
trailer header from upstream, or merge the incoming trailer and 
generated trailer). If that is correct, you just need
to add "trailer: hdr1,hdr2...  hdrn" to the out-headers. TE is for 
something else as Maxim pointed out,
and adding this header can be done in chunked-filter-module as well.

   My previous implementation of generating trailer header is completely 
done in chunk-module.  Later on, I change
my mind, and add a standalone module along with minor change to 
configure script.


On 06/27/2016 10:13 AM, Piotr Sikora wrote:
> Hey Shuxin,
>>     I'm wondering why not just change the ngx_http_chunked_filter_module.c?
>> or add a module inserted right after the chunked-filter-module?
> Hmm...? I'm confused by your comment.
> This patch modifies 3 files:
> - parsing of "TE" header is done in ngx_http_request.c,
> - HTTP/1.1 trailers are handled in ngx_http_chunked_filter_module.c,
> - HTTP/2 trailers are handled in ngx_http_v2_filter_module.c.
> Are you suggesting that HTTP/2 trailers should be handled in
> ngx_http_chunked_filter_module.c?
> Best regards,
> Piotr Sikora
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel

More information about the nginx-devel mailing list