comparison src/http/ngx_http_upstream_round_robin.h @ 6100:c44459611d91

Upstream: store peers as a linked list. This is an API change.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 10 Apr 2015 14:48:36 +0300
parents 6ff0ebd6fbf4
children 3264b7828f72
comparison
equal deleted inserted replaced
6099:6ff0ebd6fbf4 6100:c44459611d91
12 #include <ngx_config.h> 12 #include <ngx_config.h>
13 #include <ngx_core.h> 13 #include <ngx_core.h>
14 #include <ngx_http.h> 14 #include <ngx_http.h>
15 15
16 16
17 typedef struct { 17 typedef struct ngx_http_upstream_rr_peer_s ngx_http_upstream_rr_peer_t;
18
19 struct ngx_http_upstream_rr_peer_s {
18 struct sockaddr *sockaddr; 20 struct sockaddr *sockaddr;
19 socklen_t socklen; 21 socklen_t socklen;
20 ngx_str_t name; 22 ngx_str_t name;
21 ngx_str_t server; 23 ngx_str_t server;
22 24
36 ngx_uint_t down; /* unsigned down:1; */ 38 ngx_uint_t down; /* unsigned down:1; */
37 39
38 #if (NGX_HTTP_SSL) 40 #if (NGX_HTTP_SSL)
39 ngx_ssl_session_t *ssl_session; /* local to a process */ 41 ngx_ssl_session_t *ssl_session; /* local to a process */
40 #endif 42 #endif
41 } ngx_http_upstream_rr_peer_t; 43
44 ngx_http_upstream_rr_peer_t *next;
45 };
42 46
43 47
44 typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t; 48 typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t;
45 49
46 struct ngx_http_upstream_rr_peers_s { 50 struct ngx_http_upstream_rr_peers_s {
53 57
54 ngx_str_t *name; 58 ngx_str_t *name;
55 59
56 ngx_http_upstream_rr_peers_t *next; 60 ngx_http_upstream_rr_peers_t *next;
57 61
58 ngx_http_upstream_rr_peer_t peer[1]; 62 ngx_http_upstream_rr_peer_t *peer;
59 }; 63 };
60 64
61 65
62 typedef struct { 66 typedef struct {
63 ngx_http_upstream_rr_peers_t *peers; 67 ngx_http_upstream_rr_peers_t *peers;
64 ngx_uint_t current; 68 ngx_http_upstream_rr_peer_t *current;
65 uintptr_t *tried; 69 uintptr_t *tried;
66 uintptr_t data; 70 uintptr_t data;
67 } ngx_http_upstream_rr_peer_data_t; 71 } ngx_http_upstream_rr_peer_data_t;
68 72
69 73