Klaus Demo nginx / 7ec559d
Upstream: uwsgi_request_buffering, scgi_request_buffering. Maxim Dounin 4 years ago
2 changed file(s) with 44 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
117117 ngx_conf_set_flag_slot,
118118 NGX_HTTP_LOC_CONF_OFFSET,
119119 offsetof(ngx_http_scgi_loc_conf_t, upstream.buffering),
120 NULL },
121
122 { ngx_string("scgi_request_buffering"),
123 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
124 ngx_conf_set_flag_slot,
125 NGX_HTTP_LOC_CONF_OFFSET,
126 offsetof(ngx_http_scgi_loc_conf_t, upstream.request_buffering),
120127 NULL },
121128
122129 { ngx_string("scgi_ignore_client_abort"),
502509
503510 u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
504511 u->pipe->input_ctx = r;
512
513 if (!scf->upstream.request_buffering
514 && scf->upstream.pass_request_body
515 && !r->headers_in.chunked)
516 {
517 r->request_body_no_buffering = 1;
518 }
505519
506520 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
507521
864878
865879 *b->last++ = (u_char) ',';
866880
867 if (scf->upstream.pass_request_body) {
881 if (r->request_body_no_buffering) {
882 r->upstream->request_bufs = cl;
883
884 } else if (scf->upstream.pass_request_body) {
868885 body = r->upstream->request_bufs;
869886 r->upstream->request_bufs = cl;
870887
11611178 conf->upstream.store_access = NGX_CONF_UNSET_UINT;
11621179 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
11631180 conf->upstream.buffering = NGX_CONF_UNSET;
1181 conf->upstream.request_buffering = NGX_CONF_UNSET;
11641182 conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
11651183 conf->upstream.force_ranges = NGX_CONF_UNSET;
11661184
12481266
12491267 ngx_conf_merge_value(conf->upstream.buffering,
12501268 prev->upstream.buffering, 1);
1269
1270 ngx_conf_merge_value(conf->upstream.request_buffering,
1271 prev->upstream.request_buffering, 1);
12511272
12521273 ngx_conf_merge_value(conf->upstream.ignore_client_abort,
12531274 prev->upstream.ignore_client_abort, 0);
177177 ngx_conf_set_flag_slot,
178178 NGX_HTTP_LOC_CONF_OFFSET,
179179 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffering),
180 NULL },
181
182 { ngx_string("uwsgi_request_buffering"),
183 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
184 ngx_conf_set_flag_slot,
185 NGX_HTTP_LOC_CONF_OFFSET,
186 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.request_buffering),
180187 NULL },
181188
182189 { ngx_string("uwsgi_ignore_client_abort"),
670677
671678 u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
672679 u->pipe->input_ctx = r;
680
681 if (!uwcf->upstream.request_buffering
682 && uwcf->upstream.pass_request_body
683 && !r->headers_in.chunked)
684 {
685 r->request_body_no_buffering = 1;
686 }
673687
674688 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
675689
10671081 b->last = ngx_copy(b->last, uwcf->uwsgi_string.data,
10681082 uwcf->uwsgi_string.len);
10691083
1070 if (uwcf->upstream.pass_request_body) {
1084 if (r->request_body_no_buffering) {
1085 r->upstream->request_bufs = cl;
1086
1087 } else if (uwcf->upstream.pass_request_body) {
10711088 body = r->upstream->request_bufs;
10721089 r->upstream->request_bufs = cl;
10731090
13671384 conf->upstream.store_access = NGX_CONF_UNSET_UINT;
13681385 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
13691386 conf->upstream.buffering = NGX_CONF_UNSET;
1387 conf->upstream.request_buffering = NGX_CONF_UNSET;
13701388 conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
13711389 conf->upstream.force_ranges = NGX_CONF_UNSET;
13721390
14621480
14631481 ngx_conf_merge_value(conf->upstream.buffering,
14641482 prev->upstream.buffering, 1);
1483
1484 ngx_conf_merge_value(conf->upstream.request_buffering,
1485 prev->upstream.request_buffering, 1);
14651486
14661487 ngx_conf_merge_value(conf->upstream.ignore_client_abort,
14671488 prev->upstream.ignore_client_abort, 0);