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

ru at nginx.com ru at nginx.com
Fri Jun 1 11:35:10 UTC 2012


Author: ru
Date: 2012-06-01 11:35:09 +0000 (Fri, 01 Jun 2012)
New Revision: 4653
URL: http://trac.nginx.org/nginx/changeset/4653/nginx

Log:
Code reduction (no functional changes).


Modified:
   trunk/src/core/ngx_inet.c

Modified: trunk/src/core/ngx_inet.c
===================================================================
--- trunk/src/core/ngx_inet.c	2012-05-30 12:43:27 UTC (rev 4652)
+++ trunk/src/core/ngx_inet.c	2012-06-01 11:35:09 UTC (rev 4653)
@@ -634,11 +634,8 @@
     args = ngx_strlchr(host, last, '?');
 
     if (args) {
-        if (uri == NULL) {
+        if (uri == NULL || args < uri) {
             uri = args;
-
-        } else if (args < uri) {
-            uri = args;
         }
     }
 
@@ -663,11 +660,6 @@
 
         len = last - port;
 
-        if (len == 0) {
-            u->err = "invalid port";
-            return NGX_ERROR;
-        }
-
         n = ngx_atoi(port, len);
 
         if (n < 1 || n > 65535) {
@@ -774,11 +766,7 @@
         return NGX_OK;
     }
 
-    if (ngx_inet_resolve_host(pool, u) != NGX_OK) {
-        return NGX_ERROR;
-    }
-
-    return NGX_OK;
+    return ngx_inet_resolve_host(pool, u);
 }
 
 
@@ -827,11 +815,6 @@
 
             len = last - port;
 
-            if (len == 0) {
-                u->err = "invalid port";
-                return NGX_ERROR;
-            }
-
             n = ngx_atoi(port, len);
 
             if (n < 1 || n > 65535) {



More information about the nginx-devel mailing list