Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve conflicts with lua nginx module about request body #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion ngx_http_upload_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -3112,9 +3112,22 @@ ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
r->main->count++;
#endif

if (r->request_body || r->discard_body) {
//if (r->request_body || r->discard_body) {
if (r->discard_body) {
return NGX_OK;
}
//BOYD lua-nginx ngx.req.read_body() may already have request body
if (r->request_body)
{
if (ngx_http_process_request_body(r, r->request_body->bufs) != NGX_OK) {
upload_shutdown_ctx(u);
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}

upload_shutdown_ctx(u);

return ngx_http_upload_body_handler(r);
}

rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
if (rb == NULL) {
Expand Down