Klaus Demo nginx / 7138ca1
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. Maxim Dounin 10 years ago
11 changed file(s) with 69 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
+0
-45
auto/endianess less more
0
1 # Copyright (C) Igor Sysoev
2 # Copyright (C) Nginx, Inc.
3
4
5 echo $ngx_n "checking for system endianess ...$ngx_c"
6 echo >> $NGX_ERR
7 echo "checking for system endianess" >> $NGX_ERR
8
9
10 cat << END > $NGX_AUTOTEST.c
11
12 int main() {
13 int i = 0x11223344;
14 char *p;
15
16 p = (char *) &i;
17 if (*p == 0x44) return 0;
18 return 1;
19 }
20
21 END
22
23 ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
24 -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
25
26 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
27
28 if [ -x $NGX_AUTOTEST ]; then
29 if $NGX_AUTOTEST >/dev/null 2>&1; then
30 echo " little endianess"
31 have=NGX_HAVE_LITTLE_ENDIAN . auto/have
32 else
33 echo " big endianess"
34 fi
35
36 rm $NGX_AUTOTEST*
37
38 else
39 rm $NGX_AUTOTEST*
40
41 echo
42 echo "$0: error: can not detect system endianess"
43 exit 1
44 fi
0
1 # Copyright (C) Igor Sysoev
2 # Copyright (C) Nginx, Inc.
3
4
5 echo $ngx_n "checking for system byte ordering ...$ngx_c"
6 echo >> $NGX_ERR
7 echo "checking for system byte ordering" >> $NGX_ERR
8
9
10 cat << END > $NGX_AUTOTEST.c
11
12 int main() {
13 int i = 0x11223344;
14 char *p;
15
16 p = (char *) &i;
17 if (*p == 0x44) return 0;
18 return 1;
19 }
20
21 END
22
23 ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
24 -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
25
26 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
27
28 if [ -x $NGX_AUTOTEST ]; then
29 if $NGX_AUTOTEST >/dev/null 2>&1; then
30 echo " little endian"
31 have=NGX_HAVE_LITTLE_ENDIAN . auto/have
32 else
33 echo " big endian"
34 fi
35
36 rm $NGX_AUTOTEST*
37
38 else
39 rm $NGX_AUTOTEST*
40
41 echo
42 echo "$0: error: cannot detect system byte ordering"
43 exit 1
44 fi
2828 fi
2929
3030
31 if [ $ngx_found = no ]; then
32
33 # MacPorts
34
35 ngx_feature="Google perftools in /opt/local/"
36
37 if [ $NGX_RPATH = YES ]; then
38 ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler"
39 else
40 ngx_feature_libs="-L/opt/local/lib -lprofiler"
41 fi
42
43 . auto/feature
44 fi
45
46
3147 if [ $ngx_found = yes ]; then
3248 CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
3349
463463
464464 . auto/types/uintptr_t
465465
466 . auto/endianess
466 . auto/endianness
467467
468468 ngx_type="size_t"; . auto/types/sizeof
469469 ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
144144 u_char GEORNG[6];
145145 u_char version;
146146 u_char ptr_size;
147 uint32_t endianess;
147 uint32_t endianness;
148148 uint32_t crc32;
149149 } ngx_http_geo_header_t;
150150
394394 }
395395
396396 } else {
397 len += sizeof("Connection: closed" CRLF) - 1;
397 len += sizeof("Connection: close" CRLF) - 1;
398398 }
399399
400400 #if (NGX_HTTP_GZIP)
4141 }
4242
4343
44 ngx_uint_t
44 ngx_int_t
4545 ngx_strerror_init(void)
4646 {
4747 char *msg;
6868
6969
7070 u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size);
71 ngx_uint_t ngx_strerror_init(void);
71 ngx_int_t ngx_strerror_init(void);
7272
7373
7474 #endif /* _NGX_ERRNO_H_INCLUDED_ */
5252 }
5353
5454
55 ngx_uint_t
55 ngx_int_t
5656 ngx_strerror_init(void)
5757 {
5858 return NGX_OK;
5858
5959
6060 u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size);
61 ngx_uint_t ngx_strerror_init(void);
61 ngx_int_t ngx_strerror_init(void);
6262
6363
6464 #endif /* _NGX_ERRNO_H_INCLUDED_ */
721721 if (ch == ':') {
722722 goto invalid;
723723 }
724
724
725725 if (ch == '.' || ch == ' ') {
726726 break;
727727 }