comparison src/core/ngx_string.h @ 122:d25a1d6034f1 NGINX_0_3_8

nginx 0.3.8 *) Security: nginx now checks URI got from a backend in "X-Accel-Redirect" header line or in SSI file for the "/../" paths and zeroes. *) Change: nginx now does not treat the empty user name in the "Authorization" header line as valid one. *) Feature: the "ssl_session_timeout" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Feature: the "auth_http_header" directive of the ngx_imap_auth_http_module. *) Feature: the "add_header" directive. *) Feature: the ngx_http_realip_module. *) Feature: the new variables to use in the "log_format" directive: $bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri, $request_time, $request_length, $upstream_status, $upstream_response_time, $gzip_ratio, $uid_got, $uid_set, $connection, $pipe, and $msec. The parameters in the "%name" form will be canceled soon. *) Change: now the false variable values in the "if" directive are the empty string "" and string starting with "0". *) Bugfix: while using proxied or FastCGI-server nginx may leave connections and temporary files with client requests in open state. *) Bugfix: the worker processes did not flush the buffered logs on graceful exit. *) Bugfix: if the request URI was changes by the "rewrite" directive and the request was proxied in location given by regular expression, then the incorrect request was transferred to backend; bug appeared in 0.2.6. *) Bugfix: the "expires" directive did not remove the previous "Expires" header. *) Bugfix: nginx may stop to accept requests if the "rtsig" method and several worker processes were used. *) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in SSI commands. *) Bugfix: if the response was ended just after the SSI command and gzipping was used, then the response did not transferred complete or did not transferred at all.
author Igor Sysoev <http://sysoev.ru>
date Wed, 09 Nov 2005 00:00:00 +0300
parents da9a3b14312d
children df17fbafec8f
comparison
equal deleted inserted replaced
121:737953b238a4 122:d25a1d6034f1
44 44
45 45
46 #define ngx_strncmp(s1, s2, n) strncmp((const char *) s1, (const char *) s2, n) 46 #define ngx_strncmp(s1, s2, n) strncmp((const char *) s1, (const char *) s2, n)
47 47
48 48
49 /* msvc and icc compile strcmp() to inline loop */ 49 /* msvc and icc7 compile strcmp() to inline loop */
50 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2) 50 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2)
51 51
52 52
53 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2) 53 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2)
54 #define ngx_strlen(s) strlen((const char *) s) 54 #define ngx_strlen(s) strlen((const char *) s)
55 55
56 56
57 /* 57 /*
58 * msvc and icc compile memset() to the inline "rep stos" 58 * msvc and icc7 compile memset() to the inline "rep stos"
59 * while ZeroMemory() and bzero() are the calls. 59 * while ZeroMemory() and bzero() are the calls.
60 * icc may also inline several mov's of a zeroed register for small blocks. 60 * icc7 may also inline several mov's of a zeroed register for small blocks.
61 */ 61 */
62 #define ngx_memzero(buf, n) (void) memset(buf, 0, n) 62 #define ngx_memzero(buf, n) (void) memset(buf, 0, n)
63 #define ngx_memset(buf, c, n) (void) memset(buf, c, n) 63 #define ngx_memset(buf, c, n) (void) memset(buf, c, n)
64 64
65 65
66 /* msvc and icc compile memcpy() to the inline "rep movs" */ 66 /*
67 * gcc3, msvc, and icc7 compile memcpy() to the inline "rep movs".
68 * gcc3 compiles memcpy(d, s, 4) to the inline "mov"es.
69 * icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves.
70 */
67 #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n) 71 #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n)
68 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + (n) 72 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + (n)
69 73
70 74
71 /* msvc and icc compile memcmp() to the inline loop */ 75 #if ( __INTEL_COMPILER >= 800 )
76
77 /*
78 * the simple inline cycle copies the variable length strings up to 16
79 * bytes faster than icc8 autodetecting _intel_fast_memcpy()
80 */
81
82 static ngx_inline u_char *
83 ngx_copy(u_char *dst, u_char *src, size_t len)
84 {
85 if (len < 17) {
86
87 while (len) {
88 *dst++ = *src++;
89 len--;
90 }
91
92 return dst;
93
94 } else {
95 return ngx_cpymem(dst, src, len);
96 }
97 }
98
99 #else
100
101 #define ngx_copy ngx_cpymem
102
103 #endif
104
105
106 /* msvc and icc7 compile memcmp() to the inline loop */
72 #define ngx_memcmp memcmp 107 #define ngx_memcmp memcmp
73 108
74 109
75 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); 110 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n);
76 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src); 111 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src);