Skip to content
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