comparison src/core/ngx_resolver.c @ 646:09a689c5e494 NGINX_1_0_13

nginx 1.0.13 *) Feature: the "return" and "error_page" directives can now be used to return 307 redirections. *) Bugfix: a segmentation fault might occur in a worker process if the "resolver" directive was used and there was no "error_log" directive specified at global level. Thanks to Roman Arutyunyan. *) Bugfix: memory leaks. Thanks to Lanshun Zhou. *) Bugfix: nginx might log incorrect error "upstream prematurely closed connection" instead of correct "upstream sent too big header" one. Thanks to Feibo Li. *) Bugfix: on ZFS filesystem disk cache size might be calculated incorrectly; the bug had appeared in 1.0.1. *) Bugfix: the number of internal redirects to named locations was not limited. *) Bugfix: temporary files might be not removed if the "proxy_store" directive was used with SSI includes. *) Bugfix: in some cases non-cacheable variables (such as the $args variable) returned old empty cached value. *) Bugfix: the "proxy_redirect" directives might be inherited incorrectly. *) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used. *) Bugfix: nginx could not be built by the icc 12.1 compiler.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Mar 2012 00:00:00 +0400
parents ad25218fd14b
children
comparison
equal deleted inserted replaced
645:60344e6faa47 646:09a689c5e494
150 r->udp_connection = uc; 150 r->udp_connection = uc;
151 151
152 uc->sockaddr = addr->sockaddr; 152 uc->sockaddr = addr->sockaddr;
153 uc->socklen = addr->socklen; 153 uc->socklen = addr->socklen;
154 uc->server = addr->name; 154 uc->server = addr->name;
155
156 uc->log = cf->cycle->new_log;
157 uc->log.handler = ngx_resolver_log_error;
158 uc->log.data = uc;
159 uc->log.action = "resolving";
160 } 155 }
161 156
162 return r; 157 return r;
163 } 158 }
164 159
828 ngx_udp_connection_t *uc; 823 ngx_udp_connection_t *uc;
829 824
830 uc = r->udp_connection; 825 uc = r->udp_connection;
831 826
832 if (uc->connection == NULL) { 827 if (uc->connection == NULL) {
828
829 uc->log = *r->log;
830 uc->log.handler = ngx_resolver_log_error;
831 uc->log.data = uc;
832 uc->log.action = "resolving";
833
833 if (ngx_udp_connect(uc) != NGX_OK) { 834 if (ngx_udp_connect(uc) != NGX_OK) {
834 return NGX_ERROR; 835 return NGX_ERROR;
835 } 836 }
836 837
837 uc->connection->data = r; 838 uc->connection->data = r;
1623 continue; 1624 continue;
1624 } 1625 }
1625 1626
1626 /* hash == node->key */ 1627 /* hash == node->key */
1627 1628
1628 do { 1629 rn = (ngx_resolver_node_t *) node;
1629 rn = (ngx_resolver_node_t *) node; 1630
1630 1631 rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen);
1631 rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen); 1632
1632 1633 if (rc == 0) {
1633 if (rc == 0) { 1634 return rn;
1634 return rn; 1635 }
1635 } 1636
1636 1637 node = (rc < 0) ? node->left : node->right;
1637 node = (rc < 0) ? node->left : node->right;
1638
1639 } while (node != sentinel && hash == node->key);
1640
1641 break;
1642 } 1638 }
1643 1639
1644 /* not found */ 1640 /* not found */
1645 1641
1646 return NULL; 1642 return NULL;