comparison src/core/ngx_resolver.h @ 646:615b5ea36fc0 NGINX_1_1_7

nginx 1.1.7 *) Feature: support of several resolvers in the "resolver" directive. Thanks to Kirill A. Korinskiy. *) Bugfix: a segmentation fault occurred on start or while reconfiguration if the "ssl" directive was used at http level and there was no "ssl_certificate" defined. *) Bugfix: reduced memory consumption while proxying of big files if they were buffered to disk. *) Bugfix: a segmentation fault might occur in a worker process if "proxy_http_version 1.1" directive was used. *) Bugfix: in the "expires @time" directive.
author Igor Sysoev <http://sysoev.ru>
date Mon, 31 Oct 2011 00:00:00 +0400
parents daf4847b43ff
children d0f7a625f27c
comparison
equal deleted inserted replaced
645:e461dead01e9 646:615b5ea36fc0
75 75
76 76
77 typedef struct { 77 typedef struct {
78 /* has to be pointer because of "incomplete type" */ 78 /* has to be pointer because of "incomplete type" */
79 ngx_event_t *event; 79 ngx_event_t *event;
80 80 void *dummy;
81 /* TODO: DNS peers balancer */
82 /* STUB */
83 ngx_udp_connection_t *udp_connection;
84
85 ngx_log_t *log; 81 ngx_log_t *log;
86 82
87 /* ident must be after 3 pointers */ 83 /* ident must be after 3 pointers */
88 ngx_int_t ident; 84 ngx_int_t ident;
85
86 /* simple round robin DNS peers balancer */
87 ngx_array_t udp_connections;
88 ngx_uint_t last_connection;
89 89
90 ngx_rbtree_t name_rbtree; 90 ngx_rbtree_t name_rbtree;
91 ngx_rbtree_node_t name_sentinel; 91 ngx_rbtree_node_t name_sentinel;
92 92
93 ngx_rbtree_t addr_rbtree; 93 ngx_rbtree_t addr_rbtree;
121 121
122 ngx_uint_t naddrs; 122 ngx_uint_t naddrs;
123 in_addr_t *addrs; 123 in_addr_t *addrs;
124 in_addr_t addr; 124 in_addr_t addr;
125 125
126 /* TODO: DNS peers balancer ctx */
127
128 ngx_resolver_handler_pt handler; 126 ngx_resolver_handler_pt handler;
129 void *data; 127 void *data;
130 ngx_msec_t timeout; 128 ngx_msec_t timeout;
131 129
132 ngx_uint_t quick; /* unsigned quick:1; */ 130 ngx_uint_t quick; /* unsigned quick:1; */
133 ngx_uint_t recursion; 131 ngx_uint_t recursion;
134 ngx_event_t *event; 132 ngx_event_t *event;
135 }; 133 };
136 134
137 135
138 ngx_resolver_t *ngx_resolver_create(ngx_conf_t *cf, ngx_addr_t *addr); 136 ngx_resolver_t *ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names,
137 ngx_uint_t n);
139 ngx_resolver_ctx_t *ngx_resolve_start(ngx_resolver_t *r, 138 ngx_resolver_ctx_t *ngx_resolve_start(ngx_resolver_t *r,
140 ngx_resolver_ctx_t *temp); 139 ngx_resolver_ctx_t *temp);
141 ngx_int_t ngx_resolve_name(ngx_resolver_ctx_t *ctx); 140 ngx_int_t ngx_resolve_name(ngx_resolver_ctx_t *ctx);
142 void ngx_resolve_name_done(ngx_resolver_ctx_t *ctx); 141 void ngx_resolve_name_done(ngx_resolver_ctx_t *ctx);
143 ngx_int_t ngx_resolve_addr(ngx_resolver_ctx_t *ctx); 142 ngx_int_t ngx_resolve_addr(ngx_resolver_ctx_t *ctx);