diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-11-11 14:00:51 +0000 |
---|---|---|
committer | Jonathan Kolb <jon@b0g.us> | 2004-11-11 14:00:51 +0000 |
commit | 34657fc5efa99f80c13deec0c3f5d3774b97b920 (patch) | |
tree | 0c8abef4c96147f4d928107cdd1e846f350c34b5 /src/core/ngx_inet.c | |
parent | 4778f02ca6d950751fcc59b55ff1c44a5eba528c (diff) | |
download | nginx-0.1.5.tar.gz |
Changes with nginx 0.1.5 11 Nov 2004v0.1.5
*) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned
not enough data" alerts.
*) Bugfix: there were the "writev() failed (22: Invalid argument)" errors
on Solaris in proxy mode without sendfile. On other platforms that do
not support sendfile at all the process got caught in an endless loop.
*) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile.
*) Bugfix: segmentation fault on Solaris.
*) Bugfix: on-line upgrade did not work on Linux.
*) Bugfix: the ngx_http_autoindex_module module did not escape the
spaces, the quotes, and the percent signs in the directory listing.
*) Change: the decrease of the copy operations.
*) Feature: the userid_p3p directive.
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r-- | src/core/ngx_inet.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index bf8a788ea..5cabb49b5 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -9,6 +9,17 @@ #include <ngx_core.h> +/* + * ngx_sock_ntop() and ngx_inet_ntop() may be implemented as + * "ngx_sprintf(text, "%ud.%ud.%ud.%ud", p[0], p[1], p[2], p[3])", + * however, they were implemented long before the ngx_sprintf() appeared + * and they are faster by 1.5-2.5 times, so it is worth to keep them. + * + * By the way, the implementation using ngx_sprintf() is faster by 2.5-3 times + * than using FreeBSD libc's snrpintf(). + */ + + ngx_inline static size_t ngx_sprint_uchar(u_char *text, u_char c, size_t len) { size_t n; @@ -105,15 +116,8 @@ size_t ngx_sock_ntop(int family, struct sockaddr *addr, u_char *text, text[n] = '\0'; return n; - -#if 0 - return ngx_snprintf((char *) text, - len > INET_ADDRSTRLEN ? INET_ADDRSTRLEN : len, - "%u.%u.%u.%u", p[0], p[1], p[2], p[3]); -#endif } - size_t ngx_inet_ntop(int family, void *addr, u_char *text, size_t len) { u_char *p; @@ -163,12 +167,6 @@ size_t ngx_inet_ntop(int family, void *addr, u_char *text, size_t len) text[n] = '\0'; return n; - -#if 0 - return ngx_snprintf((char *) text, - len > INET_ADDRSTRLEN ? INET_ADDRSTRLEN : len, - "%u.%u.%u.%u", p[0], p[1], p[2], p[3]); -#endif } |