diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2015-04-10 14:48:36 +0300 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2015-04-10 14:48:36 +0300 |
| commit | 4d53631022f4c01878310298a9508cc7ee073012 (patch) | |
| tree | ae81bb342b2a026e17a4780324ec675c31b1489b /src/http/ngx_http_upstream_round_robin.h | |
| parent | 18fa775b1060a663e15473161c795992926e60e1 (diff) | |
| download | nginx-4d53631022f4c01878310298a9508cc7ee073012.tar.gz nginx-4d53631022f4c01878310298a9508cc7ee073012.tar.bz2 | |
Upstream: store peers as a linked list.
This is an API change.
Diffstat (limited to 'src/http/ngx_http_upstream_round_robin.h')
| -rw-r--r-- | src/http/ngx_http_upstream_round_robin.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.h b/src/http/ngx_http_upstream_round_robin.h index 8927d98c6..53beac8e3 100644 --- a/src/http/ngx_http_upstream_round_robin.h +++ b/src/http/ngx_http_upstream_round_robin.h @@ -14,7 +14,9 @@ #include <ngx_http.h> -typedef struct { +typedef struct ngx_http_upstream_rr_peer_s ngx_http_upstream_rr_peer_t; + +struct ngx_http_upstream_rr_peer_s { struct sockaddr *sockaddr; socklen_t socklen; ngx_str_t name; @@ -38,7 +40,9 @@ typedef struct { #if (NGX_HTTP_SSL) ngx_ssl_session_t *ssl_session; /* local to a process */ #endif -} ngx_http_upstream_rr_peer_t; + + ngx_http_upstream_rr_peer_t *next; +}; typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t; @@ -55,13 +59,13 @@ struct ngx_http_upstream_rr_peers_s { ngx_http_upstream_rr_peers_t *next; - ngx_http_upstream_rr_peer_t peer[1]; + ngx_http_upstream_rr_peer_t *peer; }; typedef struct { ngx_http_upstream_rr_peers_t *peers; - ngx_uint_t current; + ngx_http_upstream_rr_peer_t *current; uintptr_t *tried; uintptr_t data; } ngx_http_upstream_rr_peer_data_t; |
