Welcome! Log In Create A New Profile

Advanced

Re: Nginx use temp file as request body in post subrequest

March 10, 2021 06:09PM
I guess we still need the request buf, so made these changes which seemed better. but the behavior is still same. Went though the code for upstream create request and looks like the body is always read from buffer.

ngx_buf_t *payload_buf = NULL;

payload_buf = ngx_create_temp_buf(r->pool, ctx->temp_buf_size);
if (payload_buf == NULL) {
ngx_log_stderr(0, "failed to ngx_create_temp_buf");
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
payload_buf->in_file = 1;
payload_buf->temp_file = 1;
payload_buf->file = &ctx->test_temp_file->file;

sr->request_body->buf = payload_buf;
sr->request_body->bufs->next = NULL;
sr->request_body->bufs->buf = payload_buf;
sr->header_only = 1;
//sr->filter_need_in_memory = 1;
Subject Author Posted

Nginx use temp file as request body in post subrequest

salmaanp March 10, 2021 02:49PM

Re: Nginx use temp file as request body in post subrequest

salmaanp March 10, 2021 06:09PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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