1
- Index: ngx_http_sticky_module.c
2
- ===================================================================
3
- --- ngx_http_sticky_module.c (revision 45)
4
- +++ ngx_http_sticky_module.c (working copy)
5
- @@ -10,6 +10,11 @@
6
-
7
- #include "ngx_http_sticky_misc.h"
8
-
9
- + #if (NGX_UPSTREAM_CHECK_MODULE)
10
- + #include "ngx_http_upstream_check_handler.h"
11
- + #endif
12
- +
13
- +
14
- /* define a peer */
15
- typedef struct {
16
- ngx_http_upstream_rr_peer_t *rr_peer;
17
- @@ -287,6 +292,16 @@
18
- return NGX_BUSY;
19
- }
1
+ diff --git a/ngx_http_sticky_module.c b/ngx_http_sticky_module.c
2
+ index 9967428..f13d4b5 100644
3
+ --- a/ngx_http_sticky_module.c
4
+ +++ b/ngx_http_sticky_module.c
5
+ @@ -299,6 +299,16 @@ static ngx_int_t ngx_http_get_sticky_peer(ngx_peer_connection_t *pc, void *data)
6
+ return NGX_BUSY;
7
+ }
20
8
21
9
+ #if (NGX_UPSTREAM_CHECK_MODULE)
22
- + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
23
- + "get sticky peer, check_index: %ui",
24
- + peer->check_index);
10
+ + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
11
+ + "get sticky peer, check_index: %ui",
12
+ + peer->check_index);
25
13
+
26
- + if (ngx_http_check_peer_down(peer->check_index)) {
27
- + return NGX_BUSY;
28
- + }
14
+ + if (ngx_http_check_peer_down(peer->check_index)) {
15
+ + return NGX_BUSY;
16
+ + }
29
17
+ #endif
30
18
+
31
- /* if it's been ignored for long enought (fail_timeout), reset timeout */
32
- /* do this check before testing peer->fails ! :) */
33
- if (now - peer->accessed > peer->fail_timeout) {
34
- @@ -303 ,6 +318 ,14 @@
35
- /* ensure the peer is not marked as down */
36
- if (!peer->down) {
19
+ /* if it's been ignored for long enought (fail_timeout), reset timeout */
20
+ /* do this check before testing peer->fails ! :) */
21
+ if (now - peer->accessed > peer->fail_timeout) {
22
+ @@ -315 ,6 +325 ,14 @@ static ngx_int_t ngx_http_get_sticky_peer(ngx_peer_connection_t *pc, void *data)
23
+ /* ensure the peer is not marked as down */
24
+ if (!peer->down) {
37
25
38
26
+ #if (NGX_UPSTREAM_CHECK_MODULE)
39
- + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
40
- + "get sticky peer, check_index: %ui",
41
- + peer->check_index);
27
+ + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
28
+ + "get sticky peer, check_index: %ui",
29
+ + peer->check_index);
42
30
+
43
- + if (!ngx_http_check_peer_down(peer->check_index)) {
31
+ + if (!ngx_http_check_peer_down(peer->check_index)) {
44
32
+ #endif
45
33
+
46
- /* if it's not failedi, use it */
47
- if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
48
- selected_peer = (ngx_int_t)n;
49
- @@ -317 ,6 +340 ,9 @@
50
- /* mark the peer as tried */
51
- iphp->rrp.tried[n] |= m;
52
- }
34
+ /* if it's not failedi, use it */
35
+ if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
36
+ selected_peer = (ngx_int_t)n;
37
+ @@ -329 ,6 +347 ,9 @@ static ngx_int_t ngx_http_get_sticky_peer(ngx_peer_connection_t *pc, void *data)
38
+ /* mark the peer as tried */
39
+ iphp->rrp.tried[n] |= m;
40
+ }
53
41
+ #if (NGX_UPSTREAM_CHECK_MODULE)
54
- + }
42
+ + }
55
43
+ #endif
56
- }
57
- }
58
- }
44
+ }
45
+ }
46
+ }
0 commit comments