Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_uwsgi_module.c @ 6053:b6eb6ec4fbd9
Upstream: uwsgi_request_buffering, scgi_request_buffering.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 23 Mar 2015 21:09:19 +0300 |
parents | 610832763648 |
children | b2899e7d0ef8 |
comparison
equal
deleted
inserted
replaced
6052:8ad78808a612 | 6053:b6eb6ec4fbd9 |
---|---|
176 { ngx_string("uwsgi_buffering"), | 176 { ngx_string("uwsgi_buffering"), |
177 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 177 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
178 ngx_conf_set_flag_slot, | 178 ngx_conf_set_flag_slot, |
179 NGX_HTTP_LOC_CONF_OFFSET, | 179 NGX_HTTP_LOC_CONF_OFFSET, |
180 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffering), | 180 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffering), |
181 NULL }, | |
182 | |
183 { ngx_string("uwsgi_request_buffering"), | |
184 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
185 ngx_conf_set_flag_slot, | |
186 NGX_HTTP_LOC_CONF_OFFSET, | |
187 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.request_buffering), | |
181 NULL }, | 188 NULL }, |
182 | 189 |
183 { ngx_string("uwsgi_ignore_client_abort"), | 190 { ngx_string("uwsgi_ignore_client_abort"), |
184 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 191 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
185 ngx_conf_set_flag_slot, | 192 ngx_conf_set_flag_slot, |
669 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 676 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
670 } | 677 } |
671 | 678 |
672 u->pipe->input_filter = ngx_event_pipe_copy_input_filter; | 679 u->pipe->input_filter = ngx_event_pipe_copy_input_filter; |
673 u->pipe->input_ctx = r; | 680 u->pipe->input_ctx = r; |
681 | |
682 if (!uwcf->upstream.request_buffering | |
683 && uwcf->upstream.pass_request_body | |
684 && !r->headers_in.chunked) | |
685 { | |
686 r->request_body_no_buffering = 1; | |
687 } | |
674 | 688 |
675 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); | 689 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); |
676 | 690 |
677 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { | 691 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { |
678 return rc; | 692 return rc; |
1066 } | 1080 } |
1067 | 1081 |
1068 b->last = ngx_copy(b->last, uwcf->uwsgi_string.data, | 1082 b->last = ngx_copy(b->last, uwcf->uwsgi_string.data, |
1069 uwcf->uwsgi_string.len); | 1083 uwcf->uwsgi_string.len); |
1070 | 1084 |
1071 if (uwcf->upstream.pass_request_body) { | 1085 if (r->request_body_no_buffering) { |
1086 r->upstream->request_bufs = cl; | |
1087 | |
1088 } else if (uwcf->upstream.pass_request_body) { | |
1072 body = r->upstream->request_bufs; | 1089 body = r->upstream->request_bufs; |
1073 r->upstream->request_bufs = cl; | 1090 r->upstream->request_bufs = cl; |
1074 | 1091 |
1075 while (body) { | 1092 while (body) { |
1076 b = ngx_alloc_buf(r->pool); | 1093 b = ngx_alloc_buf(r->pool); |
1366 | 1383 |
1367 conf->upstream.store = NGX_CONF_UNSET; | 1384 conf->upstream.store = NGX_CONF_UNSET; |
1368 conf->upstream.store_access = NGX_CONF_UNSET_UINT; | 1385 conf->upstream.store_access = NGX_CONF_UNSET_UINT; |
1369 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; | 1386 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; |
1370 conf->upstream.buffering = NGX_CONF_UNSET; | 1387 conf->upstream.buffering = NGX_CONF_UNSET; |
1388 conf->upstream.request_buffering = NGX_CONF_UNSET; | |
1371 conf->upstream.ignore_client_abort = NGX_CONF_UNSET; | 1389 conf->upstream.ignore_client_abort = NGX_CONF_UNSET; |
1372 conf->upstream.force_ranges = NGX_CONF_UNSET; | 1390 conf->upstream.force_ranges = NGX_CONF_UNSET; |
1373 | 1391 |
1374 conf->upstream.local = NGX_CONF_UNSET_PTR; | 1392 conf->upstream.local = NGX_CONF_UNSET_PTR; |
1375 | 1393 |
1461 ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries, | 1479 ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries, |
1462 prev->upstream.next_upstream_tries, 0); | 1480 prev->upstream.next_upstream_tries, 0); |
1463 | 1481 |
1464 ngx_conf_merge_value(conf->upstream.buffering, | 1482 ngx_conf_merge_value(conf->upstream.buffering, |
1465 prev->upstream.buffering, 1); | 1483 prev->upstream.buffering, 1); |
1484 | |
1485 ngx_conf_merge_value(conf->upstream.request_buffering, | |
1486 prev->upstream.request_buffering, 1); | |
1466 | 1487 |
1467 ngx_conf_merge_value(conf->upstream.ignore_client_abort, | 1488 ngx_conf_merge_value(conf->upstream.ignore_client_abort, |
1468 prev->upstream.ignore_client_abort, 0); | 1489 prev->upstream.ignore_client_abort, 0); |
1469 | 1490 |
1470 ngx_conf_merge_value(conf->upstream.force_ranges, | 1491 ngx_conf_merge_value(conf->upstream.force_ranges, |