]> git.kaiwu.me - nginx.git/commitdiff
Stream: style.
authorRuslan Ermilov <ru@nginx.com>
Thu, 29 Sep 2016 09:59:13 +0000 (12:59 +0300)
committerRuslan Ermilov <ru@nginx.com>
Thu, 29 Sep 2016 09:59:13 +0000 (12:59 +0300)
Explicitly initialized peer's max_conns for upstreams created with
variables similar to how it's done in http.

src/stream/ngx_stream_upstream_round_robin.c

index 3f4bfcfa559bae842029c6ce64954563e60f33b2..87ca301ce14314709a6df60e6455177eede70e77 100644 (file)
@@ -347,6 +347,7 @@ ngx_stream_upstream_create_round_robin_peer(ngx_stream_session_t *s,
         peer[0].weight = 1;
         peer[0].effective_weight = 1;
         peer[0].current_weight = 0;
+        peer[0].max_conns = 0;
         peer[0].max_fails = 1;
         peer[0].fail_timeout = 10;
         peers->peer = peer;
@@ -380,6 +381,7 @@ ngx_stream_upstream_create_round_robin_peer(ngx_stream_session_t *s,
             peer[i].weight = 1;
             peer[i].effective_weight = 1;
             peer[i].current_weight = 0;
+            peer[i].max_conns = 0;
             peer[i].max_fails = 1;
             peer[i].fail_timeout = 10;
             *peerp = &peer[i];