[nginx] Modules compatibility: upstream config field.

Maxim Dounin mdounin at mdounin.ru
Thu Sep 29 17:27:22 UTC 2016


details:   http://hg.nginx.org/nginx/rev/fd5c2781460b
branches:  
changeset: 6712:fd5c2781460b
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Thu Sep 29 18:06:04 2016 +0300
description:
Modules compatibility: upstream config field.

It is to be used to track version of an upstream configuration used for
request processing.

diffstat:

 src/http/ngx_http_upstream_round_robin.c     |  2 ++
 src/http/ngx_http_upstream_round_robin.h     |  1 +
 src/stream/ngx_stream_upstream_round_robin.c |  2 ++
 src/stream/ngx_stream_upstream_round_robin.h |  1 +
 4 files changed, 6 insertions(+), 0 deletions(-)

diffs (60 lines):

diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -260,6 +260,7 @@ ngx_http_upstream_init_round_robin_peer(
 
     rrp->peers = us->peer.data;
     rrp->current = NULL;
+    rrp->config = 0;
 
     n = rrp->peers->number;
 
@@ -384,6 +385,7 @@ ngx_http_upstream_create_round_robin_pee
 
     rrp->peers = peers;
     rrp->current = NULL;
+    rrp->config = 0;
 
     if (rrp->peers->number <= 8 * sizeof(uintptr_t)) {
         rrp->tried = &rrp->data;
diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h
--- a/src/http/ngx_http_upstream_round_robin.h
+++ b/src/http/ngx_http_upstream_round_robin.h
@@ -122,6 +122,7 @@ struct ngx_http_upstream_rr_peers_s {
 
 
 typedef struct {
+    ngx_uint_t                      config;
     ngx_http_upstream_rr_peers_t   *peers;
     ngx_http_upstream_rr_peer_t    *current;
     uintptr_t                      *tried;
diff --git a/src/stream/ngx_stream_upstream_round_robin.c b/src/stream/ngx_stream_upstream_round_robin.c
--- a/src/stream/ngx_stream_upstream_round_robin.c
+++ b/src/stream/ngx_stream_upstream_round_robin.c
@@ -265,6 +265,7 @@ ngx_stream_upstream_init_round_robin_pee
 
     rrp->peers = us->peer.data;
     rrp->current = NULL;
+    rrp->config = 0;
 
     n = rrp->peers->number;
 
@@ -391,6 +392,7 @@ ngx_stream_upstream_create_round_robin_p
 
     rrp->peers = peers;
     rrp->current = NULL;
+    rrp->config = 0;
 
     if (rrp->peers->number <= 8 * sizeof(uintptr_t)) {
         rrp->tried = &rrp->data;
diff --git a/src/stream/ngx_stream_upstream_round_robin.h b/src/stream/ngx_stream_upstream_round_robin.h
--- a/src/stream/ngx_stream_upstream_round_robin.h
+++ b/src/stream/ngx_stream_upstream_round_robin.h
@@ -122,6 +122,7 @@ struct ngx_stream_upstream_rr_peers_s {
 
 
 typedef struct {
+    ngx_uint_t                       config;
     ngx_stream_upstream_rr_peers_t  *peers;
     ngx_stream_upstream_rr_peer_t   *current;
     uintptr_t                       *tried;



More information about the nginx-devel mailing list