Stream: renamed rate limiting directives.
The directive proxy_downstream_limit_rate is now called proxy_upload_rate.
The directive proxy_upstream_limit_rate is now called proxy_download_rate.
Roman Arutyunyan
6 years ago
17 | 17 | ngx_msec_t timeout; |
18 | 18 | ngx_msec_t next_upstream_timeout; |
19 | 19 | size_t downstream_buf_size; |
20 | size_t downstream_limit_rate; | |
20 | size_t upload_rate; | |
21 | 21 | size_t upstream_buf_size; |
22 | size_t upstream_limit_rate; | |
22 | size_t download_rate; | |
23 | 23 | ngx_uint_t next_upstream_tries; |
24 | 24 | ngx_flag_t next_upstream; |
25 | 25 | ngx_flag_t proxy_protocol; |
133 | 133 | offsetof(ngx_stream_proxy_srv_conf_t, downstream_buf_size), |
134 | 134 | NULL }, |
135 | 135 | |
136 | { ngx_string("proxy_downstream_limit_rate"), | |
136 | { ngx_string("proxy_upload_rate"), | |
137 | 137 | NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1, |
138 | 138 | ngx_conf_set_size_slot, |
139 | 139 | NGX_STREAM_SRV_CONF_OFFSET, |
140 | offsetof(ngx_stream_proxy_srv_conf_t, downstream_limit_rate), | |
140 | offsetof(ngx_stream_proxy_srv_conf_t, upload_rate), | |
141 | 141 | NULL }, |
142 | 142 | |
143 | 143 | { ngx_string("proxy_upstream_buffer"), |
147 | 147 | offsetof(ngx_stream_proxy_srv_conf_t, upstream_buf_size), |
148 | 148 | NULL }, |
149 | 149 | |
150 | { ngx_string("proxy_upstream_limit_rate"), | |
150 | { ngx_string("proxy_download_rate"), | |
151 | 151 | NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1, |
152 | 152 | ngx_conf_set_size_slot, |
153 | 153 | NGX_STREAM_SRV_CONF_OFFSET, |
154 | offsetof(ngx_stream_proxy_srv_conf_t, upstream_limit_rate), | |
154 | offsetof(ngx_stream_proxy_srv_conf_t, download_rate), | |
155 | 155 | NULL }, |
156 | 156 | |
157 | 157 | { ngx_string("proxy_next_upstream"), |
1009 | 1009 | src = pc; |
1010 | 1010 | dst = c; |
1011 | 1011 | b = &u->upstream_buf; |
1012 | limit_rate = pscf->upstream_limit_rate; | |
1012 | limit_rate = pscf->download_rate; | |
1013 | 1013 | received = &u->received; |
1014 | 1014 | |
1015 | 1015 | } else { |
1016 | 1016 | src = c; |
1017 | 1017 | dst = pc; |
1018 | 1018 | b = &u->downstream_buf; |
1019 | limit_rate = pscf->downstream_limit_rate; | |
1019 | limit_rate = pscf->upload_rate; | |
1020 | 1020 | received = &s->received; |
1021 | 1021 | } |
1022 | 1022 | |
1295 | 1295 | conf->timeout = NGX_CONF_UNSET_MSEC; |
1296 | 1296 | conf->next_upstream_timeout = NGX_CONF_UNSET_MSEC; |
1297 | 1297 | conf->downstream_buf_size = NGX_CONF_UNSET_SIZE; |
1298 | conf->downstream_limit_rate = NGX_CONF_UNSET_SIZE; | |
1298 | conf->upload_rate = NGX_CONF_UNSET_SIZE; | |
1299 | 1299 | conf->upstream_buf_size = NGX_CONF_UNSET_SIZE; |
1300 | conf->upstream_limit_rate = NGX_CONF_UNSET_SIZE; | |
1300 | conf->download_rate = NGX_CONF_UNSET_SIZE; | |
1301 | 1301 | conf->next_upstream_tries = NGX_CONF_UNSET_UINT; |
1302 | 1302 | conf->next_upstream = NGX_CONF_UNSET; |
1303 | 1303 | conf->proxy_protocol = NGX_CONF_UNSET; |
1334 | 1334 | ngx_conf_merge_size_value(conf->downstream_buf_size, |
1335 | 1335 | prev->downstream_buf_size, 16384); |
1336 | 1336 | |
1337 | ngx_conf_merge_size_value(conf->downstream_limit_rate, | |
1338 | prev->downstream_limit_rate, 0); | |
1337 | ngx_conf_merge_size_value(conf->upload_rate, | |
1338 | prev->upload_rate, 0); | |
1339 | 1339 | |
1340 | 1340 | ngx_conf_merge_size_value(conf->upstream_buf_size, |
1341 | 1341 | prev->upstream_buf_size, 16384); |
1342 | 1342 | |
1343 | ngx_conf_merge_size_value(conf->upstream_limit_rate, | |
1344 | prev->upstream_limit_rate, 0); | |
1343 | ngx_conf_merge_size_value(conf->download_rate, | |
1344 | prev->download_rate, 0); | |
1345 | 1345 | |
1346 | 1346 | ngx_conf_merge_uint_value(conf->next_upstream_tries, |
1347 | 1347 | prev->next_upstream_tries, 0); |