Mercurial > hg > nginx-quic
annotate src/core/ngx_string.h @ 7203:8b0553239592
HTTP/2: fixed null pointer dereference with server push.
r->headers_in.host can be NULL in ngx_http_v2_push_resource().
This happens when a request is terminated with 400 before the :authority
or Host header is parsed, and either pushing is enabled on the server{}
level or error_page 400 redirects to a location with pushes configured.
Found by Coverity (CID 1429156).
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 09 Feb 2018 23:20:08 +0300 |
parents | 874171c3c71a |
children | 9ca82f273967 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
7 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_STRING_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_STRING_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
13 #include <ngx_core.h> |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
0
diff
changeset
|
16 typedef struct { |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
17 size_t len; |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
18 u_char *data; |
19
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
0
diff
changeset
|
19 } ngx_str_t; |
d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
Igor Sysoev <igor@sysoev.ru>
parents:
0
diff
changeset
|
20 |
40
d5d4f3bba6f0
nginx-0.0.1-2002-12-26-10:24:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
26
diff
changeset
|
21 |
649 | 22 typedef struct { |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
23 ngx_str_t key; |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
24 ngx_str_t value; |
649 | 25 } ngx_keyval_t; |
26 | |
27 | |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
28 typedef struct { |
2008
66dc85397a90
escape 0x00-0x1f, ", and \ in access log variables
Igor Sysoev <igor@sysoev.ru>
parents:
1956
diff
changeset
|
29 unsigned len:28; |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
30 |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
31 unsigned valid:1; |
1565 | 32 unsigned no_cacheable:1; |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
33 unsigned not_found:1; |
2008
66dc85397a90
escape 0x00-0x1f, ", and \ in access log variables
Igor Sysoev <igor@sysoev.ru>
parents:
1956
diff
changeset
|
34 unsigned escape:1; |
1310
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
35 |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
36 u_char *data; |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
37 } ngx_variable_value_t; |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
38 |
33d6c994a0b2
Sun Studio on sparc uses different bit order
Igor Sysoev <igor@sysoev.ru>
parents:
1298
diff
changeset
|
39 |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
40 #define ngx_string(str) { sizeof(str) - 1, (u_char *) str } |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
41 #define ngx_null_string { 0, NULL } |
3516
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3512
diff
changeset
|
42 #define ngx_str_set(str, text) \ |
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3512
diff
changeset
|
43 (str)->len = sizeof(text) - 1; (str)->data = (u_char *) text |
dd1570b6f237
ngx_str_set() and ngx_str_null()
Igor Sysoev <igor@sysoev.ru>
parents:
3512
diff
changeset
|
44 #define ngx_str_null(str) (str)->len = 0; (str)->data = NULL |
477 | 45 |
46 | |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
47 #define ngx_tolower(c) (u_char) ((c >= 'A' && c <= 'Z') ? (c | 0x20) : c) |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
48 #define ngx_toupper(c) (u_char) ((c >= 'a' && c <= 'z') ? (c & ~0x20) : c) |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
49 |
2135 | 50 void ngx_strlow(u_char *dst, u_char *src, size_t n); |
51 | |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
52 |
461 | 53 #define ngx_strncmp(s1, s2, n) strncmp((const char *) s1, (const char *) s2, n) |
54 | |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
55 |
573 | 56 /* msvc and icc7 compile strcmp() to inline loop */ |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
57 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2) |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
58 |
461 | 59 |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
60 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2) |
2201 | 61 #define ngx_strlen(s) strlen((const char *) s) |
62 | |
7120
874171c3c71a
Fixed handling of non-null-terminated unix sockets.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5944
diff
changeset
|
63 size_t ngx_strnlen(u_char *p, size_t n); |
874171c3c71a
Fixed handling of non-null-terminated unix sockets.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5944
diff
changeset
|
64 |
1157 | 65 #define ngx_strchr(s1, c) strchr((const char *) s1, (int) c) |
2201 | 66 |
67 static ngx_inline u_char * | |
68 ngx_strlchr(u_char *p, u_char *last, u_char c) | |
69 { | |
70 while (p < last) { | |
71 | |
72 if (*p == c) { | |
73 return p; | |
74 } | |
75 | |
76 p++; | |
77 } | |
78 | |
79 return NULL; | |
80 } | |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
175
diff
changeset
|
81 |
461 | 82 |
107
b5be4b0448d3
nginx-0.0.1-2003-07-01-19:00:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
83 /* |
573 | 84 * msvc and icc7 compile memset() to the inline "rep stos" |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
409
diff
changeset
|
85 * while ZeroMemory() and bzero() are the calls. |
573 | 86 * icc7 may also inline several mov's of a zeroed register for small blocks. |
107
b5be4b0448d3
nginx-0.0.1-2003-07-01-19:00:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
87 */ |
515 | 88 #define ngx_memzero(buf, n) (void) memset(buf, 0, n) |
89 #define ngx_memset(buf, c, n) (void) memset(buf, c, n) | |
107
b5be4b0448d3
nginx-0.0.1-2003-07-01-19:00:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
90 |
461 | 91 |
583 | 92 #if (NGX_MEMCPY_LIMIT) |
93 | |
4781
814541b2ec23
Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
94 void *ngx_memcpy(void *dst, const void *src, size_t n); |
3644
5d3282cfc43c
fix a bug when ngx_cpymem() returns a cast type:
Igor Sysoev <igor@sysoev.ru>
parents:
3641
diff
changeset
|
95 #define ngx_cpymem(dst, src, n) (((u_char *) ngx_memcpy(dst, src, n)) + (n)) |
583 | 96 |
97 #else | |
98 | |
573 | 99 /* |
100 * gcc3, msvc, and icc7 compile memcpy() to the inline "rep movs". | |
101 * gcc3 compiles memcpy(d, s, 4) to the inline "mov"es. | |
102 * icc8 compile memcpy(d, s, 4) to the inline "mov"es or XMM moves. | |
103 */ | |
515 | 104 #define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n) |
3644
5d3282cfc43c
fix a bug when ngx_cpymem() returns a cast type:
Igor Sysoev <igor@sysoev.ru>
parents:
3641
diff
changeset
|
105 #define ngx_cpymem(dst, src, n) (((u_char *) memcpy(dst, src, n)) + (n)) |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
106 |
583 | 107 #endif |
108 | |
461 | 109 |
573 | 110 #if ( __INTEL_COMPILER >= 800 ) |
111 | |
112 /* | |
113 * the simple inline cycle copies the variable length strings up to 16 | |
114 * bytes faster than icc8 autodetecting _intel_fast_memcpy() | |
115 */ | |
116 | |
117 static ngx_inline u_char * | |
118 ngx_copy(u_char *dst, u_char *src, size_t len) | |
119 { | |
120 if (len < 17) { | |
121 | |
122 while (len) { | |
123 *dst++ = *src++; | |
124 len--; | |
125 } | |
126 | |
127 return dst; | |
128 | |
129 } else { | |
130 return ngx_cpymem(dst, src, len); | |
131 } | |
132 } | |
133 | |
134 #else | |
135 | |
136 #define ngx_copy ngx_cpymem | |
137 | |
138 #endif | |
139 | |
140 | |
3887
e7798b5e990a
use memmove() in appropriate places
Igor Sysoev <igor@sysoev.ru>
parents:
3756
diff
changeset
|
141 #define ngx_memmove(dst, src, n) (void) memmove(dst, src, n) |
e7798b5e990a
use memmove() in appropriate places
Igor Sysoev <igor@sysoev.ru>
parents:
3756
diff
changeset
|
142 #define ngx_movemem(dst, src, n) (((u_char *) memmove(dst, src, n)) + (n)) |
e7798b5e990a
use memmove() in appropriate places
Igor Sysoev <igor@sysoev.ru>
parents:
3756
diff
changeset
|
143 |
e7798b5e990a
use memmove() in appropriate places
Igor Sysoev <igor@sysoev.ru>
parents:
3756
diff
changeset
|
144 |
573 | 145 /* msvc and icc7 compile memcmp() to the inline loop */ |
1648 | 146 #define ngx_memcmp(s1, s2, n) memcmp((const char *) s1, (const char *) s2, n) |
107
b5be4b0448d3
nginx-0.0.1-2003-07-01-19:00:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
147 |
461 | 148 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
288
diff
changeset
|
149 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); |
485 | 150 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src); |
503 | 151 u_char * ngx_cdecl ngx_sprintf(u_char *buf, const char *fmt, ...); |
152 u_char * ngx_cdecl ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...); | |
2763
819bea4e964e
ngx_vslprintf(), ngx_slprintf()
Igor Sysoev <igor@sysoev.ru>
parents:
2668
diff
changeset
|
153 u_char * ngx_cdecl ngx_slprintf(u_char *buf, u_char *last, const char *fmt, |
819bea4e964e
ngx_vslprintf(), ngx_slprintf()
Igor Sysoev <igor@sysoev.ru>
parents:
2668
diff
changeset
|
154 ...); |
819bea4e964e
ngx_vslprintf(), ngx_slprintf()
Igor Sysoev <igor@sysoev.ru>
parents:
2668
diff
changeset
|
155 u_char *ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args); |
819bea4e964e
ngx_vslprintf(), ngx_slprintf()
Igor Sysoev <igor@sysoev.ru>
parents:
2668
diff
changeset
|
156 #define ngx_vsnprintf(buf, max, fmt, args) \ |
819bea4e964e
ngx_vslprintf(), ngx_slprintf()
Igor Sysoev <igor@sysoev.ru>
parents:
2668
diff
changeset
|
157 ngx_vslprintf(buf, buf + (max), fmt, args) |
455 | 158 |
1107
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
159 ngx_int_t ngx_strcasecmp(u_char *s1, u_char *s2); |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
160 ngx_int_t ngx_strncasecmp(u_char *s1, u_char *s2, size_t n); |
db7c468c447d
ngx_strcasecmp()/ngx_strncasecmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1029
diff
changeset
|
161 |
1552 | 162 u_char *ngx_strnstr(u_char *s1, char *s2, size_t n); |
163 | |
1542
f5bd1a7ed2cd
ngx_strstrn() and ngx_strcasestrn()
Igor Sysoev <igor@sysoev.ru>
parents:
1405
diff
changeset
|
164 u_char *ngx_strstrn(u_char *s1, char *s2, size_t n); |
f5bd1a7ed2cd
ngx_strstrn() and ngx_strcasestrn()
Igor Sysoev <igor@sysoev.ru>
parents:
1405
diff
changeset
|
165 u_char *ngx_strcasestrn(u_char *s1, char *s2, size_t n); |
2668 | 166 u_char *ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n); |
1542
f5bd1a7ed2cd
ngx_strstrn() and ngx_strcasestrn()
Igor Sysoev <igor@sysoev.ru>
parents:
1405
diff
changeset
|
167 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
288
diff
changeset
|
168 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); |
455 | 169 ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n); |
1029
ce08bc4cb97b
ngx_strn2cmp() > ngx_memn2cmp()
Igor Sysoev <igor@sysoev.ru>
parents:
1024
diff
changeset
|
170 ngx_int_t ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2); |
3116
98e288c6dac3
If .domain.com, .sub.domain.com, and .domain-some.com were defined,
Igor Sysoev <igor@sysoev.ru>
parents:
2763
diff
changeset
|
171 ngx_int_t ngx_dns_strcmp(u_char *s1, u_char *s2); |
5389
72e31d88defa
Added ngx_filename_cmp() with "/" sorted to the left.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4781
diff
changeset
|
172 ngx_int_t ngx_filename_cmp(u_char *s1, u_char *s2, size_t n); |
338
0376cffa29e6
nginx-0.0.3-2004-05-20-21:33:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
173 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
288
diff
changeset
|
174 ngx_int_t ngx_atoi(u_char *line, size_t n); |
3512 | 175 ngx_int_t ngx_atofp(u_char *line, size_t n, size_t point); |
501 | 176 ssize_t ngx_atosz(u_char *line, size_t n); |
177 off_t ngx_atoof(u_char *line, size_t n); | |
178 time_t ngx_atotm(u_char *line, size_t n); | |
338
0376cffa29e6
nginx-0.0.3-2004-05-20-21:33:52 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
179 ngx_int_t ngx_hextoi(u_char *line, size_t n); |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
180 |
1745
ec63069aeb78
replace ngx_md5_text() with ngx_hex_dump()
Igor Sysoev <igor@sysoev.ru>
parents:
1648
diff
changeset
|
181 u_char *ngx_hex_dump(u_char *dst, u_char *src, size_t len); |
174
ea464a6c0581
nginx-0.0.1-2003-11-05-01:12:39 import
Igor Sysoev <igor@sysoev.ru>
parents:
135
diff
changeset
|
182 |
409
8ac40cae79f0
nginx-0.0.10-2004-08-29-07:55:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
408
diff
changeset
|
183 |
8ac40cae79f0
nginx-0.0.10-2004-08-29-07:55:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
408
diff
changeset
|
184 #define ngx_base64_encoded_length(len) (((len + 2) / 3) * 4) |
8ac40cae79f0
nginx-0.0.10-2004-08-29-07:55:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
408
diff
changeset
|
185 #define ngx_base64_decoded_length(len) (((len + 3) / 4) * 3) |
8ac40cae79f0
nginx-0.0.10-2004-08-29-07:55:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
408
diff
changeset
|
186 |
452 | 187 void ngx_encode_base64(ngx_str_t *dst, ngx_str_t *src); |
5551
a602e1006579
Core: added ngx_encode_base64url().
Maxim Dounin <mdounin@mdounin.ru>
parents:
5389
diff
changeset
|
188 void ngx_encode_base64url(ngx_str_t *dst, ngx_str_t *src); |
452 | 189 ngx_int_t ngx_decode_base64(ngx_str_t *dst, ngx_str_t *src); |
3756
7224d008faaf
new ngx_http_secure_link_module with secure_link, secure_link_md5, and
Igor Sysoev <igor@sysoev.ru>
parents:
3644
diff
changeset
|
190 ngx_int_t ngx_decode_base64url(ngx_str_t *dst, ngx_str_t *src); |
461 | 191 |
2125
8e4b9d2acde8
rename ngx_utf_...() to ngx_utf8_...()
Igor Sysoev <igor@sysoev.ru>
parents:
2120
diff
changeset
|
192 uint32_t ngx_utf8_decode(u_char **p, size_t n); |
8e4b9d2acde8
rename ngx_utf_...() to ngx_utf8_...()
Igor Sysoev <igor@sysoev.ru>
parents:
2120
diff
changeset
|
193 size_t ngx_utf8_length(u_char *p, size_t n); |
8e4b9d2acde8
rename ngx_utf_...() to ngx_utf8_...()
Igor Sysoev <igor@sysoev.ru>
parents:
2120
diff
changeset
|
194 u_char *ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len); |
527 | 195 |
461 | 196 |
4192
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
197 #define NGX_ESCAPE_URI 0 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
198 #define NGX_ESCAPE_ARGS 1 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
199 #define NGX_ESCAPE_URI_COMPONENT 2 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
200 #define NGX_ESCAPE_HTML 3 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
201 #define NGX_ESCAPE_REFRESH 4 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
202 #define NGX_ESCAPE_MEMCACHED 5 |
61e4af19df9f
Autoindex: escape '?' in file names.
Maxim Dounin <mdounin@mdounin.ru>
parents:
3887
diff
changeset
|
203 #define NGX_ESCAPE_MAIL_AUTH 6 |
601 | 204 |
1593 | 205 #define NGX_UNESCAPE_URI 1 |
206 #define NGX_UNESCAPE_REDIRECT 2 | |
461 | 207 |
485 | 208 uintptr_t ngx_escape_uri(u_char *dst, u_char *src, size_t size, |
493 | 209 ngx_uint_t type); |
601 | 210 void ngx_unescape_uri(u_char **dst, u_char **src, size_t size, ngx_uint_t type); |
1544 | 211 uintptr_t ngx_escape_html(u_char *dst, u_char *src, size_t size); |
5944
33c08d7e2915
Autoindex: implemented JSON output format.
Valentin Bartenev <vbart@nginx.com>
parents:
5551
diff
changeset
|
212 uintptr_t ngx_escape_json(u_char *dst, u_char *src, size_t size); |
1544 | 213 |
408
d6e2b445c1b8
nginx-0.0.10-2004-08-27-19:40:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
338
diff
changeset
|
214 |
3641
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
215 typedef struct { |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
216 ngx_rbtree_node_t node; |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
217 ngx_str_t str; |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
218 } ngx_str_node_t; |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
219 |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
220 |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
221 void ngx_str_rbtree_insert_value(ngx_rbtree_node_t *temp, |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
222 ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
223 ngx_str_node_t *ngx_str_rbtree_lookup(ngx_rbtree_t *rbtree, ngx_str_t *name, |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
224 uint32_t hash); |
6802ba529ec4
change ngx_http_variable_value_node_t to more generic ngx_str_node_t
Igor Sysoev <igor@sysoev.ru>
parents:
3516
diff
changeset
|
225 |
174
ea464a6c0581
nginx-0.0.1-2003-11-05-01:12:39 import
Igor Sysoev <igor@sysoev.ru>
parents:
135
diff
changeset
|
226 |
1208 | 227 void ngx_sort(void *base, size_t n, size_t size, |
1956
cb8c0c8e0c27
use ngx_int_t in ngx_sort() callback
Igor Sysoev <igor@sysoev.ru>
parents:
1745
diff
changeset
|
228 ngx_int_t (*cmp)(const void *, const void *)); |
1333
07ebeeb55700
escape space, etc in $memcached_key
Igor Sysoev <igor@sysoev.ru>
parents:
1310
diff
changeset
|
229 #define ngx_qsort qsort |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
230 |
97
70d2345a903f
nginx-0.0.1-2003-05-29-17:02:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
231 |
1333
07ebeeb55700
escape space, etc in $memcached_key
Igor Sysoev <igor@sysoev.ru>
parents:
1310
diff
changeset
|
232 #define ngx_value_helper(n) #n |
07ebeeb55700
escape space, etc in $memcached_key
Igor Sysoev <igor@sysoev.ru>
parents:
1310
diff
changeset
|
233 #define ngx_value(n) ngx_value_helper(n) |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
234 |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
84
diff
changeset
|
235 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
236 #endif /* _NGX_STRING_H_INCLUDED_ */ |