Request body: moved request body writing to save filter.
This commit is contained in:
parent
a573478150
commit
4a852ff21f
1 changed files with 8 additions and 14 deletions
|
@ -277,20 +277,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write to file */
|
|
||||||
|
|
||||||
if (ngx_http_write_request_body(r) != NGX_OK) {
|
|
||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* update chains */
|
|
||||||
|
|
||||||
rc = ngx_http_request_body_filter(r, NULL);
|
|
||||||
|
|
||||||
if (rc != NGX_OK) {
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rb->busy != NULL) {
|
if (rb->busy != NULL) {
|
||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1100,5 +1086,13 @@ ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
||||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rb->rest > 0
|
||||||
|
&& rb->buf && rb->buf->last == rb->buf->end)
|
||||||
|
{
|
||||||
|
if (ngx_http_write_request_body(r) != NGX_OK) {
|
||||||
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue