comparison src/core/ngx_resolver.h @ 5921:5004210e8c78

Resolver: fixed debug event logging. In 954867a2f0a6, we switched to using resolver node as the timer event data. This broke debug event logging. Replaced now unused ngx_resolver_ctx_t.ident with ngx_resolver_node_t.ident so that ngx_event_ident() extracts something sensible when accessing ngx_resolver_node_t as ngx_connection_t.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 20 Nov 2014 15:24:42 +0300
parents 3cb3175a6fef
children 7316c57e4fe7
comparison
equal deleted inserted replaced
5920:7420068c4d4b 5921:5004210e8c78
49 49
50 typedef void (*ngx_resolver_handler_pt)(ngx_resolver_ctx_t *ctx); 50 typedef void (*ngx_resolver_handler_pt)(ngx_resolver_ctx_t *ctx);
51 51
52 52
53 typedef struct { 53 typedef struct {
54 ngx_rbtree_node_t node; 54 /* PTR: resolved name, A: name to resolve */
55 u_char *name;
56
55 ngx_queue_t queue; 57 ngx_queue_t queue;
56 58
57 /* PTR: resolved name, A: name to resolve */ 59 /* event ident must be after 3 pointers as in ngx_connection_t */
58 u_char *name; 60 ngx_int_t ident;
61
62 ngx_rbtree_node_t node;
59 63
60 #if (NGX_HAVE_INET6) 64 #if (NGX_HAVE_INET6)
61 /* PTR: IPv6 address to resolve (IPv4 address is in rbtree node key) */ 65 /* PTR: IPv6 address to resolve (IPv4 address is in rbtree node key) */
62 struct in6_addr addr6; 66 struct in6_addr addr6;
63 #endif 67 #endif
101 /* has to be pointer because of "incomplete type" */ 105 /* has to be pointer because of "incomplete type" */
102 ngx_event_t *event; 106 ngx_event_t *event;
103 void *dummy; 107 void *dummy;
104 ngx_log_t *log; 108 ngx_log_t *log;
105 109
106 /* ident must be after 3 pointers */ 110 /* event ident must be after 3 pointers as in ngx_connection_t */
107 ngx_int_t ident; 111 ngx_int_t ident;
108 112
109 /* simple round robin DNS peers balancer */ 113 /* simple round robin DNS peers balancer */
110 ngx_array_t udp_connections; 114 ngx_array_t udp_connections;
111 ngx_uint_t last_connection; 115 ngx_uint_t last_connection;
141 struct ngx_resolver_ctx_s { 145 struct ngx_resolver_ctx_s {
142 ngx_resolver_ctx_t *next; 146 ngx_resolver_ctx_t *next;
143 ngx_resolver_t *resolver; 147 ngx_resolver_t *resolver;
144 ngx_udp_connection_t *udp_connection; 148 ngx_udp_connection_t *udp_connection;
145 149
146 /* ident must be after 3 pointers */
147 ngx_int_t ident;
148
149 ngx_int_t state; 150 ngx_int_t state;
150 ngx_str_t name; 151 ngx_str_t name;
151 152
152 ngx_uint_t naddrs; 153 ngx_uint_t naddrs;
153 ngx_addr_t *addrs; 154 ngx_addr_t *addrs;