Chunking Encoding
November 03, 2020 06:12PM
Hi all,

What is the proper way to return an empty chunk for a middle sub-request when chunking encoding is enabled for a NGINX filter?

Suppose a website is encoded into multiple chunks such that our http header/body filter is invoked like this:

Sub-request 1: static ngx_int_t HeaderFilter(ngx_http_request_t *r)
Sub-request 1: static ngx_int_t BodyFilter(ngx_http_request_t *r, ngx_chain_t *in)

Sub-request 2: static ngx_int_t BodyFilter(ngx_http_request_t *r, ngx_chain_t *in)

Sub-request 3: static ngx_int_t BodyFilter(ngx_http_request_t *r, ngx_chain_t *in)

Sub-request 4: static ngx_int_t BodyFilter(ngx_http_request_t *r, ngx_chain_t *in)

If we want Sub-request 2 to return nothing (e.g: We only want to store the input chain of Sub-request 2 to use together during sub-request 3), then what do we return as the output at the end of serving Sub-request 2?

Many thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
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