diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-10-24 20:09:05 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-10-24 20:09:05 +0400 |
commit | 620718102bb0ee6c4abfb4a736db596a6b0e0183 (patch) | |
tree | 7a48f827bbad9d8535c7109ee75461461ce69e96 /src/core/ngx_resolver.h | |
parent | ba71972b2132282e028971c0f6d9da65ae87e92a (diff) |
Support of several servers in the "resolver" directive.
Patch by Kirill A. Korinskiy.
Diffstat (limited to 'src/core/ngx_resolver.h')
-rw-r--r-- | src/core/ngx_resolver.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/ngx_resolver.h b/src/core/ngx_resolver.h index ef3c2082c..a2ddbefae 100644 --- a/src/core/ngx_resolver.h +++ b/src/core/ngx_resolver.h @@ -77,16 +77,16 @@ typedef struct { typedef struct { /* has to be pointer because of "incomplete type" */ ngx_event_t *event; - - /* TODO: DNS peers balancer */ - /* STUB */ - ngx_udp_connection_t *udp_connection; - + void *dummy; ngx_log_t *log; /* ident must be after 3 pointers */ ngx_int_t ident; + /* simple round robin DNS peers balancer */ + ngx_array_t udp_connections; + ngx_uint_t last_connection; + ngx_rbtree_t name_rbtree; ngx_rbtree_node_t name_sentinel; @@ -123,8 +123,6 @@ struct ngx_resolver_ctx_s { in_addr_t *addrs; in_addr_t addr; - /* TODO: DNS peers balancer ctx */ - ngx_resolver_handler_pt handler; void *data; ngx_msec_t timeout; @@ -135,7 +133,8 @@ struct ngx_resolver_ctx_s { }; -ngx_resolver_t *ngx_resolver_create(ngx_conf_t *cf, ngx_addr_t *addr); +ngx_resolver_t *ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, + ngx_uint_t n); ngx_resolver_ctx_t *ngx_resolve_start(ngx_resolver_t *r, ngx_resolver_ctx_t *temp); ngx_int_t ngx_resolve_name(ngx_resolver_ctx_t *ctx); |