changeset 4725:47936d1c98e9 stable-1.2

Merge of r4682, r4694, r4699, r4704, r4705: minor nits. *) Fixed spelling of "endianness", and called it "byte ordering" in the user visible part. *) Fixed return type of ngx_strerror_init(). *) Fixed a harmless error in spelling of "Connection: close" when computing the response header length. *) Style. *) Added code to look up Google perftools in /opt/local/, for MacPorts.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Jul 2012 16:51:02 +0000
parents 0141b4aec0e4
children dad38cdaf496
files auto/endianess auto/endianness auto/lib/google-perftools/conf auto/unix src/http/modules/ngx_http_geo_module.c src/http/ngx_http_header_filter_module.c src/os/unix/ngx_errno.c src/os/unix/ngx_errno.h src/os/win32/ngx_errno.c src/os/win32/ngx_errno.h src/os/win32/ngx_files.c
diffstat 11 files changed, 69 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
deleted file mode 100644
--- a/auto/endianess
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for system endianess ...$ngx_c"
-echo >> $NGX_ERR
-echo "checking for system endianess" >> $NGX_ERR
-
-
-cat << END > $NGX_AUTOTEST.c
-
-int main() {
-    int i = 0x11223344;
-    char *p;
-
-    p = (char *) &i;
-    if (*p == 0x44) return 0;
-    return 1;
-}
-
-END
-
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-          -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
-    if $NGX_AUTOTEST >/dev/null 2>&1; then
-        echo " little endianess"
-        have=NGX_HAVE_LITTLE_ENDIAN . auto/have
-    else
-        echo " big endianess"
-    fi
-
-    rm $NGX_AUTOTEST*
-
-else
-    rm $NGX_AUTOTEST*
-
-    echo
-    echo "$0: error: can not detect system endianess"
-    exit 1
-fi
new file mode 100644
--- /dev/null
+++ b/auto/endianness
@@ -0,0 +1,45 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
+
+
+echo $ngx_n "checking for system byte ordering ...$ngx_c"
+echo >> $NGX_ERR
+echo "checking for system byte ordering" >> $NGX_ERR
+
+
+cat << END > $NGX_AUTOTEST.c
+
+int main() {
+    int i = 0x11223344;
+    char *p;
+
+    p = (char *) &i;
+    if (*p == 0x44) return 0;
+    return 1;
+}
+
+END
+
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+          -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+if [ -x $NGX_AUTOTEST ]; then
+    if $NGX_AUTOTEST >/dev/null 2>&1; then
+        echo " little endian"
+        have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+    else
+        echo " big endian"
+    fi
+
+    rm $NGX_AUTOTEST*
+
+else
+    rm $NGX_AUTOTEST*
+
+    echo
+    echo "$0: error: cannot detect system byte ordering"
+    exit 1
+fi
--- a/auto/lib/google-perftools/conf
+++ b/auto/lib/google-perftools/conf
@@ -29,6 +29,22 @@ if [ $ngx_found = no ]; then
 fi
 
 
+if [ $ngx_found = no ]; then
+
+    # MacPorts
+
+    ngx_feature="Google perftools in /opt/local/"
+
+    if [ $NGX_RPATH = YES ]; then
+        ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler"
+    else
+        ngx_feature_libs="-L/opt/local/lib -lprofiler"
+    fi
+
+    . auto/feature
+fi
+
+
 if [ $ngx_found = yes ]; then
     CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
 
--- a/auto/unix
+++ b/auto/unix
@@ -464,7 +464,7 @@ ngx_type="rlim_t"; ngx_types="int"; . au
 
 . auto/types/uintptr_t
 
-. auto/endianess
+. auto/endianness
 
 ngx_type="size_t"; . auto/types/sizeof
 ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -145,7 +145,7 @@ typedef struct {
     u_char    GEORNG[6];
     u_char    version;
     u_char    ptr_size;
-    uint32_t  endianess;
+    uint32_t  endianness;
     uint32_t  crc32;
 } ngx_http_geo_header_t;
 
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -395,7 +395,7 @@ ngx_http_header_filter(ngx_http_request_
         }
 
     } else {
-        len += sizeof("Connection: closed" CRLF) - 1;
+        len += sizeof("Connection: close" CRLF) - 1;
     }
 
 #if (NGX_HTTP_GZIP)
--- a/src/os/unix/ngx_errno.c
+++ b/src/os/unix/ngx_errno.c
@@ -42,7 +42,7 @@ ngx_strerror(ngx_err_t err, u_char *errs
 }
 
 
-ngx_uint_t
+ngx_int_t
 ngx_strerror_init(void)
 {
     char       *msg;
--- a/src/os/unix/ngx_errno.h
+++ b/src/os/unix/ngx_errno.h
@@ -69,7 +69,7 @@ typedef int               ngx_err_t;
 
 
 u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size);
-ngx_uint_t ngx_strerror_init(void);
+ngx_int_t ngx_strerror_init(void);
 
 
 #endif /* _NGX_ERRNO_H_INCLUDED_ */
--- a/src/os/win32/ngx_errno.c
+++ b/src/os/win32/ngx_errno.c
@@ -53,7 +53,7 @@ ngx_strerror(ngx_err_t err, u_char *errs
 }
 
 
-ngx_uint_t
+ngx_int_t
 ngx_strerror_init(void)
 {
     return NGX_OK;
--- a/src/os/win32/ngx_errno.h
+++ b/src/os/win32/ngx_errno.h
@@ -59,7 +59,7 @@ typedef DWORD                      ngx_e
 
 
 u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size);
-ngx_uint_t ngx_strerror_init(void);
+ngx_int_t ngx_strerror_init(void);
 
 
 #endif /* _NGX_ERRNO_H_INCLUDED_ */
--- a/src/os/win32/ngx_files.c
+++ b/src/os/win32/ngx_files.c
@@ -722,7 +722,7 @@ ngx_win32_check_filename(u_char *name, u
             if (ch == ':') {
                 goto invalid;
             }
-       
+
             if (ch == '.' || ch == ' ') {
                 break;
             }