Mercurial > hg > nginx
comparison src/http/modules/ngx_http_scgi_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 | a93345ee8f52 |
comparison
equal
deleted
inserted
replaced
6052:8ad78808a612 | 6053:b6eb6ec4fbd9 |
---|---|
116 { ngx_string("scgi_buffering"), | 116 { ngx_string("scgi_buffering"), |
117 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 117 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
118 ngx_conf_set_flag_slot, | 118 ngx_conf_set_flag_slot, |
119 NGX_HTTP_LOC_CONF_OFFSET, | 119 NGX_HTTP_LOC_CONF_OFFSET, |
120 offsetof(ngx_http_scgi_loc_conf_t, upstream.buffering), | 120 offsetof(ngx_http_scgi_loc_conf_t, upstream.buffering), |
121 NULL }, | |
122 | |
123 { ngx_string("scgi_request_buffering"), | |
124 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | |
125 ngx_conf_set_flag_slot, | |
126 NGX_HTTP_LOC_CONF_OFFSET, | |
127 offsetof(ngx_http_scgi_loc_conf_t, upstream.request_buffering), | |
121 NULL }, | 128 NULL }, |
122 | 129 |
123 { ngx_string("scgi_ignore_client_abort"), | 130 { ngx_string("scgi_ignore_client_abort"), |
124 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 131 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
125 ngx_conf_set_flag_slot, | 132 ngx_conf_set_flag_slot, |
501 return NGX_HTTP_INTERNAL_SERVER_ERROR; | 508 return NGX_HTTP_INTERNAL_SERVER_ERROR; |
502 } | 509 } |
503 | 510 |
504 u->pipe->input_filter = ngx_event_pipe_copy_input_filter; | 511 u->pipe->input_filter = ngx_event_pipe_copy_input_filter; |
505 u->pipe->input_ctx = r; | 512 u->pipe->input_ctx = r; |
513 | |
514 if (!scf->upstream.request_buffering | |
515 && scf->upstream.pass_request_body | |
516 && !r->headers_in.chunked) | |
517 { | |
518 r->request_body_no_buffering = 1; | |
519 } | |
506 | 520 |
507 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); | 521 rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init); |
508 | 522 |
509 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { | 523 if (rc >= NGX_HTTP_SPECIAL_RESPONSE) { |
510 return rc; | 524 return rc; |
863 } | 877 } |
864 } | 878 } |
865 | 879 |
866 *b->last++ = (u_char) ','; | 880 *b->last++ = (u_char) ','; |
867 | 881 |
868 if (scf->upstream.pass_request_body) { | 882 if (r->request_body_no_buffering) { |
883 r->upstream->request_bufs = cl; | |
884 | |
885 } else if (scf->upstream.pass_request_body) { | |
869 body = r->upstream->request_bufs; | 886 body = r->upstream->request_bufs; |
870 r->upstream->request_bufs = cl; | 887 r->upstream->request_bufs = cl; |
871 | 888 |
872 while (body) { | 889 while (body) { |
873 b = ngx_alloc_buf(r->pool); | 890 b = ngx_alloc_buf(r->pool); |
1160 | 1177 |
1161 conf->upstream.store = NGX_CONF_UNSET; | 1178 conf->upstream.store = NGX_CONF_UNSET; |
1162 conf->upstream.store_access = NGX_CONF_UNSET_UINT; | 1179 conf->upstream.store_access = NGX_CONF_UNSET_UINT; |
1163 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; | 1180 conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT; |
1164 conf->upstream.buffering = NGX_CONF_UNSET; | 1181 conf->upstream.buffering = NGX_CONF_UNSET; |
1182 conf->upstream.request_buffering = NGX_CONF_UNSET; | |
1165 conf->upstream.ignore_client_abort = NGX_CONF_UNSET; | 1183 conf->upstream.ignore_client_abort = NGX_CONF_UNSET; |
1166 conf->upstream.force_ranges = NGX_CONF_UNSET; | 1184 conf->upstream.force_ranges = NGX_CONF_UNSET; |
1167 | 1185 |
1168 conf->upstream.local = NGX_CONF_UNSET_PTR; | 1186 conf->upstream.local = NGX_CONF_UNSET_PTR; |
1169 | 1187 |
1247 ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries, | 1265 ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries, |
1248 prev->upstream.next_upstream_tries, 0); | 1266 prev->upstream.next_upstream_tries, 0); |
1249 | 1267 |
1250 ngx_conf_merge_value(conf->upstream.buffering, | 1268 ngx_conf_merge_value(conf->upstream.buffering, |
1251 prev->upstream.buffering, 1); | 1269 prev->upstream.buffering, 1); |
1270 | |
1271 ngx_conf_merge_value(conf->upstream.request_buffering, | |
1272 prev->upstream.request_buffering, 1); | |
1252 | 1273 |
1253 ngx_conf_merge_value(conf->upstream.ignore_client_abort, | 1274 ngx_conf_merge_value(conf->upstream.ignore_client_abort, |
1254 prev->upstream.ignore_client_abort, 0); | 1275 prev->upstream.ignore_client_abort, 0); |
1255 | 1276 |
1256 ngx_conf_merge_value(conf->upstream.force_ranges, | 1277 ngx_conf_merge_value(conf->upstream.force_ranges, |