@@ -6,8 +6,8 @@ index fd9ecbe..d3849b6 100644
6
6
#include <ngx_core.h>
7
7
#include <ngx_http.h>
8
8
9
- + #if (NGX_UPSTREAM_CHECK_MODULE )
10
- + #include "ngx_http_upstream_check_handler .h"
9
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
10
+ + #include "ngx_http_upstream_check_module .h"
11
11
+ #endif
12
12
+
13
13
@@ -17,11 +17,11 @@ index fd9ecbe..d3849b6 100644
17
17
18
18
if (!peer->down) {
19
19
20
- + #if (NGX_UPSTREAM_CHECK_MODULE )
20
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
21
21
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
22
22
+ "get ip_hash peer, check_index: %ui",
23
23
+ peer->check_index);
24
- + if (!ngx_http_check_peer_down (peer->check_index)) {
24
+ + if (!ngx_http_upstream_check_peer_down (peer->check_index)) {
25
25
+ #endif
26
26
if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
27
27
break;
@@ -30,7 +30,7 @@ index fd9ecbe..d3849b6 100644
30
30
peer->fails = 0;
31
31
break;
32
32
}
33
- + #if (NGX_UPSTREAM_CHECK_MODULE )
33
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
34
34
+ }
35
35
+ #endif
36
36
}
@@ -44,8 +44,8 @@ index afc9b2e..1c0344e 100644
44
44
#include <ngx_core.h>
45
45
#include <ngx_http.h>
46
46
47
- + #if (NGX_UPSTREAM_CHECK_MODULE )
48
- + #include "ngx_http_upstream_check_handler .h"
47
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
48
+ + #include "ngx_http_upstream_check_module .h"
49
49
+ #endif
50
50
51
51
static ngx_int_t ngx_http_upstream_cmp_servers(const void *one,
@@ -55,10 +55,10 @@ index afc9b2e..1c0344e 100644
55
55
peers->peer[n].weight = server[i].down ? 0 : server[i].weight;
56
56
peers->peer[n].current_weight = peers->peer[n].weight;
57
57
+
58
- + #if (NGX_UPSTREAM_CHECK_MODULE )
58
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
59
59
+ if (!server[i].down) {
60
60
+ peers->peer[n].check_index =
61
- + ngx_http_check_add_peer (cf, us, &server[i].addrs[j]);
61
+ + ngx_http_upstream_check_add_peer (cf, us, &server[i].addrs[j]);
62
62
+ }
63
63
+ else {
64
64
+ peers->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
@@ -73,10 +73,10 @@ index afc9b2e..1c0344e 100644
73
73
backup->peer[n].fail_timeout = server[i].fail_timeout;
74
74
backup->peer[n].down = server[i].down;
75
75
+
76
- + #if (NGX_UPSTREAM_CHECK_MODULE )
76
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
77
77
+ if (!server[i].down) {
78
78
+ backup->peer[n].check_index =
79
- + ngx_http_check_add_peer (cf, us, &server[i].addrs[j]);
79
+ + ngx_http_upstream_check_add_peer (cf, us, &server[i].addrs[j]);
80
80
+ }
81
81
+ else {
82
82
+ backup->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
@@ -90,7 +90,7 @@ index afc9b2e..1c0344e 100644
90
90
peers->peer[i].current_weight = 1;
91
91
peers->peer[i].max_fails = 1;
92
92
peers->peer[i].fail_timeout = 10;
93
- + #if (NGX_UPSTREAM_CHECK_MODULE )
93
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
94
94
+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
95
95
+ #endif
96
96
}
@@ -100,7 +100,7 @@ index afc9b2e..1c0344e 100644
100
100
peers->peer[0].current_weight = 1;
101
101
peers->peer[0].max_fails = 1;
102
102
peers->peer[0].fail_timeout = 10;
103
- + #if (NGX_UPSTREAM_CHECK_MODULE )
103
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
104
104
+ peers->peer[0].check_index = (ngx_uint_t) NGX_ERROR;
105
105
+ #endif
106
106
@@ -110,7 +110,7 @@ index afc9b2e..1c0344e 100644
110
110
peers->peer[i].current_weight = 1;
111
111
peers->peer[i].max_fails = 1;
112
112
peers->peer[i].fail_timeout = 10;
113
- + #if (NGX_UPSTREAM_CHECK_MODULE )
113
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
114
114
+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
115
115
+ #endif
116
116
}
@@ -121,8 +121,8 @@ index afc9b2e..1c0344e 100644
121
121
if (rrp->peers->single) {
122
122
peer = &rrp->peers->peer[0];
123
123
-
124
- + #if (NGX_UPSTREAM_CHECK_MODULE )
125
- + if (ngx_http_check_peer_down (peer->check_index)) {
124
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
125
+ + if (ngx_http_upstream_check_peer_down (peer->check_index)) {
126
126
+ return NGX_BUSY;
127
127
+ }
128
128
+ #endif
@@ -133,11 +133,11 @@ index afc9b2e..1c0344e 100644
133
133
134
134
if (!peer->down) {
135
135
136
- + #if (NGX_UPSTREAM_CHECK_MODULE )
136
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
137
137
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
138
138
+ "get rr peer, check_index: %ui",
139
139
+ peer->check_index);
140
- + if (!ngx_http_check_peer_down (peer->check_index)) {
140
+ + if (!ngx_http_upstream_check_peer_down (peer->check_index)) {
141
141
+ #endif
142
142
if (peer->max_fails == 0
143
143
|| peer->fails < peer->max_fails)
@@ -146,7 +146,7 @@ index afc9b2e..1c0344e 100644
146
146
peer->fails = 0;
147
147
break;
148
148
}
149
- + #if (NGX_UPSTREAM_CHECK_MODULE )
149
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
150
150
+ }
151
151
+ #endif
152
152
@@ -156,11 +156,11 @@ index afc9b2e..1c0344e 100644
156
156
157
157
if (!peer->down) {
158
158
159
- + #if (NGX_UPSTREAM_CHECK_MODULE )
159
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
160
160
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
161
161
+ "get rr peer2, check_index: %ui",
162
162
+ peer->check_index);
163
- + if (!ngx_http_check_peer_down (peer->check_index)) {
163
+ + if (!ngx_http_upstream_check_peer_down (peer->check_index)) {
164
164
+ #endif
165
165
if (peer->max_fails == 0
166
166
|| peer->fails < peer->max_fails)
@@ -169,7 +169,7 @@ index afc9b2e..1c0344e 100644
169
169
peer->fails = 0;
170
170
break;
171
171
}
172
- + #if (NGX_UPSTREAM_CHECK_MODULE )
172
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
173
173
+ }
174
174
+ #endif
175
175
@@ -183,7 +183,7 @@ index 6d285ab..354cca2 100644
183
183
ngx_uint_t max_fails;
184
184
time_t fail_timeout;
185
185
186
- + #if (NGX_UPSTREAM_CHECK_MODULE )
186
+ + #if (NGX_HTTP_UPSTREAM_CHECK )
187
187
+ ngx_uint_t check_index;
188
188
+ #endif
189
189
+
0 commit comments