comparison src/core/ngx_resolver.c @ 684:660139fd80ca NGINX_1_3_5

nginx 1.3.5 *) Change: the ngx_http_mp4_module module no longer skips tracks in formats other than H.264 and AAC. *) Bugfix: a segmentation fault might occur in a worker process if the "map" directive was used with variables as values. *) Bugfix: a segmentation fault might occur in a worker process if the "geo" directive was used with the "ranges" parameter but without the "default" parameter; the bug had appeared in 0.8.43. Thanks to Zhen Chen and Weibin Yao. *) Bugfix: in the -p command-line parameter handling. *) Bugfix: in the mail proxy server. *) Bugfix: of minor potential bugs. Thanks to Coverity. *) Bugfix: nginx/Windows could not be built with Visual Studio 2005 Express. Thanks to HAYASHI Kentaro.
author Igor Sysoev <http://sysoev.ru>
date Tue, 21 Aug 2012 00:00:00 +0400
parents 981b4c44593b
children f31b19fe7f48
comparison
equal deleted inserted replaced
683:28cc2a208803 684:660139fd80ca
111 r = ngx_calloc(sizeof(ngx_resolver_t), cf->log); 111 r = ngx_calloc(sizeof(ngx_resolver_t), cf->log);
112 if (r == NULL) { 112 if (r == NULL) {
113 return NULL; 113 return NULL;
114 } 114 }
115 115
116 cln->data = r;
117
118 r->event = ngx_calloc(sizeof(ngx_event_t), cf->log);
119 if (r->event == NULL) {
120 return NULL;
121 }
122
123 ngx_rbtree_init(&r->name_rbtree, &r->name_sentinel,
124 ngx_resolver_rbtree_insert_value);
125
126 ngx_rbtree_init(&r->addr_rbtree, &r->addr_sentinel,
127 ngx_rbtree_insert_value);
128
129 ngx_queue_init(&r->name_resend_queue);
130 ngx_queue_init(&r->addr_resend_queue);
131
132 ngx_queue_init(&r->name_expire_queue);
133 ngx_queue_init(&r->addr_expire_queue);
134
135 r->event->handler = ngx_resolver_resend_handler;
136 r->event->data = r;
137 r->event->log = &cf->cycle->new_log;
138 r->ident = -1;
139
140 r->resend_timeout = 5;
141 r->expire = 30;
142 r->valid = 0;
143
144 r->log = &cf->cycle->new_log;
145 r->log_level = NGX_LOG_ERR;
146
116 if (n) { 147 if (n) {
117 if (ngx_array_init(&r->udp_connections, cf->pool, n, 148 if (ngx_array_init(&r->udp_connections, cf->pool, n,
118 sizeof(ngx_udp_connection_t)) 149 sizeof(ngx_udp_connection_t))
119 != NGX_OK) 150 != NGX_OK)
120 { 151 {
121 return NULL; 152 return NULL;
122 } 153 }
123 } 154 }
124
125 cln->data = r;
126
127 r->event = ngx_calloc(sizeof(ngx_event_t), cf->log);
128 if (r->event == NULL) {
129 return NULL;
130 }
131
132 ngx_rbtree_init(&r->name_rbtree, &r->name_sentinel,
133 ngx_resolver_rbtree_insert_value);
134
135 ngx_rbtree_init(&r->addr_rbtree, &r->addr_sentinel,
136 ngx_rbtree_insert_value);
137
138 ngx_queue_init(&r->name_resend_queue);
139 ngx_queue_init(&r->addr_resend_queue);
140
141 ngx_queue_init(&r->name_expire_queue);
142 ngx_queue_init(&r->addr_expire_queue);
143
144 r->event->handler = ngx_resolver_resend_handler;
145 r->event->data = r;
146 r->event->log = &cf->cycle->new_log;
147 r->ident = -1;
148
149 r->resend_timeout = 5;
150 r->expire = 30;
151 r->valid = 0;
152
153 r->log = &cf->cycle->new_log;
154 r->log_level = NGX_LOG_ERR;
155 155
156 for (i = 0; i < n; i++) { 156 for (i = 0; i < n; i++) {
157 if (ngx_strncmp(names[i].data, "valid=", 6) == 0) { 157 if (ngx_strncmp(names[i].data, "valid=", 6) == 0) {
158 s.len = names[i].len - 6; 158 s.len = names[i].len - 6;
159 s.data = names[i].data + 6; 159 s.data = names[i].data + 6;