[nginx] Stream: renamed rate limiting directives.

Roman Arutyunyan arut at nginx.com
Tue Jul 14 16:40:17 UTC 2015


details:   http://hg.nginx.org/nginx/rev/7a14a0d754ad
branches:  
changeset: 6208:7a14a0d754ad
user:      Roman Arutyunyan <arut at nginx.com>
date:      Tue Jul 14 09:38:13 2015 -0700
description:
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.

diffstat:

 src/stream/ngx_stream_proxy_module.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (91 lines):

diff -r 8bd97db72074 -r 7a14a0d754ad src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c	Tue Jul 14 10:13:51 2015 +0300
+++ b/src/stream/ngx_stream_proxy_module.c	Tue Jul 14 09:38:13 2015 -0700
@@ -18,9 +18,9 @@ typedef struct {
     ngx_msec_t                       timeout;
     ngx_msec_t                       next_upstream_timeout;
     size_t                           downstream_buf_size;
-    size_t                           downstream_limit_rate;
+    size_t                           upload_rate;
     size_t                           upstream_buf_size;
-    size_t                           upstream_limit_rate;
+    size_t                           download_rate;
     ngx_uint_t                       next_upstream_tries;
     ngx_flag_t                       next_upstream;
     ngx_flag_t                       proxy_protocol;
@@ -134,11 +134,11 @@ static ngx_command_t  ngx_stream_proxy_c
       offsetof(ngx_stream_proxy_srv_conf_t, downstream_buf_size),
       NULL },
 
-    { ngx_string("proxy_downstream_limit_rate"),
+    { ngx_string("proxy_upload_rate"),
       NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_size_slot,
       NGX_STREAM_SRV_CONF_OFFSET,
-      offsetof(ngx_stream_proxy_srv_conf_t, downstream_limit_rate),
+      offsetof(ngx_stream_proxy_srv_conf_t, upload_rate),
       NULL },
 
     { ngx_string("proxy_upstream_buffer"),
@@ -148,11 +148,11 @@ static ngx_command_t  ngx_stream_proxy_c
       offsetof(ngx_stream_proxy_srv_conf_t, upstream_buf_size),
       NULL },
 
-    { ngx_string("proxy_upstream_limit_rate"),
+    { ngx_string("proxy_download_rate"),
       NGX_STREAM_MAIN_CONF|NGX_STREAM_SRV_CONF|NGX_CONF_TAKE1,
       ngx_conf_set_size_slot,
       NGX_STREAM_SRV_CONF_OFFSET,
-      offsetof(ngx_stream_proxy_srv_conf_t, upstream_limit_rate),
+      offsetof(ngx_stream_proxy_srv_conf_t, download_rate),
       NULL },
 
     { ngx_string("proxy_next_upstream"),
@@ -1010,14 +1010,14 @@ ngx_stream_proxy_process(ngx_stream_sess
         src = pc;
         dst = c;
         b = &u->upstream_buf;
-        limit_rate = pscf->upstream_limit_rate;
+        limit_rate = pscf->download_rate;
         received = &u->received;
 
     } else {
         src = c;
         dst = pc;
         b = &u->downstream_buf;
-        limit_rate = pscf->downstream_limit_rate;
+        limit_rate = pscf->upload_rate;
         received = &s->received;
     }
 
@@ -1296,9 +1296,9 @@ ngx_stream_proxy_create_srv_conf(ngx_con
     conf->timeout = NGX_CONF_UNSET_MSEC;
     conf->next_upstream_timeout = NGX_CONF_UNSET_MSEC;
     conf->downstream_buf_size = NGX_CONF_UNSET_SIZE;
-    conf->downstream_limit_rate = NGX_CONF_UNSET_SIZE;
+    conf->upload_rate = NGX_CONF_UNSET_SIZE;
     conf->upstream_buf_size = NGX_CONF_UNSET_SIZE;
-    conf->upstream_limit_rate = NGX_CONF_UNSET_SIZE;
+    conf->download_rate = NGX_CONF_UNSET_SIZE;
     conf->next_upstream_tries = NGX_CONF_UNSET_UINT;
     conf->next_upstream = NGX_CONF_UNSET;
     conf->proxy_protocol = NGX_CONF_UNSET;
@@ -1335,14 +1335,14 @@ ngx_stream_proxy_merge_srv_conf(ngx_conf
     ngx_conf_merge_size_value(conf->downstream_buf_size,
                               prev->downstream_buf_size, 16384);
 
-    ngx_conf_merge_size_value(conf->downstream_limit_rate,
-                              prev->downstream_limit_rate, 0);
+    ngx_conf_merge_size_value(conf->upload_rate,
+                              prev->upload_rate, 0);
 
     ngx_conf_merge_size_value(conf->upstream_buf_size,
                               prev->upstream_buf_size, 16384);
 
-    ngx_conf_merge_size_value(conf->upstream_limit_rate,
-                              prev->upstream_limit_rate, 0);
+    ngx_conf_merge_size_value(conf->download_rate,
+                              prev->download_rate, 0);
 
     ngx_conf_merge_uint_value(conf->next_upstream_tries,
                               prev->next_upstream_tries, 0);



More information about the nginx-devel mailing list