 +#include "ngx_http_upstream_check_module.h"
 +#endif
  
- static ngx_int_t ngx_http_upstream_cmp_servers(const void *one,
-     const void *two);
-@@ -87,7 +90,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer(
+     ngx_http_upstream_rr_peer_data_t *rrp);
+@@ -85,7 +88,17 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
                  peers->peer[n].weight = server[i].weight;
                  peers->peer[n].effective_weight = server[i].weight;
                  peers->peer[n].current_weight = 0;

     } else {
 
         /* there are several peers */
@@ -531,6 +570,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)
             continue;
         }
 

                 n++;
             }
         }
@@ -196,6 +220,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
         peers->peer[i].current_weight = 0;
         peers->peer[i].max_fails = 1;
         peers->peer[i].fail_timeout = 10;
