Welcome! Log In Create A New Profile

Advanced

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

shuxinyang
June 27, 2016 06:04PM
Hi, Piotr:

I took some time to read your code, I believe I fully understand
your code at this moment.
My implementation is slightly differently from yours, and we have
different use-cases.

Here is my $0.02 value of comment to your code (cosmetic wise):
- the verb "support" in "trailer support" in too general. The
trailer-support in my mind include
a long list of features (see bellow)

- the "get" in "ngx_http_chunked_get_trailers" is sort of
misleading. The "get" here actually
means "generate". I thought you are looking for a existing buffer.

Now go back to the long list of trailer support, I believe it needs
to cover at least:
1) generate trailer headers and sent to downstream/visitor as you
just did
2) reverse proxy propagate trailer headers from upstream, which needs
2.0 parse the incoming trailer header, both considering the
body is buffered and not buffered,
2.1. make the incoming trailer accessible via variable after
content phase,
2.2. if response body is is not buffered, combine incoming
trailer header with the generated headers.
2.3. convert incoming trailer to regular header if response
body is buffered

3|4|..|n) other features.

I think 2.x is much harder than 1). I only implement 1) and 2.0) and
2.1). While implement 2.1), I left some
room for 2.2 and 2.3 for the future. Now that you have plan for 2.x as
your email suggests, wouldn't it
be nice to submit these code first, and then go ahead with the code of
1). I believe to support 2.2 or 2.3,
your existing code in chunk module needs lots of change.

Thanks
Shuxin


On 06/27/2016 12:14 PM, Piotr Sikora wrote:
> Hey Shuxin,
>
>> 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.
> Did you look at both patches I've sent?
> http://mailman.nginx.org/pipermail/nginx-devel/2016-June/008429.html
> http://mailman.nginx.org/pipermail/nginx-devel/2016-June/008430.html
>
> Because they cover much more than just adding "Trailer" header.
>
>> TE is for something
>> else as Maxim pointed out,
>> and adding this header can be done in chunked-filter-module as well.
> "TE" is a _request_ header, so I don't see how adding it to response
> is relevant here.
>
> And yes, "TE" header could be parsed in chunked filter, but it's IMHO
> wrong place to do it, since you need to parse this header in HTTP/2
> requests 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.
> Does you implementation support trailers in HTTP/2 as well?
>
> Best regards,
> Piotr Sikora
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

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

Piotr Sikora 928 June 26, 2016 07:14PM

[PATCH 2 of 2] Headers filter: add "add_trailer" directive

Piotr Sikora 424 June 26, 2016 07:14PM

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

Maxim Dounin 381 June 27, 2016 09:46AM

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

Piotr Sikora 388 June 27, 2016 10:38AM

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

shuxinyang 457 June 27, 2016 01:06PM

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

Piotr Sikora 362 June 27, 2016 01:14PM

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

shuxinyang 382 June 27, 2016 02:56PM

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

Piotr Sikora 476 June 27, 2016 03:16PM

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

shuxinyang 391 June 27, 2016 06:04PM

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

Piotr Sikora 357 June 27, 2016 07:18PM

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

shuxinyang 362 June 27, 2016 09:00PM

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

Piotr Sikora 329 June 27, 2016 09:46PM

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

Maxim Dounin 367 June 27, 2016 01:54PM

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

Piotr Sikora 368 June 27, 2016 03:06PM

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

Piotr Sikora 336 June 30, 2016 03:58PM

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

Maxim Dounin 374 July 04, 2016 10:22AM

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

Piotr Sikora 369 July 06, 2016 05:04PM

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

Maxim Dounin 355 July 07, 2016 11:02AM

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

Piotr Sikora 337 July 07, 2016 04:10PM

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

Maxim Dounin 342 July 07, 2016 07:22PM

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

Piotr Sikora 393 July 13, 2016 01:28PM

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

Maxim Dounin 406 July 13, 2016 02:44PM

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

Piotr Sikora 314 July 13, 2016 08:36PM

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

Alexey Ivanov 338 July 20, 2016 06:36PM

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

Maxim Dounin 318 July 20, 2016 09:24PM

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

Alexey Ivanov 347 July 20, 2016 09:34PM

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

Maxim Dounin 422 July 21, 2016 09:46AM

[PATCH] HTTP: add support for trailers in HTTP responses

Piotr Sikora 324 August 01, 2016 01:00AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Piotr Sikora 312 August 01, 2016 03:36AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Maxim Dounin 284 August 01, 2016 09:24AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Piotr Sikora 444 August 01, 2016 01:58PM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Maxim Dounin 342 August 03, 2016 10:26PM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Piotr Sikora 298 August 18, 2016 09:14PM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Valentin V. Bartenev 293 August 19, 2016 07:16AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Maxim Dounin 295 August 23, 2016 11:00AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Maxim Dounin 510 August 23, 2016 10:24AM

Re: [PATCH] HTTP: add support for trailers in HTTP responses

Piotr Sikora 973 August 31, 2016 09:32PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 84
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready