Welcome! Log In Create A New Profile

Advanced

Upstream module usage to process data

May 29, 2017 06:04AM
Hi All,
I'm developing NGINX module which should read some binary data from upstream server, process it an send response to the user.
So to do it i'm using ngx_http_upstream API to create upstream request and get data. So the question is where is the right point to start processing of received chain of buffers and how to avoid call to ngx_http_output_filter from ngx_http_upstream_process_non_buffered_request?
I'm going to cal it by myself when data processing is finished.

During research i've tried to enable subrequest_in_memory flag to save all needed data for later processing
In upstream ngx_http_upstream_process_header there is a validation if subrequest is in memory
if (!r->subrequest_in_memory) {
ngx_http_upstream_send_response(r, u);
return;
}
When i enabled subrequest_in_memory flag i got an error "upstream buffer is too small to read response"
But in debugger i see that data are available in the upstream buffer. It looks for me that response is already saved. So how to explain such inconsistency?

Thank you in advance.
Subject Author Posted

Upstream module usage to process data

isolomka May 29, 2017 06:04AM

Re: Upstream module usage to process data

Maxim Dounin May 29, 2017 07:58AM

Re: Upstream module usage to process data

isolomka May 30, 2017 03:45AM

Re: Upstream module usage to process data

Maxim Dounin May 30, 2017 03:00PM

Re: Upstream module usage to process data

isolomka May 31, 2017 08:22AM

Re: Upstream module usage to process data

Maxim Dounin May 31, 2017 08:54AM

Re: Upstream module usage to process data

isolomka May 31, 2017 09:00AM

Re: Upstream module usage to process data

Maxim Dounin May 31, 2017 09:22AM

Re: Upstream module usage to process data

isolomka May 31, 2017 09:25AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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