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

Piotr Sikora piotrsikora at google.com
Wed Apr 5 12:33:45 UTC 2017


Hey,

> # HG changeset patch
> # User Piotr Sikora <piotrsikora at google.com>
> # Date 1490351854 25200
> #      Fri Mar 24 03:37:34 2017 -0700
> # Node ID 8af81a0d66c0f69bcf501edcf10deed4c8f7fbd4
> # Parent  39ff6939266e913e8bfd400e60f9520e70725a4d
> HTTP: add support for trailers in HTTP responses.
>
> Example:
>
>    ngx_table_elt_t  *h;
>
>    h = ngx_list_push(&r->headers_out.trailers);
>    if (h == NULL) {
>        return NGX_ERROR;
>    }
>
>    ngx_str_set(&h->key, "Fun");
>    ngx_str_set(&h->value, "with trailers");
>    h->hash = ngx_hash_key_lc(h->key.data, h->key.len);
>
> The code above adds "Fun: with trailers" trailer to the response to
> the request with "TE: trailers" header (which indicates support for
> trailers).
>
> Modules that want to emit trailers must set r->expect_trailers = 1,
> otherwise they are going to be ignored.
>
> This change also adds $sent_trailer_* variables.
>
> Signed-off-by: Piotr Sikora <piotrsikora at google.com>

Ping.

Best regards,
Piotr Sikora


More information about the nginx-devel mailing list