diff src/core/ngx_inet.c @ 362:54fad6c4b555 NGINX_0_6_25

nginx 0.6.25 *) Change: now the "server_name_in_redirect" directive is used instead of the "server_name" directive's special "*" parameter. *) Change: now wildcard and regex names can be used as main name in a "server_name" directive. *) Change: the "satisfy_any" directive was replaced by the "satisfy" directive. *) Workaround: old worker processes might hog CPU after reconfiguration if they was run under Linux OpenVZ. *) Feature: the "min_delete_depth" directive. *) Bugfix: the COPY and MOVE methods did not work with single files. *) Bugfix: the ngx_http_gzip_static_module did not allow the ngx_http_dav_module to work; bug appeared in 0.6.23. *) Bugfix: socket leak in HTTPS mode if deferred accept was used. Thanks to Ben Maurer. *) Bugfix: nginx could not be built without PCRE library; bug appeared in 0.6.23.
author Igor Sysoev <http://sysoev.ru>
date Tue, 08 Jan 2008 00:00:00 +0300
parents 583decdb82a4
children a39aab45a53f
line wrap: on
line diff
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -8,6 +8,9 @@
 #include <ngx_core.h>
 
 
+static size_t ngx_sprint_uchar(u_char *text, u_char c, size_t len);
+
+
 /* AF_INET only */
 
 in_addr_t
@@ -63,50 +66,6 @@ ngx_inet_addr(u_char *text, size_t len)
  * than using FreeBSD libc's snprintf().
  */
 
-
-static ngx_inline size_t
-ngx_sprint_uchar(u_char *text, u_char c, size_t len)
-{
-    size_t      n;
-    ngx_uint_t  c1, c2;
-
-    n = 0;
-
-    if (len == n) {
-        return n;
-    }
-
-    c1 = c / 100;
-
-    if (c1) {
-        *text++ = (u_char) (c1 + '0');
-        n++;
-
-        if (len == n) {
-            return n;
-        }
-    }
-
-    c2 = (c % 100) / 10;
-
-    if (c1 || c2) {
-        *text++ = (u_char) (c2 + '0');
-        n++;
-
-        if (len == n) {
-            return n;
-        }
-    }
-
-    c2 = c % 10;
-
-    *text++ = (u_char) (c2 + '0');
-    n++;
-
-    return n;
-}
-
-
 /* AF_INET only */
 
 size_t
@@ -163,6 +122,7 @@ ngx_sock_ntop(int family, struct sockadd
     return n;
 }
 
+
 size_t
 ngx_inet_ntop(int family, void *addr, u_char *text, size_t len)
 {
@@ -216,6 +176,49 @@ ngx_inet_ntop(int family, void *addr, u_
 }
 
 
+static size_t
+ngx_sprint_uchar(u_char *text, u_char c, size_t len)
+{
+    size_t      n;
+    ngx_uint_t  c1, c2;
+
+    n = 0;
+
+    if (len == n) {
+        return n;
+    }
+
+    c1 = c / 100;
+
+    if (c1) {
+        *text++ = (u_char) (c1 + '0');
+        n++;
+
+        if (len == n) {
+            return n;
+        }
+    }
+
+    c2 = (c % 100) / 10;
+
+    if (c1 || c2) {
+        *text++ = (u_char) (c2 + '0');
+        n++;
+
+        if (len == n) {
+            return n;
+        }
+    }
+
+    c2 = c % 10;
+
+    *text++ = (u_char) (c2 + '0');
+    n++;
+
+    return n;
+}
+
+
 /* AF_INET only */
 
 ngx_int_t