Skip to content

Commit

Permalink
FIX a bug of lack the patch with check_index
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoweibin committed Aug 18, 2010
1 parent e61fd0d commit 8977af6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ngx_tcp_upstream_round_robin.c
Expand Up @@ -492,7 +492,7 @@ ngx_tcp_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)

if (!peer->down) {

if (ngx_tcp_check_peer_down(peer->check_index)) {
if (!ngx_tcp_check_peer_down(peer->check_index)) {

if (peer->max_fails == 0
|| peer->fails < peer->max_fails)
Expand Down
21 changes: 21 additions & 0 deletions tcp.patch
Expand Up @@ -32,3 +32,24 @@ index b736aa2..0b1507b 100644
#define NGX_LOG_DEBUG_CONNECTION 0x80000000
#define NGX_LOG_DEBUG_ALL 0x7ffffff0

diff --git a/src/event/ngx_event_connect.h b/src/event/ngx_event_connect.h
index 6cad042..8371b55 100644
--- a/src/event/ngx_event_connect.h
+++ b/src/event/ngx_event_connect.h
@@ -32,6 +32,7 @@ typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc,
void *data);
#endif

+#define NGX_INVALED_INDEX (-1)

struct ngx_peer_connection_s {
ngx_connection_t *connection;
@@ -42,6 +43,8 @@ struct ngx_peer_connection_s {

ngx_uint_t tries;

+ ngx_uint_t check_index;
+
ngx_event_get_peer_pt get;
ngx_event_free_peer_pt free;
void *data;

0 comments on commit 8977af6

Please sign in to comment.