[nginx] svn commit: r4672 - trunk/src/core

ru at nginx.com ru at nginx.com
Mon Jun 4 14:23:28 UTC 2012


Author: ru
Date: 2012-06-04 14:23:27 +0000 (Mon, 04 Jun 2012)
New Revision: 4672
URL: http://trac.nginx.org/nginx/changeset/4672/nginx

Log:
Support for IPv6 literals and an optional port in resolver.


Modified:
   trunk/src/core/ngx_resolver.c

Modified: trunk/src/core/ngx_resolver.c
===================================================================
--- trunk/src/core/ngx_resolver.c	2012-06-04 14:07:34 UTC (rev 4671)
+++ trunk/src/core/ngx_resolver.c	2012-06-04 14:23:27 UTC (rev 4672)
@@ -171,14 +171,14 @@
 
         ngx_memzero(&u, sizeof(ngx_url_t));
 
-        u.host = names[i];
-        u.port = 53;
+        u.url = names[i];
+        u.default_port = 53;
 
-        if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
+        if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
             if (u.err) {
                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                    "%s in resolver \"%V\"",
-                                   u.err, &u.host);
+                                   u.err, &u.url);
             }
 
             return NULL;
@@ -2189,7 +2189,7 @@
     ngx_socket_t       s;
     ngx_connection_t  *c;
 
-    s = ngx_socket(AF_INET, SOCK_DGRAM, 0);
+    s = ngx_socket(uc->sockaddr->sa_family, SOCK_DGRAM, 0);
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &uc->log, 0, "UDP socket %d", s);
 



More information about the nginx-devel mailing list