Merge lp:~groldster/ubuntu/maverick/nginx/merge-from-sid-0.7.67-2 into lp:ubuntu/maverick/nginx
- Maverick (10.10)
- merge-from-sid-0.7.67-2
- Merge into maverick
Proposed by
Mikhail Turov
Status: | Merged |
---|---|
Merged at revision: | 33 |
Proposed branch: | lp:~groldster/ubuntu/maverick/nginx/merge-from-sid-0.7.67-2 |
Merge into: | lp:ubuntu/maverick/nginx |
Diff against target: |
4347 lines (+2367/-363) 83 files modified
.pc/applied-patches (+1/-0) .pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c (+1343/-0) CHANGES (+121/-0) CHANGES.ru (+126/-2) auto/cc/conf (+1/-0) auto/cc/gcc (+0/-2) auto/feature (+1/-1) auto/lib/openssl/conf (+2/-0) auto/lib/openssl/make (+1/-1) auto/lib/openssl/makefile.bcc (+1/-2) auto/lib/openssl/makefile.msvc (+1/-2) auto/lib/zlib/make (+3/-3) auto/modules (+8/-8) auto/unix (+10/-0) debian/README.Debian (+9/-0) debian/changelog (+101/-0) debian/conf/mime.types (+2/-0) debian/conf/sites-available/default (+7/-4) debian/control (+2/-1) debian/copyright (+37/-36) debian/init.d (+2/-1) debian/patches/fix_reloading_ipv6.diff (+15/-0) debian/patches/series (+1/-0) debian/rules (+10/-5) src/core/nginx.h (+2/-2) src/core/ngx_cycle.c (+2/-2) src/core/ngx_file.c (+6/-4) src/core/ngx_open_file_cache.c (+8/-1) src/core/ngx_string.c (+2/-2) src/core/ngx_times.c (+73/-9) src/core/ngx_times.h (+2/-1) src/event/modules/ngx_devpoll_module.c (+2/-2) src/event/modules/ngx_epoll_module.c (+2/-2) src/event/modules/ngx_eventport_module.c (+2/-2) src/event/modules/ngx_kqueue_module.c (+3/-3) src/event/modules/ngx_poll_module.c (+2/-2) src/event/modules/ngx_rtsig_module.c (+4/-4) src/event/modules/ngx_select_module.c (+2/-2) src/event/modules/ngx_win32_select_module.c (+1/-1) src/event/ngx_event.c (+0/-2) src/event/ngx_event_openssl.c (+12/-2) src/event/ngx_event_openssl.h (+1/-0) src/http/modules/ngx_http_autoindex_module.c (+0/-4) src/http/modules/ngx_http_chunked_filter_module.c (+10/-2) src/http/modules/ngx_http_dav_module.c (+7/-11) src/http/modules/ngx_http_fastcgi_module.c (+11/-0) src/http/modules/ngx_http_flv_module.c (+0/-4) src/http/modules/ngx_http_geo_module.c (+1/-1) src/http/modules/ngx_http_geoip_module.c (+80/-28) src/http/modules/ngx_http_gzip_static_module.c (+1/-5) src/http/modules/ngx_http_image_filter_module.c (+33/-13) src/http/modules/ngx_http_index_module.c (+0/-4) src/http/modules/ngx_http_memcached_module.c (+8/-3) src/http/modules/ngx_http_proxy_module.c (+22/-2) src/http/modules/ngx_http_random_index_module.c (+0/-4) src/http/modules/ngx_http_referer_module.c (+20/-11) src/http/modules/ngx_http_rewrite_module.c (+4/-7) src/http/modules/ngx_http_ssi_filter_module.c (+17/-21) src/http/modules/ngx_http_static_module.c (+1/-5) src/http/modules/ngx_http_userid_filter_module.c (+1/-1) src/http/modules/perl/nginx.pm (+1/-1) src/http/modules/perl/nginx.xs (+1/-4) src/http/modules/perl/ngx_http_perl_module.c (+0/-10) src/http/ngx_http_cache.h (+5/-0) src/http/ngx_http_copy_filter_module.c (+3/-1) src/http/ngx_http_core_module.c (+29/-10) src/http/ngx_http_core_module.h (+1/-0) src/http/ngx_http_file_cache.c (+68/-2) src/http/ngx_http_header_filter_module.c (+2/-2) src/http/ngx_http_parse.c (+19/-38) src/http/ngx_http_request.c (+28/-7) src/http/ngx_http_request.h (+3/-4) src/http/ngx_http_special_response.c (+11/-13) src/http/ngx_http_upstream.c (+13/-10) src/http/ngx_http_upstream.h (+1/-0) src/http/ngx_http_variables.c (+6/-10) src/http/ngx_http_variables.h (+1/-1) src/mail/ngx_mail_pop3_handler.c (+0/-2) src/mail/ngx_mail_proxy_module.c (+1/-1) src/os/unix/ngx_errno.h (+13/-1) src/os/unix/ngx_files.h (+4/-0) src/os/unix/ngx_process.c (+7/-6) src/os/unix/ngx_process_cycle.c (+3/-3) |
To merge this branch: | bzr merge lp:~groldster/ubuntu/maverick/nginx/merge-from-sid-0.7.67-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Holbach (community) | Approve | ||
Ubuntu branches | Pending | ||
Review via email: mp+30513@code.launchpad.net |
Commit message
Description of the change
merging nginx 0.7.67 (httpd) from Debian unstable (httpd)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.pc/applied-patches' | |||
2 | --- .pc/applied-patches 2010-03-03 23:50:36 +0000 | |||
3 | +++ .pc/applied-patches 2010-07-21 11:15:58 +0000 | |||
4 | @@ -1,2 +1,3 @@ | |||
5 | 1 | nginx-upstream-fair.diff | 1 | nginx-upstream-fair.diff |
6 | 2 | dlopen.diff | 2 | dlopen.diff |
7 | 3 | fix_reloading_ipv6.diff | ||
8 | 3 | 4 | ||
9 | === added directory '.pc/fix_reloading_ipv6.diff' | |||
10 | === added directory '.pc/fix_reloading_ipv6.diff/src' | |||
11 | === added directory '.pc/fix_reloading_ipv6.diff/src/core' | |||
12 | === added file '.pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c' | |||
13 | --- .pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c 1970-01-01 00:00:00 +0000 | |||
14 | +++ .pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c 2010-07-21 11:15:58 +0000 | |||
15 | @@ -0,0 +1,1343 @@ | |||
16 | 1 | |||
17 | 2 | /* | ||
18 | 3 | * Copyright (C) Igor Sysoev | ||
19 | 4 | */ | ||
20 | 5 | |||
21 | 6 | |||
22 | 7 | #include <ngx_config.h> | ||
23 | 8 | #include <ngx_core.h> | ||
24 | 9 | #include <ngx_event.h> | ||
25 | 10 | |||
26 | 11 | |||
27 | 12 | static void ngx_destroy_cycle_pools(ngx_conf_t *conf); | ||
28 | 13 | static ngx_int_t ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2); | ||
29 | 14 | static ngx_int_t ngx_init_zone_pool(ngx_cycle_t *cycle, | ||
30 | 15 | ngx_shm_zone_t *shm_zone); | ||
31 | 16 | static ngx_int_t ngx_test_lockfile(u_char *file, ngx_log_t *log); | ||
32 | 17 | static void ngx_clean_old_cycles(ngx_event_t *ev); | ||
33 | 18 | |||
34 | 19 | |||
35 | 20 | volatile ngx_cycle_t *ngx_cycle; | ||
36 | 21 | ngx_array_t ngx_old_cycles; | ||
37 | 22 | |||
38 | 23 | static ngx_pool_t *ngx_temp_pool; | ||
39 | 24 | static ngx_event_t ngx_cleaner_event; | ||
40 | 25 | |||
41 | 26 | ngx_uint_t ngx_test_config; | ||
42 | 27 | |||
43 | 28 | #if (NGX_THREADS) | ||
44 | 29 | ngx_tls_key_t ngx_core_tls_key; | ||
45 | 30 | #endif | ||
46 | 31 | |||
47 | 32 | |||
48 | 33 | /* STUB NAME */ | ||
49 | 34 | static ngx_connection_t dumb; | ||
50 | 35 | /* STUB */ | ||
51 | 36 | |||
52 | 37 | static ngx_str_t error_log = ngx_string(NGX_ERROR_LOG_PATH); | ||
53 | 38 | |||
54 | 39 | |||
55 | 40 | ngx_cycle_t * | ||
56 | 41 | ngx_init_cycle(ngx_cycle_t *old_cycle) | ||
57 | 42 | { | ||
58 | 43 | void *rv; | ||
59 | 44 | char **senv, **env; | ||
60 | 45 | ngx_uint_t i, n; | ||
61 | 46 | ngx_log_t *log; | ||
62 | 47 | ngx_time_t *tp; | ||
63 | 48 | ngx_conf_t conf; | ||
64 | 49 | ngx_pool_t *pool; | ||
65 | 50 | ngx_cycle_t *cycle, **old; | ||
66 | 51 | ngx_shm_zone_t *shm_zone, *oshm_zone; | ||
67 | 52 | ngx_list_part_t *part, *opart; | ||
68 | 53 | ngx_open_file_t *file; | ||
69 | 54 | ngx_listening_t *ls, *nls; | ||
70 | 55 | ngx_core_conf_t *ccf, *old_ccf; | ||
71 | 56 | ngx_core_module_t *module; | ||
72 | 57 | char hostname[NGX_MAXHOSTNAMELEN]; | ||
73 | 58 | |||
74 | 59 | ngx_timezone_update(); | ||
75 | 60 | |||
76 | 61 | /* force localtime update with a new timezone */ | ||
77 | 62 | |||
78 | 63 | tp = ngx_timeofday(); | ||
79 | 64 | tp->sec = 0; | ||
80 | 65 | |||
81 | 66 | ngx_time_update(); | ||
82 | 67 | |||
83 | 68 | |||
84 | 69 | log = old_cycle->log; | ||
85 | 70 | |||
86 | 71 | pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, log); | ||
87 | 72 | if (pool == NULL) { | ||
88 | 73 | return NULL; | ||
89 | 74 | } | ||
90 | 75 | pool->log = log; | ||
91 | 76 | |||
92 | 77 | cycle = ngx_pcalloc(pool, sizeof(ngx_cycle_t)); | ||
93 | 78 | if (cycle == NULL) { | ||
94 | 79 | ngx_destroy_pool(pool); | ||
95 | 80 | return NULL; | ||
96 | 81 | } | ||
97 | 82 | |||
98 | 83 | cycle->pool = pool; | ||
99 | 84 | cycle->log = log; | ||
100 | 85 | cycle->new_log.log_level = NGX_LOG_ERR; | ||
101 | 86 | cycle->old_cycle = old_cycle; | ||
102 | 87 | |||
103 | 88 | cycle->conf_prefix.len = old_cycle->conf_prefix.len; | ||
104 | 89 | cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix); | ||
105 | 90 | if (cycle->conf_prefix.data == NULL) { | ||
106 | 91 | ngx_destroy_pool(pool); | ||
107 | 92 | return NULL; | ||
108 | 93 | } | ||
109 | 94 | |||
110 | 95 | cycle->prefix.len = old_cycle->prefix.len; | ||
111 | 96 | cycle->prefix.data = ngx_pstrdup(pool, &old_cycle->prefix); | ||
112 | 97 | if (cycle->prefix.data == NULL) { | ||
113 | 98 | ngx_destroy_pool(pool); | ||
114 | 99 | return NULL; | ||
115 | 100 | } | ||
116 | 101 | |||
117 | 102 | cycle->conf_file.len = old_cycle->conf_file.len; | ||
118 | 103 | cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1); | ||
119 | 104 | if (cycle->conf_file.data == NULL) { | ||
120 | 105 | ngx_destroy_pool(pool); | ||
121 | 106 | return NULL; | ||
122 | 107 | } | ||
123 | 108 | ngx_cpystrn(cycle->conf_file.data, old_cycle->conf_file.data, | ||
124 | 109 | old_cycle->conf_file.len + 1); | ||
125 | 110 | |||
126 | 111 | cycle->conf_param.len = old_cycle->conf_param.len; | ||
127 | 112 | cycle->conf_param.data = ngx_pstrdup(pool, &old_cycle->conf_param); | ||
128 | 113 | if (cycle->conf_param.data == NULL) { | ||
129 | 114 | ngx_destroy_pool(pool); | ||
130 | 115 | return NULL; | ||
131 | 116 | } | ||
132 | 117 | |||
133 | 118 | |||
134 | 119 | n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10; | ||
135 | 120 | |||
136 | 121 | cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *)); | ||
137 | 122 | if (cycle->pathes.elts == NULL) { | ||
138 | 123 | ngx_destroy_pool(pool); | ||
139 | 124 | return NULL; | ||
140 | 125 | } | ||
141 | 126 | |||
142 | 127 | cycle->pathes.nelts = 0; | ||
143 | 128 | cycle->pathes.size = sizeof(ngx_path_t *); | ||
144 | 129 | cycle->pathes.nalloc = n; | ||
145 | 130 | cycle->pathes.pool = pool; | ||
146 | 131 | |||
147 | 132 | |||
148 | 133 | if (old_cycle->open_files.part.nelts) { | ||
149 | 134 | n = old_cycle->open_files.part.nelts; | ||
150 | 135 | for (part = old_cycle->open_files.part.next; part; part = part->next) { | ||
151 | 136 | n += part->nelts; | ||
152 | 137 | } | ||
153 | 138 | |||
154 | 139 | } else { | ||
155 | 140 | n = 20; | ||
156 | 141 | } | ||
157 | 142 | |||
158 | 143 | if (ngx_list_init(&cycle->open_files, pool, n, sizeof(ngx_open_file_t)) | ||
159 | 144 | != NGX_OK) | ||
160 | 145 | { | ||
161 | 146 | ngx_destroy_pool(pool); | ||
162 | 147 | return NULL; | ||
163 | 148 | } | ||
164 | 149 | |||
165 | 150 | |||
166 | 151 | if (old_cycle->shared_memory.part.nelts) { | ||
167 | 152 | n = old_cycle->shared_memory.part.nelts; | ||
168 | 153 | for (part = old_cycle->shared_memory.part.next; part; part = part->next) | ||
169 | 154 | { | ||
170 | 155 | n += part->nelts; | ||
171 | 156 | } | ||
172 | 157 | |||
173 | 158 | } else { | ||
174 | 159 | n = 1; | ||
175 | 160 | } | ||
176 | 161 | |||
177 | 162 | if (ngx_list_init(&cycle->shared_memory, pool, n, sizeof(ngx_shm_zone_t)) | ||
178 | 163 | != NGX_OK) | ||
179 | 164 | { | ||
180 | 165 | ngx_destroy_pool(pool); | ||
181 | 166 | return NULL; | ||
182 | 167 | } | ||
183 | 168 | |||
184 | 169 | n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10; | ||
185 | 170 | |||
186 | 171 | cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t)); | ||
187 | 172 | if (cycle->listening.elts == NULL) { | ||
188 | 173 | ngx_destroy_pool(pool); | ||
189 | 174 | return NULL; | ||
190 | 175 | } | ||
191 | 176 | |||
192 | 177 | cycle->listening.nelts = 0; | ||
193 | 178 | cycle->listening.size = sizeof(ngx_listening_t); | ||
194 | 179 | cycle->listening.nalloc = n; | ||
195 | 180 | cycle->listening.pool = pool; | ||
196 | 181 | |||
197 | 182 | |||
198 | 183 | cycle->conf_ctx = ngx_pcalloc(pool, ngx_max_module * sizeof(void *)); | ||
199 | 184 | if (cycle->conf_ctx == NULL) { | ||
200 | 185 | ngx_destroy_pool(pool); | ||
201 | 186 | return NULL; | ||
202 | 187 | } | ||
203 | 188 | |||
204 | 189 | |||
205 | 190 | if (gethostname(hostname, NGX_MAXHOSTNAMELEN) == -1) { | ||
206 | 191 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "gethostname() failed"); | ||
207 | 192 | ngx_destroy_pool(pool); | ||
208 | 193 | return NULL; | ||
209 | 194 | } | ||
210 | 195 | |||
211 | 196 | /* on Linux gethostname() silently truncates name that does not fit */ | ||
212 | 197 | |||
213 | 198 | hostname[NGX_MAXHOSTNAMELEN - 1] = '\0'; | ||
214 | 199 | cycle->hostname.len = ngx_strlen(hostname); | ||
215 | 200 | |||
216 | 201 | cycle->hostname.data = ngx_pnalloc(pool, cycle->hostname.len); | ||
217 | 202 | if (cycle->hostname.data == NULL) { | ||
218 | 203 | ngx_destroy_pool(pool); | ||
219 | 204 | return NULL; | ||
220 | 205 | } | ||
221 | 206 | |||
222 | 207 | ngx_memcpy(cycle->hostname.data, hostname, cycle->hostname.len); | ||
223 | 208 | |||
224 | 209 | |||
225 | 210 | for (i = 0; ngx_modules[i]; i++) { | ||
226 | 211 | if (ngx_modules[i]->type != NGX_CORE_MODULE) { | ||
227 | 212 | continue; | ||
228 | 213 | } | ||
229 | 214 | |||
230 | 215 | module = ngx_modules[i]->ctx; | ||
231 | 216 | |||
232 | 217 | if (module->create_conf) { | ||
233 | 218 | rv = module->create_conf(cycle); | ||
234 | 219 | if (rv == NULL) { | ||
235 | 220 | ngx_destroy_pool(pool); | ||
236 | 221 | return NULL; | ||
237 | 222 | } | ||
238 | 223 | cycle->conf_ctx[ngx_modules[i]->index] = rv; | ||
239 | 224 | } | ||
240 | 225 | } | ||
241 | 226 | |||
242 | 227 | |||
243 | 228 | senv = environ; | ||
244 | 229 | |||
245 | 230 | |||
246 | 231 | ngx_memzero(&conf, sizeof(ngx_conf_t)); | ||
247 | 232 | /* STUB: init array ? */ | ||
248 | 233 | conf.args = ngx_array_create(pool, 10, sizeof(ngx_str_t)); | ||
249 | 234 | if (conf.args == NULL) { | ||
250 | 235 | ngx_destroy_pool(pool); | ||
251 | 236 | return NULL; | ||
252 | 237 | } | ||
253 | 238 | |||
254 | 239 | conf.temp_pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, log); | ||
255 | 240 | if (conf.temp_pool == NULL) { | ||
256 | 241 | ngx_destroy_pool(pool); | ||
257 | 242 | return NULL; | ||
258 | 243 | } | ||
259 | 244 | |||
260 | 245 | |||
261 | 246 | conf.ctx = cycle->conf_ctx; | ||
262 | 247 | conf.cycle = cycle; | ||
263 | 248 | conf.pool = pool; | ||
264 | 249 | conf.log = log; | ||
265 | 250 | conf.module_type = NGX_CORE_MODULE; | ||
266 | 251 | conf.cmd_type = NGX_MAIN_CONF; | ||
267 | 252 | |||
268 | 253 | #if 0 | ||
269 | 254 | log->log_level = NGX_LOG_DEBUG_ALL; | ||
270 | 255 | #endif | ||
271 | 256 | |||
272 | 257 | if (ngx_conf_param(&conf) != NGX_CONF_OK) { | ||
273 | 258 | environ = senv; | ||
274 | 259 | ngx_destroy_cycle_pools(&conf); | ||
275 | 260 | return NULL; | ||
276 | 261 | } | ||
277 | 262 | |||
278 | 263 | if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) { | ||
279 | 264 | environ = senv; | ||
280 | 265 | ngx_destroy_cycle_pools(&conf); | ||
281 | 266 | return NULL; | ||
282 | 267 | } | ||
283 | 268 | |||
284 | 269 | if (ngx_test_config) { | ||
285 | 270 | ngx_log_stderr(0, "the configuration file %s syntax is ok", | ||
286 | 271 | cycle->conf_file.data); | ||
287 | 272 | } | ||
288 | 273 | |||
289 | 274 | for (i = 0; ngx_modules[i]; i++) { | ||
290 | 275 | if (ngx_modules[i]->type != NGX_CORE_MODULE) { | ||
291 | 276 | continue; | ||
292 | 277 | } | ||
293 | 278 | |||
294 | 279 | module = ngx_modules[i]->ctx; | ||
295 | 280 | |||
296 | 281 | if (module->init_conf) { | ||
297 | 282 | if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index]) | ||
298 | 283 | == NGX_CONF_ERROR) | ||
299 | 284 | { | ||
300 | 285 | environ = senv; | ||
301 | 286 | ngx_destroy_cycle_pools(&conf); | ||
302 | 287 | return NULL; | ||
303 | 288 | } | ||
304 | 289 | } | ||
305 | 290 | } | ||
306 | 291 | |||
307 | 292 | if (ngx_process == NGX_PROCESS_SIGNALLER) { | ||
308 | 293 | return cycle; | ||
309 | 294 | } | ||
310 | 295 | |||
311 | 296 | ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); | ||
312 | 297 | |||
313 | 298 | if (ngx_test_config) { | ||
314 | 299 | |||
315 | 300 | if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) { | ||
316 | 301 | goto failed; | ||
317 | 302 | } | ||
318 | 303 | |||
319 | 304 | } else if (!ngx_is_init_cycle(old_cycle)) { | ||
320 | 305 | |||
321 | 306 | /* | ||
322 | 307 | * we do not create the pid file in the first ngx_init_cycle() call | ||
323 | 308 | * because we need to write the demonized process pid | ||
324 | 309 | */ | ||
325 | 310 | |||
326 | 311 | old_ccf = (ngx_core_conf_t *) ngx_get_conf(old_cycle->conf_ctx, | ||
327 | 312 | ngx_core_module); | ||
328 | 313 | if (ccf->pid.len != old_ccf->pid.len | ||
329 | 314 | || ngx_strcmp(ccf->pid.data, old_ccf->pid.data) != 0) | ||
330 | 315 | { | ||
331 | 316 | /* new pid file name */ | ||
332 | 317 | |||
333 | 318 | if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) { | ||
334 | 319 | goto failed; | ||
335 | 320 | } | ||
336 | 321 | |||
337 | 322 | ngx_delete_pidfile(old_cycle); | ||
338 | 323 | } | ||
339 | 324 | } | ||
340 | 325 | |||
341 | 326 | |||
342 | 327 | if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) { | ||
343 | 328 | goto failed; | ||
344 | 329 | } | ||
345 | 330 | |||
346 | 331 | |||
347 | 332 | if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) { | ||
348 | 333 | goto failed; | ||
349 | 334 | } | ||
350 | 335 | |||
351 | 336 | |||
352 | 337 | if (cycle->new_log.file == NULL) { | ||
353 | 338 | cycle->new_log.file = ngx_conf_open_file(cycle, &error_log); | ||
354 | 339 | if (cycle->new_log.file == NULL) { | ||
355 | 340 | goto failed; | ||
356 | 341 | } | ||
357 | 342 | } | ||
358 | 343 | |||
359 | 344 | /* open the new files */ | ||
360 | 345 | |||
361 | 346 | part = &cycle->open_files.part; | ||
362 | 347 | file = part->elts; | ||
363 | 348 | |||
364 | 349 | for (i = 0; /* void */ ; i++) { | ||
365 | 350 | |||
366 | 351 | if (i >= part->nelts) { | ||
367 | 352 | if (part->next == NULL) { | ||
368 | 353 | break; | ||
369 | 354 | } | ||
370 | 355 | part = part->next; | ||
371 | 356 | file = part->elts; | ||
372 | 357 | i = 0; | ||
373 | 358 | } | ||
374 | 359 | |||
375 | 360 | if (file[i].name.len == 0) { | ||
376 | 361 | continue; | ||
377 | 362 | } | ||
378 | 363 | |||
379 | 364 | file[i].fd = ngx_open_file(file[i].name.data, | ||
380 | 365 | NGX_FILE_APPEND, | ||
381 | 366 | NGX_FILE_CREATE_OR_OPEN, | ||
382 | 367 | NGX_FILE_DEFAULT_ACCESS); | ||
383 | 368 | |||
384 | 369 | ngx_log_debug3(NGX_LOG_DEBUG_CORE, log, 0, | ||
385 | 370 | "log: %p %d \"%s\"", | ||
386 | 371 | &file[i], file[i].fd, file[i].name.data); | ||
387 | 372 | |||
388 | 373 | if (file[i].fd == NGX_INVALID_FILE) { | ||
389 | 374 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
390 | 375 | ngx_open_file_n " \"%s\" failed", | ||
391 | 376 | file[i].name.data); | ||
392 | 377 | goto failed; | ||
393 | 378 | } | ||
394 | 379 | |||
395 | 380 | #if !(NGX_WIN32) | ||
396 | 381 | if (fcntl(file[i].fd, F_SETFD, FD_CLOEXEC) == -1) { | ||
397 | 382 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
398 | 383 | "fcntl(FD_CLOEXEC) \"%s\" failed", | ||
399 | 384 | file[i].name.data); | ||
400 | 385 | goto failed; | ||
401 | 386 | } | ||
402 | 387 | #endif | ||
403 | 388 | } | ||
404 | 389 | |||
405 | 390 | cycle->log = &cycle->new_log; | ||
406 | 391 | pool->log = &cycle->new_log; | ||
407 | 392 | |||
408 | 393 | |||
409 | 394 | /* create shared memory */ | ||
410 | 395 | |||
411 | 396 | part = &cycle->shared_memory.part; | ||
412 | 397 | shm_zone = part->elts; | ||
413 | 398 | |||
414 | 399 | for (i = 0; /* void */ ; i++) { | ||
415 | 400 | |||
416 | 401 | if (i >= part->nelts) { | ||
417 | 402 | if (part->next == NULL) { | ||
418 | 403 | break; | ||
419 | 404 | } | ||
420 | 405 | part = part->next; | ||
421 | 406 | shm_zone = part->elts; | ||
422 | 407 | i = 0; | ||
423 | 408 | } | ||
424 | 409 | |||
425 | 410 | if (shm_zone[i].shm.size == 0) { | ||
426 | 411 | ngx_log_error(NGX_LOG_EMERG, log, 0, | ||
427 | 412 | "zero size shared memory zone \"%V\"", | ||
428 | 413 | &shm_zone[i].shm.name); | ||
429 | 414 | goto failed; | ||
430 | 415 | } | ||
431 | 416 | |||
432 | 417 | if (shm_zone[i].init == NULL) { | ||
433 | 418 | /* unused shared zone */ | ||
434 | 419 | continue; | ||
435 | 420 | } | ||
436 | 421 | |||
437 | 422 | shm_zone[i].shm.log = cycle->log; | ||
438 | 423 | |||
439 | 424 | opart = &old_cycle->shared_memory.part; | ||
440 | 425 | oshm_zone = opart->elts; | ||
441 | 426 | |||
442 | 427 | for (n = 0; /* void */ ; n++) { | ||
443 | 428 | |||
444 | 429 | if (n >= opart->nelts) { | ||
445 | 430 | if (opart->next == NULL) { | ||
446 | 431 | break; | ||
447 | 432 | } | ||
448 | 433 | opart = opart->next; | ||
449 | 434 | oshm_zone = opart->elts; | ||
450 | 435 | n = 0; | ||
451 | 436 | } | ||
452 | 437 | |||
453 | 438 | if (shm_zone[i].shm.name.len != oshm_zone[n].shm.name.len) { | ||
454 | 439 | continue; | ||
455 | 440 | } | ||
456 | 441 | |||
457 | 442 | if (ngx_strncmp(shm_zone[i].shm.name.data, | ||
458 | 443 | oshm_zone[n].shm.name.data, | ||
459 | 444 | shm_zone[i].shm.name.len) | ||
460 | 445 | != 0) | ||
461 | 446 | { | ||
462 | 447 | continue; | ||
463 | 448 | } | ||
464 | 449 | |||
465 | 450 | if (shm_zone[i].shm.size == oshm_zone[n].shm.size) { | ||
466 | 451 | shm_zone[i].shm.addr = oshm_zone[n].shm.addr; | ||
467 | 452 | |||
468 | 453 | if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data) | ||
469 | 454 | != NGX_OK) | ||
470 | 455 | { | ||
471 | 456 | goto failed; | ||
472 | 457 | } | ||
473 | 458 | |||
474 | 459 | goto shm_zone_found; | ||
475 | 460 | } | ||
476 | 461 | |||
477 | 462 | ngx_shm_free(&oshm_zone[n].shm); | ||
478 | 463 | |||
479 | 464 | break; | ||
480 | 465 | } | ||
481 | 466 | |||
482 | 467 | if (ngx_shm_alloc(&shm_zone[i].shm) != NGX_OK) { | ||
483 | 468 | goto failed; | ||
484 | 469 | } | ||
485 | 470 | |||
486 | 471 | if (ngx_init_zone_pool(cycle, &shm_zone[i]) != NGX_OK) { | ||
487 | 472 | goto failed; | ||
488 | 473 | } | ||
489 | 474 | |||
490 | 475 | if (shm_zone[i].init(&shm_zone[i], NULL) != NGX_OK) { | ||
491 | 476 | goto failed; | ||
492 | 477 | } | ||
493 | 478 | |||
494 | 479 | shm_zone_found: | ||
495 | 480 | |||
496 | 481 | continue; | ||
497 | 482 | } | ||
498 | 483 | |||
499 | 484 | |||
500 | 485 | /* handle the listening sockets */ | ||
501 | 486 | |||
502 | 487 | if (old_cycle->listening.nelts) { | ||
503 | 488 | ls = old_cycle->listening.elts; | ||
504 | 489 | for (i = 0; i < old_cycle->listening.nelts; i++) { | ||
505 | 490 | ls[i].remain = 0; | ||
506 | 491 | } | ||
507 | 492 | |||
508 | 493 | nls = cycle->listening.elts; | ||
509 | 494 | for (n = 0; n < cycle->listening.nelts; n++) { | ||
510 | 495 | |||
511 | 496 | for (i = 0; i < old_cycle->listening.nelts; i++) { | ||
512 | 497 | if (ls[i].ignore) { | ||
513 | 498 | continue; | ||
514 | 499 | } | ||
515 | 500 | |||
516 | 501 | if (ngx_cmp_sockaddr(nls[n].sockaddr, ls[i].sockaddr) == NGX_OK) | ||
517 | 502 | { | ||
518 | 503 | nls[n].fd = ls[i].fd; | ||
519 | 504 | nls[n].previous = &ls[i]; | ||
520 | 505 | ls[i].remain = 1; | ||
521 | 506 | |||
522 | 507 | if (ls[n].backlog != nls[i].backlog) { | ||
523 | 508 | nls[n].listen = 1; | ||
524 | 509 | } | ||
525 | 510 | |||
526 | 511 | #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) | ||
527 | 512 | |||
528 | 513 | /* | ||
529 | 514 | * FreeBSD, except the most recent versions, | ||
530 | 515 | * could not remove accept filter | ||
531 | 516 | */ | ||
532 | 517 | nls[n].deferred_accept = ls[i].deferred_accept; | ||
533 | 518 | |||
534 | 519 | if (ls[i].accept_filter && nls[n].accept_filter) { | ||
535 | 520 | if (ngx_strcmp(ls[i].accept_filter, | ||
536 | 521 | nls[n].accept_filter) | ||
537 | 522 | != 0) | ||
538 | 523 | { | ||
539 | 524 | nls[n].delete_deferred = 1; | ||
540 | 525 | nls[n].add_deferred = 1; | ||
541 | 526 | } | ||
542 | 527 | |||
543 | 528 | } else if (ls[i].accept_filter) { | ||
544 | 529 | nls[n].delete_deferred = 1; | ||
545 | 530 | |||
546 | 531 | } else if (nls[n].accept_filter) { | ||
547 | 532 | nls[n].add_deferred = 1; | ||
548 | 533 | } | ||
549 | 534 | #endif | ||
550 | 535 | |||
551 | 536 | #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) | ||
552 | 537 | |||
553 | 538 | if (ls[n].deferred_accept && !nls[n].deferred_accept) { | ||
554 | 539 | nls[n].delete_deferred = 1; | ||
555 | 540 | |||
556 | 541 | } else if (ls[i].deferred_accept != nls[n].deferred_accept) | ||
557 | 542 | { | ||
558 | 543 | nls[n].add_deferred = 1; | ||
559 | 544 | } | ||
560 | 545 | #endif | ||
561 | 546 | break; | ||
562 | 547 | } | ||
563 | 548 | } | ||
564 | 549 | |||
565 | 550 | if (nls[n].fd == -1) { | ||
566 | 551 | nls[n].open = 1; | ||
567 | 552 | } | ||
568 | 553 | } | ||
569 | 554 | |||
570 | 555 | } else { | ||
571 | 556 | ls = cycle->listening.elts; | ||
572 | 557 | for (i = 0; i < cycle->listening.nelts; i++) { | ||
573 | 558 | ls[i].open = 1; | ||
574 | 559 | #if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER) | ||
575 | 560 | if (ls[i].accept_filter) { | ||
576 | 561 | ls[i].add_deferred = 1; | ||
577 | 562 | } | ||
578 | 563 | #endif | ||
579 | 564 | #if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT) | ||
580 | 565 | if (ls[i].deferred_accept) { | ||
581 | 566 | ls[i].add_deferred = 1; | ||
582 | 567 | } | ||
583 | 568 | #endif | ||
584 | 569 | } | ||
585 | 570 | } | ||
586 | 571 | |||
587 | 572 | if (ngx_open_listening_sockets(cycle) != NGX_OK) { | ||
588 | 573 | goto failed; | ||
589 | 574 | } | ||
590 | 575 | |||
591 | 576 | if (!ngx_test_config) { | ||
592 | 577 | ngx_configure_listening_sockets(cycle); | ||
593 | 578 | } | ||
594 | 579 | |||
595 | 580 | |||
596 | 581 | /* commit the new cycle configuration */ | ||
597 | 582 | |||
598 | 583 | if (!ngx_use_stderr && cycle->log->file->fd != ngx_stderr) { | ||
599 | 584 | |||
600 | 585 | if (ngx_set_stderr(cycle->log->file->fd) == NGX_FILE_ERROR) { | ||
601 | 586 | ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | ||
602 | 587 | ngx_set_stderr_n " failed"); | ||
603 | 588 | } | ||
604 | 589 | } | ||
605 | 590 | |||
606 | 591 | pool->log = cycle->log; | ||
607 | 592 | |||
608 | 593 | for (i = 0; ngx_modules[i]; i++) { | ||
609 | 594 | if (ngx_modules[i]->init_module) { | ||
610 | 595 | if (ngx_modules[i]->init_module(cycle) != NGX_OK) { | ||
611 | 596 | /* fatal */ | ||
612 | 597 | exit(1); | ||
613 | 598 | } | ||
614 | 599 | } | ||
615 | 600 | } | ||
616 | 601 | |||
617 | 602 | |||
618 | 603 | /* close and delete stuff that lefts from an old cycle */ | ||
619 | 604 | |||
620 | 605 | /* free the unnecessary shared memory */ | ||
621 | 606 | |||
622 | 607 | opart = &old_cycle->shared_memory.part; | ||
623 | 608 | oshm_zone = opart->elts; | ||
624 | 609 | |||
625 | 610 | for (i = 0; /* void */ ; i++) { | ||
626 | 611 | |||
627 | 612 | if (i >= opart->nelts) { | ||
628 | 613 | if (opart->next == NULL) { | ||
629 | 614 | goto old_shm_zone_done; | ||
630 | 615 | } | ||
631 | 616 | opart = opart->next; | ||
632 | 617 | oshm_zone = opart->elts; | ||
633 | 618 | i = 0; | ||
634 | 619 | } | ||
635 | 620 | |||
636 | 621 | part = &cycle->shared_memory.part; | ||
637 | 622 | shm_zone = part->elts; | ||
638 | 623 | |||
639 | 624 | for (n = 0; /* void */ ; n++) { | ||
640 | 625 | |||
641 | 626 | if (n >= part->nelts) { | ||
642 | 627 | if (part->next == NULL) { | ||
643 | 628 | break; | ||
644 | 629 | } | ||
645 | 630 | part = part->next; | ||
646 | 631 | shm_zone = part->elts; | ||
647 | 632 | n = 0; | ||
648 | 633 | } | ||
649 | 634 | |||
650 | 635 | if (oshm_zone[i].shm.name.len == shm_zone[n].shm.name.len | ||
651 | 636 | && ngx_strncmp(oshm_zone[i].shm.name.data, | ||
652 | 637 | shm_zone[n].shm.name.data, | ||
653 | 638 | oshm_zone[i].shm.name.len) | ||
654 | 639 | == 0) | ||
655 | 640 | { | ||
656 | 641 | goto live_shm_zone; | ||
657 | 642 | } | ||
658 | 643 | } | ||
659 | 644 | |||
660 | 645 | ngx_shm_free(&oshm_zone[i].shm); | ||
661 | 646 | |||
662 | 647 | live_shm_zone: | ||
663 | 648 | |||
664 | 649 | continue; | ||
665 | 650 | } | ||
666 | 651 | |||
667 | 652 | old_shm_zone_done: | ||
668 | 653 | |||
669 | 654 | |||
670 | 655 | /* close the unnecessary listening sockets */ | ||
671 | 656 | |||
672 | 657 | ls = old_cycle->listening.elts; | ||
673 | 658 | for (i = 0; i < old_cycle->listening.nelts; i++) { | ||
674 | 659 | |||
675 | 660 | if (ls[i].remain || ls[i].fd == -1) { | ||
676 | 661 | continue; | ||
677 | 662 | } | ||
678 | 663 | |||
679 | 664 | if (ngx_close_socket(ls[i].fd) == -1) { | ||
680 | 665 | ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | ||
681 | 666 | ngx_close_socket_n " listening socket on %V failed", | ||
682 | 667 | &ls[i].addr_text); | ||
683 | 668 | } | ||
684 | 669 | } | ||
685 | 670 | |||
686 | 671 | |||
687 | 672 | /* close the unnecessary open files */ | ||
688 | 673 | |||
689 | 674 | part = &old_cycle->open_files.part; | ||
690 | 675 | file = part->elts; | ||
691 | 676 | |||
692 | 677 | for (i = 0; /* void */ ; i++) { | ||
693 | 678 | |||
694 | 679 | if (i >= part->nelts) { | ||
695 | 680 | if (part->next == NULL) { | ||
696 | 681 | break; | ||
697 | 682 | } | ||
698 | 683 | part = part->next; | ||
699 | 684 | file = part->elts; | ||
700 | 685 | i = 0; | ||
701 | 686 | } | ||
702 | 687 | |||
703 | 688 | if (file[i].fd == NGX_INVALID_FILE || file[i].fd == ngx_stderr) { | ||
704 | 689 | continue; | ||
705 | 690 | } | ||
706 | 691 | |||
707 | 692 | if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { | ||
708 | 693 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
709 | 694 | ngx_close_file_n " \"%s\" failed", | ||
710 | 695 | file[i].name.data); | ||
711 | 696 | } | ||
712 | 697 | } | ||
713 | 698 | |||
714 | 699 | ngx_destroy_pool(conf.temp_pool); | ||
715 | 700 | |||
716 | 701 | if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { | ||
717 | 702 | |||
718 | 703 | /* | ||
719 | 704 | * perl_destruct() frees environ, if it is not the same as it was at | ||
720 | 705 | * perl_construct() time, therefore we save the previous cycle | ||
721 | 706 | * environment before ngx_conf_parse() where it will be changed. | ||
722 | 707 | */ | ||
723 | 708 | |||
724 | 709 | env = environ; | ||
725 | 710 | environ = senv; | ||
726 | 711 | |||
727 | 712 | ngx_destroy_pool(old_cycle->pool); | ||
728 | 713 | cycle->old_cycle = NULL; | ||
729 | 714 | |||
730 | 715 | environ = env; | ||
731 | 716 | |||
732 | 717 | return cycle; | ||
733 | 718 | } | ||
734 | 719 | |||
735 | 720 | |||
736 | 721 | if (ngx_temp_pool == NULL) { | ||
737 | 722 | ngx_temp_pool = ngx_create_pool(128, cycle->log); | ||
738 | 723 | if (ngx_temp_pool == NULL) { | ||
739 | 724 | ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, | ||
740 | 725 | "can not create ngx_temp_pool"); | ||
741 | 726 | exit(1); | ||
742 | 727 | } | ||
743 | 728 | |||
744 | 729 | n = 10; | ||
745 | 730 | ngx_old_cycles.elts = ngx_pcalloc(ngx_temp_pool, | ||
746 | 731 | n * sizeof(ngx_cycle_t *)); | ||
747 | 732 | if (ngx_old_cycles.elts == NULL) { | ||
748 | 733 | exit(1); | ||
749 | 734 | } | ||
750 | 735 | ngx_old_cycles.nelts = 0; | ||
751 | 736 | ngx_old_cycles.size = sizeof(ngx_cycle_t *); | ||
752 | 737 | ngx_old_cycles.nalloc = n; | ||
753 | 738 | ngx_old_cycles.pool = ngx_temp_pool; | ||
754 | 739 | |||
755 | 740 | ngx_cleaner_event.handler = ngx_clean_old_cycles; | ||
756 | 741 | ngx_cleaner_event.log = cycle->log; | ||
757 | 742 | ngx_cleaner_event.data = &dumb; | ||
758 | 743 | dumb.fd = (ngx_socket_t) -1; | ||
759 | 744 | } | ||
760 | 745 | |||
761 | 746 | ngx_temp_pool->log = cycle->log; | ||
762 | 747 | |||
763 | 748 | old = ngx_array_push(&ngx_old_cycles); | ||
764 | 749 | if (old == NULL) { | ||
765 | 750 | exit(1); | ||
766 | 751 | } | ||
767 | 752 | *old = old_cycle; | ||
768 | 753 | |||
769 | 754 | if (!ngx_cleaner_event.timer_set) { | ||
770 | 755 | ngx_add_timer(&ngx_cleaner_event, 30000); | ||
771 | 756 | ngx_cleaner_event.timer_set = 1; | ||
772 | 757 | } | ||
773 | 758 | |||
774 | 759 | return cycle; | ||
775 | 760 | |||
776 | 761 | |||
777 | 762 | failed: | ||
778 | 763 | |||
779 | 764 | if (!ngx_is_init_cycle(old_cycle)) { | ||
780 | 765 | old_ccf = (ngx_core_conf_t *) ngx_get_conf(old_cycle->conf_ctx, | ||
781 | 766 | ngx_core_module); | ||
782 | 767 | if (old_ccf->environment) { | ||
783 | 768 | environ = old_ccf->environment; | ||
784 | 769 | } | ||
785 | 770 | } | ||
786 | 771 | |||
787 | 772 | /* rollback the new cycle configuration */ | ||
788 | 773 | |||
789 | 774 | part = &cycle->open_files.part; | ||
790 | 775 | file = part->elts; | ||
791 | 776 | |||
792 | 777 | for (i = 0; /* void */ ; i++) { | ||
793 | 778 | |||
794 | 779 | if (i >= part->nelts) { | ||
795 | 780 | if (part->next == NULL) { | ||
796 | 781 | break; | ||
797 | 782 | } | ||
798 | 783 | part = part->next; | ||
799 | 784 | file = part->elts; | ||
800 | 785 | i = 0; | ||
801 | 786 | } | ||
802 | 787 | |||
803 | 788 | if (file[i].fd == NGX_INVALID_FILE || file[i].fd == ngx_stderr) { | ||
804 | 789 | continue; | ||
805 | 790 | } | ||
806 | 791 | |||
807 | 792 | if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { | ||
808 | 793 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
809 | 794 | ngx_close_file_n " \"%s\" failed", | ||
810 | 795 | file[i].name.data); | ||
811 | 796 | } | ||
812 | 797 | } | ||
813 | 798 | |||
814 | 799 | if (ngx_test_config) { | ||
815 | 800 | ngx_destroy_cycle_pools(&conf); | ||
816 | 801 | return NULL; | ||
817 | 802 | } | ||
818 | 803 | |||
819 | 804 | ls = cycle->listening.elts; | ||
820 | 805 | for (i = 0; i < cycle->listening.nelts; i++) { | ||
821 | 806 | if (ls[i].fd == -1 || !ls[i].open) { | ||
822 | 807 | continue; | ||
823 | 808 | } | ||
824 | 809 | |||
825 | 810 | if (ngx_close_socket(ls[i].fd) == -1) { | ||
826 | 811 | ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | ||
827 | 812 | ngx_close_socket_n " %V failed", | ||
828 | 813 | &ls[i].addr_text); | ||
829 | 814 | } | ||
830 | 815 | } | ||
831 | 816 | |||
832 | 817 | ngx_destroy_cycle_pools(&conf); | ||
833 | 818 | |||
834 | 819 | return NULL; | ||
835 | 820 | } | ||
836 | 821 | |||
837 | 822 | |||
838 | 823 | static void | ||
839 | 824 | ngx_destroy_cycle_pools(ngx_conf_t *conf) | ||
840 | 825 | { | ||
841 | 826 | ngx_destroy_pool(conf->temp_pool); | ||
842 | 827 | ngx_destroy_pool(conf->pool); | ||
843 | 828 | } | ||
844 | 829 | |||
845 | 830 | |||
846 | 831 | static ngx_int_t | ||
847 | 832 | ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2) | ||
848 | 833 | { | ||
849 | 834 | struct sockaddr_in *sin1, *sin2; | ||
850 | 835 | #if (NGX_HAVE_INET6) | ||
851 | 836 | struct sockaddr_in6 *sin61, *sin62; | ||
852 | 837 | #endif | ||
853 | 838 | |||
854 | 839 | if (sa1->sa_family != sa2->sa_family) { | ||
855 | 840 | return NGX_DECLINED; | ||
856 | 841 | } | ||
857 | 842 | |||
858 | 843 | switch (sa1->sa_family) { | ||
859 | 844 | |||
860 | 845 | #if (NGX_HAVE_INET6) | ||
861 | 846 | case AF_INET6: | ||
862 | 847 | sin61 = (struct sockaddr_in6 *) sa1; | ||
863 | 848 | sin62 = (struct sockaddr_in6 *) sa2; | ||
864 | 849 | |||
865 | 850 | if (sin61->sin6_port != sin61->sin6_port) { | ||
866 | 851 | return NGX_DECLINED; | ||
867 | 852 | } | ||
868 | 853 | |||
869 | 854 | if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) { | ||
870 | 855 | return NGX_DECLINED; | ||
871 | 856 | } | ||
872 | 857 | |||
873 | 858 | break; | ||
874 | 859 | #endif | ||
875 | 860 | |||
876 | 861 | default: /* AF_INET */ | ||
877 | 862 | |||
878 | 863 | sin1 = (struct sockaddr_in *) sa1; | ||
879 | 864 | sin2 = (struct sockaddr_in *) sa2; | ||
880 | 865 | |||
881 | 866 | if (sin1->sin_port != sin2->sin_port) { | ||
882 | 867 | return NGX_DECLINED; | ||
883 | 868 | } | ||
884 | 869 | |||
885 | 870 | if (sin1->sin_addr.s_addr != sin2->sin_addr.s_addr) { | ||
886 | 871 | return NGX_DECLINED; | ||
887 | 872 | } | ||
888 | 873 | |||
889 | 874 | break; | ||
890 | 875 | } | ||
891 | 876 | |||
892 | 877 | return NGX_OK; | ||
893 | 878 | } | ||
894 | 879 | |||
895 | 880 | |||
896 | 881 | static ngx_int_t | ||
897 | 882 | ngx_init_zone_pool(ngx_cycle_t *cycle, ngx_shm_zone_t *zn) | ||
898 | 883 | { | ||
899 | 884 | u_char *file; | ||
900 | 885 | ngx_slab_pool_t *sp; | ||
901 | 886 | |||
902 | 887 | sp = (ngx_slab_pool_t *) zn->shm.addr; | ||
903 | 888 | |||
904 | 889 | if (zn->shm.exists) { | ||
905 | 890 | |||
906 | 891 | if (sp == sp->addr) { | ||
907 | 892 | return NGX_OK; | ||
908 | 893 | } | ||
909 | 894 | |||
910 | 895 | ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, | ||
911 | 896 | "shared zone \"%V\" has no equal addresses: %p vs %p", | ||
912 | 897 | &zn->shm.name, sp->addr, sp); | ||
913 | 898 | return NGX_ERROR; | ||
914 | 899 | } | ||
915 | 900 | |||
916 | 901 | sp->end = zn->shm.addr + zn->shm.size; | ||
917 | 902 | sp->min_shift = 3; | ||
918 | 903 | sp->addr = zn->shm.addr; | ||
919 | 904 | |||
920 | 905 | #if (NGX_HAVE_ATOMIC_OPS) | ||
921 | 906 | |||
922 | 907 | file = NULL; | ||
923 | 908 | |||
924 | 909 | #else | ||
925 | 910 | |||
926 | 911 | file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len); | ||
927 | 912 | if (file == NULL) { | ||
928 | 913 | return NGX_ERROR; | ||
929 | 914 | } | ||
930 | 915 | |||
931 | 916 | (void) ngx_sprintf(file, "%V%V%Z", &cycle->lock_file, &zn->shm.name); | ||
932 | 917 | |||
933 | 918 | #endif | ||
934 | 919 | |||
935 | 920 | if (ngx_shmtx_create(&sp->mutex, (void *) &sp->lock, file) != NGX_OK) { | ||
936 | 921 | return NGX_ERROR; | ||
937 | 922 | } | ||
938 | 923 | |||
939 | 924 | ngx_slab_init(sp); | ||
940 | 925 | |||
941 | 926 | return NGX_OK; | ||
942 | 927 | } | ||
943 | 928 | |||
944 | 929 | |||
945 | 930 | ngx_int_t | ||
946 | 931 | ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log) | ||
947 | 932 | { | ||
948 | 933 | size_t len; | ||
949 | 934 | ngx_uint_t create; | ||
950 | 935 | ngx_file_t file; | ||
951 | 936 | u_char pid[NGX_INT64_LEN + 2]; | ||
952 | 937 | |||
953 | 938 | if (ngx_process > NGX_PROCESS_MASTER) { | ||
954 | 939 | return NGX_OK; | ||
955 | 940 | } | ||
956 | 941 | |||
957 | 942 | ngx_memzero(&file, sizeof(ngx_file_t)); | ||
958 | 943 | |||
959 | 944 | file.name = *name; | ||
960 | 945 | file.log = log; | ||
961 | 946 | |||
962 | 947 | create = ngx_test_config ? NGX_FILE_CREATE_OR_OPEN : NGX_FILE_TRUNCATE; | ||
963 | 948 | |||
964 | 949 | file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR, | ||
965 | 950 | create, NGX_FILE_DEFAULT_ACCESS); | ||
966 | 951 | |||
967 | 952 | if (file.fd == NGX_INVALID_FILE) { | ||
968 | 953 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
969 | 954 | ngx_open_file_n " \"%s\" failed", file.name.data); | ||
970 | 955 | return NGX_ERROR; | ||
971 | 956 | } | ||
972 | 957 | |||
973 | 958 | if (!ngx_test_config) { | ||
974 | 959 | len = ngx_snprintf(pid, NGX_INT64_LEN + 2, "%P%N", ngx_pid) - pid; | ||
975 | 960 | |||
976 | 961 | if (ngx_write_file(&file, pid, len, 0) == NGX_ERROR) { | ||
977 | 962 | return NGX_ERROR; | ||
978 | 963 | } | ||
979 | 964 | } | ||
980 | 965 | |||
981 | 966 | if (ngx_close_file(file.fd) == NGX_FILE_ERROR) { | ||
982 | 967 | ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | ||
983 | 968 | ngx_close_file_n " \"%s\" failed", file.name.data); | ||
984 | 969 | } | ||
985 | 970 | |||
986 | 971 | return NGX_OK; | ||
987 | 972 | } | ||
988 | 973 | |||
989 | 974 | |||
990 | 975 | void | ||
991 | 976 | ngx_delete_pidfile(ngx_cycle_t *cycle) | ||
992 | 977 | { | ||
993 | 978 | u_char *name; | ||
994 | 979 | ngx_core_conf_t *ccf; | ||
995 | 980 | |||
996 | 981 | ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); | ||
997 | 982 | |||
998 | 983 | name = ngx_new_binary ? ccf->oldpid.data : ccf->pid.data; | ||
999 | 984 | |||
1000 | 985 | if (ngx_delete_file(name) == NGX_FILE_ERROR) { | ||
1001 | 986 | ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | ||
1002 | 987 | ngx_delete_file_n " \"%s\" failed", name); | ||
1003 | 988 | } | ||
1004 | 989 | } | ||
1005 | 990 | |||
1006 | 991 | |||
1007 | 992 | ngx_int_t | ||
1008 | 993 | ngx_signal_process(ngx_cycle_t *cycle, char *sig) | ||
1009 | 994 | { | ||
1010 | 995 | ssize_t n; | ||
1011 | 996 | ngx_int_t pid; | ||
1012 | 997 | ngx_file_t file; | ||
1013 | 998 | ngx_core_conf_t *ccf; | ||
1014 | 999 | u_char buf[NGX_INT64_LEN + 2]; | ||
1015 | 1000 | |||
1016 | 1001 | ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "signal process started"); | ||
1017 | 1002 | |||
1018 | 1003 | ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); | ||
1019 | 1004 | |||
1020 | 1005 | file.name = ccf->pid; | ||
1021 | 1006 | file.log = cycle->log; | ||
1022 | 1007 | |||
1023 | 1008 | file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, | ||
1024 | 1009 | NGX_FILE_OPEN, NGX_FILE_DEFAULT_ACCESS); | ||
1025 | 1010 | |||
1026 | 1011 | if (file.fd == NGX_INVALID_FILE) { | ||
1027 | 1012 | ngx_log_error(NGX_LOG_ERR, cycle->log, ngx_errno, | ||
1028 | 1013 | ngx_open_file_n " \"%s\" failed", file.name.data); | ||
1029 | 1014 | return 1; | ||
1030 | 1015 | } | ||
1031 | 1016 | |||
1032 | 1017 | n = ngx_read_file(&file, buf, NGX_INT64_LEN + 2, 0); | ||
1033 | 1018 | |||
1034 | 1019 | if (ngx_close_file(file.fd) == NGX_FILE_ERROR) { | ||
1035 | 1020 | ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | ||
1036 | 1021 | ngx_close_file_n " \"%s\" failed", file.name.data); | ||
1037 | 1022 | } | ||
1038 | 1023 | |||
1039 | 1024 | if (n == NGX_ERROR) { | ||
1040 | 1025 | return 1; | ||
1041 | 1026 | } | ||
1042 | 1027 | |||
1043 | 1028 | while (n-- && (buf[n] == CR || buf[n] == LF)) { /* void */ } | ||
1044 | 1029 | |||
1045 | 1030 | pid = ngx_atoi(buf, ++n); | ||
1046 | 1031 | |||
1047 | 1032 | if (pid == NGX_ERROR) { | ||
1048 | 1033 | ngx_log_error(NGX_LOG_ERR, cycle->log, 0, | ||
1049 | 1034 | "invalid PID number \"%*s\" in \"%s\"", | ||
1050 | 1035 | n, buf, file.name.data); | ||
1051 | 1036 | return 1; | ||
1052 | 1037 | } | ||
1053 | 1038 | |||
1054 | 1039 | return ngx_os_signal_process(cycle, sig, pid); | ||
1055 | 1040 | |||
1056 | 1041 | } | ||
1057 | 1042 | |||
1058 | 1043 | |||
1059 | 1044 | static ngx_int_t | ||
1060 | 1045 | ngx_test_lockfile(u_char *file, ngx_log_t *log) | ||
1061 | 1046 | { | ||
1062 | 1047 | #if !(NGX_HAVE_ATOMIC_OPS) | ||
1063 | 1048 | ngx_fd_t fd; | ||
1064 | 1049 | |||
1065 | 1050 | fd = ngx_open_file(file, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN, | ||
1066 | 1051 | NGX_FILE_DEFAULT_ACCESS); | ||
1067 | 1052 | |||
1068 | 1053 | if (fd == NGX_INVALID_FILE) { | ||
1069 | 1054 | ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | ||
1070 | 1055 | ngx_open_file_n " \"%s\" failed", file); | ||
1071 | 1056 | return NGX_ERROR; | ||
1072 | 1057 | } | ||
1073 | 1058 | |||
1074 | 1059 | if (ngx_close_file(fd) == NGX_FILE_ERROR) { | ||
1075 | 1060 | ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | ||
1076 | 1061 | ngx_close_file_n " \"%s\" failed", file); | ||
1077 | 1062 | } | ||
1078 | 1063 | |||
1079 | 1064 | if (ngx_delete_file(file) == NGX_FILE_ERROR) { | ||
1080 | 1065 | ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | ||
1081 | 1066 | ngx_delete_file_n " \"%s\" failed", file); | ||
1082 | 1067 | } | ||
1083 | 1068 | |||
1084 | 1069 | #endif | ||
1085 | 1070 | |||
1086 | 1071 | return NGX_OK; | ||
1087 | 1072 | } | ||
1088 | 1073 | |||
1089 | 1074 | |||
1090 | 1075 | void | ||
1091 | 1076 | ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user) | ||
1092 | 1077 | { | ||
1093 | 1078 | ssize_t n, len; | ||
1094 | 1079 | ngx_fd_t fd; | ||
1095 | 1080 | ngx_uint_t i; | ||
1096 | 1081 | ngx_list_part_t *part; | ||
1097 | 1082 | ngx_open_file_t *file; | ||
1098 | 1083 | |||
1099 | 1084 | part = &cycle->open_files.part; | ||
1100 | 1085 | file = part->elts; | ||
1101 | 1086 | |||
1102 | 1087 | for (i = 0; /* void */ ; i++) { | ||
1103 | 1088 | |||
1104 | 1089 | if (i >= part->nelts) { | ||
1105 | 1090 | if (part->next == NULL) { | ||
1106 | 1091 | break; | ||
1107 | 1092 | } | ||
1108 | 1093 | part = part->next; | ||
1109 | 1094 | file = part->elts; | ||
1110 | 1095 | i = 0; | ||
1111 | 1096 | } | ||
1112 | 1097 | |||
1113 | 1098 | if (file[i].name.len == 0) { | ||
1114 | 1099 | continue; | ||
1115 | 1100 | } | ||
1116 | 1101 | |||
1117 | 1102 | len = file[i].pos - file[i].buffer; | ||
1118 | 1103 | |||
1119 | 1104 | if (file[i].buffer && len != 0) { | ||
1120 | 1105 | |||
1121 | 1106 | n = ngx_write_fd(file[i].fd, file[i].buffer, len); | ||
1122 | 1107 | |||
1123 | 1108 | if (n == NGX_FILE_ERROR) { | ||
1124 | 1109 | ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, | ||
1125 | 1110 | ngx_write_fd_n " to \"%s\" failed", | ||
1126 | 1111 | file[i].name.data); | ||
1127 | 1112 | |||
1128 | 1113 | } else if (n != len) { | ||
1129 | 1114 | ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | ||
1130 | 1115 | ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz", | ||
1131 | 1116 | file[i].name.data, n, len); | ||
1132 | 1117 | } | ||
1133 | 1118 | |||
1134 | 1119 | file[i].pos = file[i].buffer; | ||
1135 | 1120 | } | ||
1136 | 1121 | |||
1137 | 1122 | fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND, | ||
1138 | 1123 | NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); | ||
1139 | 1124 | |||
1140 | 1125 | ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | ||
1141 | 1126 | "reopen file \"%s\", old:%d new:%d", | ||
1142 | 1127 | file[i].name.data, file[i].fd, fd); | ||
1143 | 1128 | |||
1144 | 1129 | if (fd == NGX_INVALID_FILE) { | ||
1145 | 1130 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1146 | 1131 | ngx_open_file_n " \"%s\" failed", file[i].name.data); | ||
1147 | 1132 | continue; | ||
1148 | 1133 | } | ||
1149 | 1134 | |||
1150 | 1135 | #if !(NGX_WIN32) | ||
1151 | 1136 | if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) { | ||
1152 | 1137 | ngx_file_info_t fi; | ||
1153 | 1138 | |||
1154 | 1139 | if (ngx_file_info((const char *) file[i].name.data, &fi) | ||
1155 | 1140 | == NGX_FILE_ERROR) | ||
1156 | 1141 | { | ||
1157 | 1142 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1158 | 1143 | ngx_file_info_n " \"%s\" failed", | ||
1159 | 1144 | file[i].name.data); | ||
1160 | 1145 | |||
1161 | 1146 | if (ngx_close_file(fd) == NGX_FILE_ERROR) { | ||
1162 | 1147 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1163 | 1148 | ngx_close_file_n " \"%s\" failed", | ||
1164 | 1149 | file[i].name.data); | ||
1165 | 1150 | } | ||
1166 | 1151 | } | ||
1167 | 1152 | |||
1168 | 1153 | if (fi.st_uid != user) { | ||
1169 | 1154 | if (chown((const char *) file[i].name.data, user, -1) == -1) { | ||
1170 | 1155 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1171 | 1156 | "chown(\"%s\", %d) failed", | ||
1172 | 1157 | file[i].name.data, user); | ||
1173 | 1158 | |||
1174 | 1159 | if (ngx_close_file(fd) == NGX_FILE_ERROR) { | ||
1175 | 1160 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1176 | 1161 | ngx_close_file_n " \"%s\" failed", | ||
1177 | 1162 | file[i].name.data); | ||
1178 | 1163 | } | ||
1179 | 1164 | } | ||
1180 | 1165 | } | ||
1181 | 1166 | |||
1182 | 1167 | if ((fi.st_mode & (S_IRUSR|S_IWUSR)) != (S_IRUSR|S_IWUSR)) { | ||
1183 | 1168 | |||
1184 | 1169 | fi.st_mode |= (S_IRUSR|S_IWUSR); | ||
1185 | 1170 | |||
1186 | 1171 | if (chmod((const char *) file[i].name.data, fi.st_mode) == -1) { | ||
1187 | 1172 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1188 | 1173 | "chmod() \"%s\" failed", file[i].name.data); | ||
1189 | 1174 | |||
1190 | 1175 | if (ngx_close_file(fd) == NGX_FILE_ERROR) { | ||
1191 | 1176 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1192 | 1177 | ngx_close_file_n " \"%s\" failed", | ||
1193 | 1178 | file[i].name.data); | ||
1194 | 1179 | } | ||
1195 | 1180 | } | ||
1196 | 1181 | } | ||
1197 | 1182 | } | ||
1198 | 1183 | |||
1199 | 1184 | if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { | ||
1200 | 1185 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1201 | 1186 | "fcntl(FD_CLOEXEC) \"%s\" failed", | ||
1202 | 1187 | file[i].name.data); | ||
1203 | 1188 | |||
1204 | 1189 | if (ngx_close_file(fd) == NGX_FILE_ERROR) { | ||
1205 | 1190 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1206 | 1191 | ngx_close_file_n " \"%s\" failed", | ||
1207 | 1192 | file[i].name.data); | ||
1208 | 1193 | } | ||
1209 | 1194 | |||
1210 | 1195 | continue; | ||
1211 | 1196 | } | ||
1212 | 1197 | #endif | ||
1213 | 1198 | |||
1214 | 1199 | if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { | ||
1215 | 1200 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1216 | 1201 | ngx_close_file_n " \"%s\" failed", | ||
1217 | 1202 | file[i].name.data); | ||
1218 | 1203 | } | ||
1219 | 1204 | |||
1220 | 1205 | file[i].fd = fd; | ||
1221 | 1206 | } | ||
1222 | 1207 | |||
1223 | 1208 | #if !(NGX_WIN32) | ||
1224 | 1209 | |||
1225 | 1210 | if (cycle->log->file->fd != STDERR_FILENO) { | ||
1226 | 1211 | if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) { | ||
1227 | 1212 | ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | ||
1228 | 1213 | "dup2(STDERR) failed"); | ||
1229 | 1214 | } | ||
1230 | 1215 | } | ||
1231 | 1216 | |||
1232 | 1217 | #endif | ||
1233 | 1218 | } | ||
1234 | 1219 | |||
1235 | 1220 | |||
1236 | 1221 | ngx_shm_zone_t * | ||
1237 | 1222 | ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag) | ||
1238 | 1223 | { | ||
1239 | 1224 | ngx_uint_t i; | ||
1240 | 1225 | ngx_shm_zone_t *shm_zone; | ||
1241 | 1226 | ngx_list_part_t *part; | ||
1242 | 1227 | |||
1243 | 1228 | part = &cf->cycle->shared_memory.part; | ||
1244 | 1229 | shm_zone = part->elts; | ||
1245 | 1230 | |||
1246 | 1231 | for (i = 0; /* void */ ; i++) { | ||
1247 | 1232 | |||
1248 | 1233 | if (i >= part->nelts) { | ||
1249 | 1234 | if (part->next == NULL) { | ||
1250 | 1235 | break; | ||
1251 | 1236 | } | ||
1252 | 1237 | part = part->next; | ||
1253 | 1238 | shm_zone = part->elts; | ||
1254 | 1239 | i = 0; | ||
1255 | 1240 | } | ||
1256 | 1241 | |||
1257 | 1242 | if (name->len != shm_zone[i].shm.name.len) { | ||
1258 | 1243 | continue; | ||
1259 | 1244 | } | ||
1260 | 1245 | |||
1261 | 1246 | if (ngx_strncmp(name->data, shm_zone[i].shm.name.data, name->len) | ||
1262 | 1247 | != 0) | ||
1263 | 1248 | { | ||
1264 | 1249 | continue; | ||
1265 | 1250 | } | ||
1266 | 1251 | |||
1267 | 1252 | if (size && size != shm_zone[i].shm.size) { | ||
1268 | 1253 | ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | ||
1269 | 1254 | "the size %uz of shared memory zone \"%V\" " | ||
1270 | 1255 | "conflicts with already declared size %uz", | ||
1271 | 1256 | size, &shm_zone[i].shm.name, shm_zone[i].shm.size); | ||
1272 | 1257 | return NULL; | ||
1273 | 1258 | } | ||
1274 | 1259 | |||
1275 | 1260 | if (tag != shm_zone[i].tag) { | ||
1276 | 1261 | ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | ||
1277 | 1262 | "the shared memory zone \"%V\" is " | ||
1278 | 1263 | "already declared for a different use", | ||
1279 | 1264 | &shm_zone[i].shm.name); | ||
1280 | 1265 | return NULL; | ||
1281 | 1266 | } | ||
1282 | 1267 | |||
1283 | 1268 | return &shm_zone[i]; | ||
1284 | 1269 | } | ||
1285 | 1270 | |||
1286 | 1271 | shm_zone = ngx_list_push(&cf->cycle->shared_memory); | ||
1287 | 1272 | |||
1288 | 1273 | if (shm_zone == NULL) { | ||
1289 | 1274 | return NULL; | ||
1290 | 1275 | } | ||
1291 | 1276 | |||
1292 | 1277 | shm_zone->data = NULL; | ||
1293 | 1278 | shm_zone->shm.log = cf->cycle->log; | ||
1294 | 1279 | shm_zone->shm.size = size; | ||
1295 | 1280 | shm_zone->shm.name = *name; | ||
1296 | 1281 | shm_zone->shm.exists = 0; | ||
1297 | 1282 | shm_zone->init = NULL; | ||
1298 | 1283 | shm_zone->tag = tag; | ||
1299 | 1284 | |||
1300 | 1285 | return shm_zone; | ||
1301 | 1286 | } | ||
1302 | 1287 | |||
1303 | 1288 | |||
1304 | 1289 | static void | ||
1305 | 1290 | ngx_clean_old_cycles(ngx_event_t *ev) | ||
1306 | 1291 | { | ||
1307 | 1292 | ngx_uint_t i, n, found, live; | ||
1308 | 1293 | ngx_log_t *log; | ||
1309 | 1294 | ngx_cycle_t **cycle; | ||
1310 | 1295 | |||
1311 | 1296 | log = ngx_cycle->log; | ||
1312 | 1297 | ngx_temp_pool->log = log; | ||
1313 | 1298 | |||
1314 | 1299 | ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycles"); | ||
1315 | 1300 | |||
1316 | 1301 | live = 0; | ||
1317 | 1302 | |||
1318 | 1303 | cycle = ngx_old_cycles.elts; | ||
1319 | 1304 | for (i = 0; i < ngx_old_cycles.nelts; i++) { | ||
1320 | 1305 | |||
1321 | 1306 | if (cycle[i] == NULL) { | ||
1322 | 1307 | continue; | ||
1323 | 1308 | } | ||
1324 | 1309 | |||
1325 | 1310 | found = 0; | ||
1326 | 1311 | |||
1327 | 1312 | for (n = 0; n < cycle[i]->connection_n; n++) { | ||
1328 | 1313 | if (cycle[i]->connections[n].fd != (ngx_socket_t) -1) { | ||
1329 | 1314 | found = 1; | ||
1330 | 1315 | |||
1331 | 1316 | ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%d", n); | ||
1332 | 1317 | |||
1333 | 1318 | break; | ||
1334 | 1319 | } | ||
1335 | 1320 | } | ||
1336 | 1321 | |||
1337 | 1322 | if (found) { | ||
1338 | 1323 | live = 1; | ||
1339 | 1324 | continue; | ||
1340 | 1325 | } | ||
1341 | 1326 | |||
1342 | 1327 | ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycle: %d", i); | ||
1343 | 1328 | |||
1344 | 1329 | ngx_destroy_pool(cycle[i]->pool); | ||
1345 | 1330 | cycle[i] = NULL; | ||
1346 | 1331 | } | ||
1347 | 1332 | |||
1348 | 1333 | ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "old cycles status: %d", live); | ||
1349 | 1334 | |||
1350 | 1335 | if (live) { | ||
1351 | 1336 | ngx_add_timer(ev, 30000); | ||
1352 | 1337 | |||
1353 | 1338 | } else { | ||
1354 | 1339 | ngx_destroy_pool(ngx_temp_pool); | ||
1355 | 1340 | ngx_temp_pool = NULL; | ||
1356 | 1341 | ngx_old_cycles.nelts = 0; | ||
1357 | 1342 | } | ||
1358 | 1343 | } | ||
1359 | 0 | 1344 | ||
1360 | === modified file 'CHANGES' | |||
1361 | --- CHANGES 2010-03-03 23:50:36 +0000 | |||
1362 | +++ CHANGES 2010-07-21 11:15:58 +0000 | |||
1363 | @@ -1,4 +1,125 @@ | |||
1364 | 1 | 1 | ||
1365 | 2 | Changes with nginx 0.7.67 15 Jun 2010 | ||
1366 | 3 | |||
1367 | 4 | *) Security: nginx/Windows worker might be terminated abnormally if a | ||
1368 | 5 | requested file name has invalid UTF-8 encoding. | ||
1369 | 6 | |||
1370 | 7 | |||
1371 | 8 | Changes with nginx 0.7.66 07 Jun 2010 | ||
1372 | 9 | |||
1373 | 10 | *) Security: now nginx/Windows ignores default file stream name. | ||
1374 | 11 | Thanks to Jose Antonio Vazquez Gonzalez. | ||
1375 | 12 | |||
1376 | 13 | *) Change: now the charset filter runs before the SSI filter. | ||
1377 | 14 | |||
1378 | 15 | *) Change: now no message is written in an error log if a variable is | ||
1379 | 16 | not found by $r->variable() method. | ||
1380 | 17 | |||
1381 | 18 | *) Change: now keepalive connections after POST requests are not | ||
1382 | 19 | disabled for MSIE 7.0+. | ||
1383 | 20 | Thanks to Adam Lounds. | ||
1384 | 21 | |||
1385 | 22 | *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives. | ||
1386 | 23 | |||
1387 | 24 | *) Feature: now the "rewrite" directive does a redirect automatically | ||
1388 | 25 | if the $scheme variable is used. | ||
1389 | 26 | Thanks to Piotr Sikora. | ||
1390 | 27 | |||
1391 | 28 | *) Feature: the "chunked_transfer_encoding" directive. | ||
1392 | 29 | |||
1393 | 30 | *) Feature: the $geoip_city_continent_code, $geoip_latitude, and | ||
1394 | 31 | $geoip_longitude variables. | ||
1395 | 32 | Thanks to Arvind Sundararajan. | ||
1396 | 33 | |||
1397 | 34 | *) Feature: now the ngx_http_image_filter_module deletes always EXIF | ||
1398 | 35 | and other application specific data if the data consume more than 5% | ||
1399 | 36 | of a JPEG file. | ||
1400 | 37 | |||
1401 | 38 | *) Feature: now the "msie_padding" directive works for Chrome too. | ||
1402 | 39 | |||
1403 | 40 | *) Workaround: now keepalive connections are disabled for Safari. | ||
1404 | 41 | Thanks to Joshua Sierles. | ||
1405 | 42 | |||
1406 | 43 | *) Bugfix: nginx ignored the "private" and "no-store" values in the | ||
1407 | 44 | "Cache-Control" backend response header line. | ||
1408 | 45 | |||
1409 | 46 | *) Bugfix: an "&" character was not escaped when it was copied in | ||
1410 | 47 | arguments part in a rewrite rule. | ||
1411 | 48 | |||
1412 | 49 | *) Bugfix: nginx might be terminated abnormally while a signal | ||
1413 | 50 | processing or if the directive "timer_resolution" was used on | ||
1414 | 51 | platforms which do not support kqueue or eventport notification | ||
1415 | 52 | methods. | ||
1416 | 53 | Thanks to George Xie and Maxim Dounin. | ||
1417 | 54 | |||
1418 | 55 | *) Bugfix: if temporary files and permanent storage area resided at | ||
1419 | 56 | different file systems, then permanent file modification times were | ||
1420 | 57 | incorrect. | ||
1421 | 58 | Thanks to Maxim Dounin. | ||
1422 | 59 | |||
1423 | 60 | *) Bugfix: ngx_http_memcached_module might issue the error message | ||
1424 | 61 | "memcached sent invalid trailer". | ||
1425 | 62 | Thanks to Maxim Dounin. | ||
1426 | 63 | |||
1427 | 64 | *) Bugfix: nginx could not built zlib-1.2.4 library using the library | ||
1428 | 65 | sources. | ||
1429 | 66 | Thanks to Maxim Dounin. | ||
1430 | 67 | |||
1431 | 68 | *) Bugfix: values of the $query_string, $arg_..., etc. variables cached | ||
1432 | 69 | in main request were used by the SSI module in subrequests. | ||
1433 | 70 | |||
1434 | 71 | *) Bugfix: nginx did not support HTTPS referrers. | ||
1435 | 72 | |||
1436 | 73 | *) Bugfix: nginx/Windows might not find file if path in configuration | ||
1437 | 74 | was given in other character case; the bug had appeared in 0.7.65. | ||
1438 | 75 | |||
1439 | 76 | *) Bugfix: the $date_local variable has an incorrect value, if the "%s" | ||
1440 | 77 | format was used. | ||
1441 | 78 | Thanks to Maxim Dounin. | ||
1442 | 79 | |||
1443 | 80 | *) Bugfix: nginx did not support all ciphers and digests used in client | ||
1444 | 81 | certificates. | ||
1445 | 82 | Thanks to Innocenty Enikeew. | ||
1446 | 83 | |||
1447 | 84 | *) Bugfix: if ssl_session_cache was not set or was set to "none", then | ||
1448 | 85 | during client certificate verify the error "session id context | ||
1449 | 86 | uninitialized" might occur; the bug had appeared in 0.7.1. | ||
1450 | 87 | |||
1451 | 88 | *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux. | ||
1452 | 89 | Thanks to Maxim Dounin. | ||
1453 | 90 | |||
1454 | 91 | *) Bugfix: a geo range returned default value if the range included two | ||
1455 | 92 | or more /16 networks and did not begin at /16 network boundary. | ||
1456 | 93 | |||
1457 | 94 | *) Bugfix: the $uid_got variable might not be used in the SSI and perl | ||
1458 | 95 | modules. | ||
1459 | 96 | |||
1460 | 97 | *) Bugfix: a worker process hung if a FIFO file was requested. | ||
1461 | 98 | Thanks to Vicente Aguilar and Maxim Dounin. | ||
1462 | 99 | |||
1463 | 100 | *) Bugfix: a variable value was repeatedly encoded after each an "echo" | ||
1464 | 101 | SSI-command output; the bug had appeared in 0.6.14. | ||
1465 | 102 | |||
1466 | 103 | *) Bugfix: a "stub" parameter of an "include" SSI directive was not | ||
1467 | 104 | used, if empty response has 200 status code. | ||
1468 | 105 | |||
1469 | 106 | *) Bugfix: a block used in a "stub" parameter of an "include" SSI | ||
1470 | 107 | directive was output with "text/plain" MIME type. | ||
1471 | 108 | |||
1472 | 109 | *) Bugfix: if a proxied or FastCGI request was internally redirected to | ||
1473 | 110 | another proxied or FastCGI location, then a segmentation fault might | ||
1474 | 111 | occur in a worker process; the bug had appeared in 0.7.65. | ||
1475 | 112 | Thanks to Yichun Zhang. | ||
1476 | 113 | |||
1477 | 114 | *) Bugfix: IMAP connections may hang until they timed out while talking | ||
1478 | 115 | to Zimbra server. | ||
1479 | 116 | Thanks to Alan Batie. | ||
1480 | 117 | |||
1481 | 118 | *) Bugfix: nginx did not support chunked transfer encoding for 201 | ||
1482 | 119 | responses. | ||
1483 | 120 | Thanks to Julian Reich. | ||
1484 | 121 | |||
1485 | 122 | |||
1486 | 2 | Changes with nginx 0.7.65 01 Feb 2010 | 123 | Changes with nginx 0.7.65 01 Feb 2010 |
1487 | 3 | 124 | ||
1488 | 4 | *) Security: now nginx/Windows ignores trailing spaces in URI. | 125 | *) Security: now nginx/Windows ignores trailing spaces in URI. |
1489 | 5 | 126 | ||
1490 | === modified file 'CHANGES.ru' | |||
1491 | --- CHANGES.ru 2010-03-03 23:50:36 +0000 | |||
1492 | +++ CHANGES.ru 2010-07-21 11:15:58 +0000 | |||
1493 | @@ -1,4 +1,128 @@ | |||
1494 | 1 | 1 | ||
1495 | 2 | éÚÍÅÎÅÎÉÑ × nginx 0.7.67 15.06.2010 | ||
1496 | 3 | |||
1497 | 4 | *) âÅÚÏÐÁÓÎÏÓÔØ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ nginx/Windows ÍÏÇ ÚÁ×ÅÒÛÁÔØÓÑ Á×ÁÒÉÊÎÏ | ||
1498 | 5 | ÐÒÉ ÚÁÐÒÏÓÅ ÆÁÊÌÁ Ó ÎÅ×ÅÒÎÏÊ ËÏÄÉÒÏ×ËÏÊ UTF-8. | ||
1499 | 6 | |||
1500 | 7 | |||
1501 | 8 | éÚÍÅÎÅÎÉÑ × nginx 0.7.66 07.06.2010 | ||
1502 | 9 | |||
1503 | 10 | *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÉÍÑ ÐÏÔÏËÁ ÆÁÊÌÁ ÐÏ | ||
1504 | 11 | ÕÍÏÌÞÁÎÉÀ. | ||
1505 | 12 | óÐÁÓÉÂÏ Jose Antonio Vazquez Gonzalez. | ||
1506 | 13 | |||
1507 | 14 | *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ charset-ÆÉÌØÔÒ ÒÁÂÏÔÁÅÔ ÄÏ SSI-ÆÉÌØÔÒÁ. | ||
1508 | 15 | |||
1509 | 16 | *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ × ÌÏÇ ÏÛÉÂÏË ÎÅ ÐÉÛÅÔÓÑ ÓÏÏÂÝÅÎÉÅ, ÅÓÌÉ ÐÅÒÅÍÅÎÎÁÑ | ||
1510 | 17 | ÎÅ ÎÁÊÄÅÎÁ Ó ÐÏÍÏÝØÀ ÍÅÔÏÄÁ $r->variable(). | ||
1511 | 18 | |||
1512 | 19 | *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ keepalive ÓÏÅÄÉÎÅÎÉÑ ÐÏÓÌÅ ÚÁÐÒÏÓÏ× POST ÎÅ | ||
1513 | 20 | ÚÁÐÒÅÝÁÀÔÓÑ ÄÌÑ MSIE 7.0+. | ||
1514 | 21 | óÐÁÓÉÂÏ Adam Lounds. | ||
1515 | 22 | |||
1516 | 23 | *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù proxy_no_cache É fastcgi_no_cache. | ||
1517 | 24 | |||
1518 | 25 | *) äÏÂÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÐÅÒÅÍÅÎÎÏÊ $scheme × ÄÉÒÅËÔÉ×Å | ||
1519 | 26 | rewrite Á×ÔÏÍÁÔÉÞÅÓËÉ ÄÅÌÁÅÔÓÑ ÒÅÄÉÒÅËÔ. | ||
1520 | 27 | óÐÁÓÉÂÏ Piotr Sikora. | ||
1521 | 28 | |||
1522 | 29 | *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á chunked_transfer_encoding. | ||
1523 | 30 | |||
1524 | 31 | *) äÏÂÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÙÅ $geoip_city_continent_code, $geoip_latitude É | ||
1525 | 32 | $geoip_longitude. | ||
1526 | 33 | óÐÁÓÉÂÏ Arvind Sundararajan. | ||
1527 | 34 | |||
1528 | 35 | *) äÏÂÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ ngx_http_image_filter_module ÔÅÐÅÒØ ×ÓÅÇÄÁ | ||
1529 | 36 | ÕÄÁÌÑÅÔ EXIF É ÄÒÕÇÉÅ ÄÁÎÎÙÅ, ÅÓÌÉ ÏÎÉ ÚÁÎÉÍÁÀÔ ÂÏÌØÛÅ 5% × | ||
1530 | 37 | JPEG-ÆÁÊÌÅ. | ||
1531 | 38 | |||
1532 | 39 | *) äÏÂÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÄÉÒÅËÔÉ×Á msie_padding ÒÁÂÏÔÁÅÔ É ÄÌÑ Chrome. | ||
1533 | 40 | |||
1534 | 41 | *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ keepalive ÓÏÅÄÉÎÅÎÉÑ ÚÁÐÒÅÝÅÎÙ ÄÌÑ Safari. | ||
1535 | 42 | óÐÁÓÉÂÏ Joshua Sierles. | ||
1536 | 43 | |||
1537 | 44 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÉÇÎÏÒÉÒÏ×ÁÌ ÚÎÁÞÅÎÉÑ "private" É "no-store" × | ||
1538 | 45 | ÓÔÒÏËÅ "Cache-Control" × ÚÁÇÏÌÏ×ËÅ ÏÔ×ÅÔÁ ÂÜËÅÎÄÁ. | ||
1539 | 46 | |||
1540 | 47 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÉÍ×ÏÌ "&" ÐÒÉ ËÏÐÉÒÏ×ÁÎÉÉ × ÁÒÇÕÍÅÎÔÙ × ÐÒÁ×ÉÌÁÈ | ||
1541 | 48 | rewrite ÎÅ ÜËÒÁÎÉÒÏ×ÁÌÓÑ. | ||
1542 | 49 | |||
1543 | 50 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÍÏÇ ÚÁ×ÅÒÛÁÔØÓÑ Á×ÁÒÉÊÎÏ ×Ï ×ÒÅÍÑ ÏÂÒÁÂÏÔËÉ | ||
1544 | 51 | ÓÉÇÎÁÌÁ ÉÌÉ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÄÉÒÅËÔÉ×Ù timer_resolution ÎÁ | ||
1545 | 52 | ÐÌÁÔÆÏÒÍÁÈ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÍÅÔÏÄÙ kqueue ÉÌÉ eventport. | ||
1546 | 53 | óÐÁÓÉÂÏ George Xie É íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1547 | 54 | |||
1548 | 55 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ×ÒÅÍÅÎÎÙÅ ÆÁÊÌÙ É ÐÏÓÔÏÑÎÎÏÅ ÍÅÓÔÏ ÈÒÁÎÅÎÉÑ | ||
1549 | 56 | ÒÁÓÐÏÌÁÇÁÌÉÓØ ÎÁ ÒÁÚÎÙÈ ÆÁÊÌÏ×ÙÈ ÓÉÓÔÅÍÁÈ, ÔÏ Õ ÐÏÓÔÏÑÎÎÙÈ ÆÁÊÌÏ× | ||
1550 | 57 | ×ÒÅÍÑ ÉÚÍÅÎÅÎÉÑ ÂÙÌÏ ÎÅ×ÅÒÎÙÍ. | ||
1551 | 58 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1552 | 59 | |||
1553 | 60 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ ngx_http_memcached_module ÍÏÇ ×ÙÄÁ×ÁÔØ ÏÛÉÂËÕ | ||
1554 | 61 | "memcached sent invalid trailer". | ||
1555 | 62 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1556 | 63 | |||
1557 | 64 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÍÏÇ ÓÏÂÒÁÔØ ÂÉÂÌÉÏÔÅËÕ zlib-1.2.4 ÉÚ ÉÓÈÏÄÎÙÈ | ||
1558 | 65 | ÔÅËÓÔÏ×. | ||
1559 | 66 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1560 | 67 | |||
1561 | 68 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ SSI × ÐÏÄÚÁÐÒÏÓÁÈ ÉÓÐÏÌØÚÏ×ÁÌ ÚÁËÜÛÉÒÏ×ÁÎÎÙÅ × | ||
1562 | 69 | ÏÓÎÏ×ÎÏÍ ÚÁÐÒÏÓÅ ÚÎÁÞÅÎÉÑ ÐÅÒÅÍÅÎÎÙÈ $query_string, $arg_... É ÉÍ | ||
1563 | 70 | ÐÏÄÏÂÎÙÈ. | ||
1564 | 71 | |||
1565 | 72 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ HTTPS-ÒÅÆÅÒÅÒÙ. | ||
1566 | 73 | |||
1567 | 74 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx/Windows ÍÏÇ ÎÅ ÎÁÈÏÄÉÔØ ÆÁÊÌÙ, ÅÓÌÉ ÐÕÔØ × | ||
1568 | 75 | ËÏÎÆÉÇÕÒÁÃÉÉ ÂÙÌ ÚÁÄÁÎ × ÄÒÕÇÏÍ ÒÅÇÉÓÔÒÅ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.65. | ||
1569 | 76 | |||
1570 | 77 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÁÑ $date_local ×ÙÄÁ×ÁÌÁ ÎÅ×ÅÒÎÏÅ ×ÒÅÍÑ, ÅÓÌÉ | ||
1571 | 78 | ÉÓÐÏÌØÚÏ×ÁÌÓÑ ÆÏÒÍÁÔ "%s". | ||
1572 | 79 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1573 | 80 | |||
1574 | 81 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ ×ÓÅ ÛÉÆÒÙ, ÉÓÐÏÌØÚÕÅÍÙÅ × | ||
1575 | 82 | ËÌÉÅÎÔÓËÉÈ ÓÅÒÔÉÆÉËÁÔÁÈ. | ||
1576 | 83 | óÐÁÓÉÂÏ éÎÎÏËÅÎÔÉÀ åÎÉËÅÅ×Õ. | ||
1577 | 84 | |||
1578 | 85 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ssl_session_cache ÎÅ ÂÙÌ ÕÓÔÁÎÏ×ÌÅÎ ÉÌÉ ÕÓÔÁÎÏ×ÌÅÎ | ||
1579 | 86 | × none, ÔÏ ÐÒÉ ÐÒÏ×ÅÒËÅ ËÌÉÅÎÔÓËÏÇÏ ÓÅÒÔÉÆÉËÁÔÙ ÍÏÇÌÁ ÐÒÏÉÓÈÏÄÉÔØ | ||
1580 | 87 | ÏÛÉÂËÁ "session id context uninitialized"; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.1. | ||
1581 | 88 | |||
1582 | 89 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÏ×ÍÅÓÔÉÍÏÓÔØ Ó OpenSSL-1.0.0 ÎÁ 64-ÂÉÔÎÏÍ Linux. | ||
1583 | 90 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1584 | 91 | |||
1585 | 92 | *) éÓÐÒÁ×ÌÅÎÉÅ: geo-ÄÉÁÐÁÚÏÎ ×ÏÚ×ÒÁÝÁÌ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ, ÅÓÌÉ | ||
1586 | 93 | ÄÉÁÐÁÚÏÎ ×ËÌÀÞÁÌ × ÓÅÂÑ ÏÄÎÕ É ÂÏÌÅÅ ÓÅÔÅÊ ÒÁÚÍÅÒÏÍ /16 É ÎÅ | ||
1587 | 94 | ÎÁÞÉÎÁÌÓÑ ÎÁ ÇÒÁÎÉÃÅ ÓÅÔÉ ÒÁÚÍÅÒÏÍ /16. | ||
1588 | 95 | |||
1589 | 96 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÕÀ $uid_got ÎÅÌØÚÑ ÂÙÌÏ ÉÓÐÏÌØÚÏ×ÁÔØ × SSI É | ||
1590 | 97 | ÐÅÒÌÏ×ÏÍ ÍÏÄÕÌÑÈ. | ||
1591 | 98 | |||
1592 | 99 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÚÁ×ÉÓÁÌ ÐÒÉ ÚÁÐÒÏÓÅ ÆÁÊÌÁ FIFO. | ||
1593 | 100 | óÐÁÓÉÂÏ Vicente Aguilar É íÁËÓÉÍÕ äÕÎÉÎÕ. | ||
1594 | 101 | |||
1595 | 102 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÚÎÁÞÅÎÉÅ ÐÅÒÅÍÅÎÎÏÊ ÐÏ×ÔÏÒÎÏ ÜËÒÁÎÉÒÏ×ÁÌÏÓØ ÐÏÓÌÅ | ||
1596 | 103 | ËÁÖÄÏÇÏ ×Ù×ÏÄÁ SSI-ËÏÍÁÎÄÙ echo; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.6.14. | ||
1597 | 104 | |||
1598 | 105 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÁÒÁÍÅÔÒ stub × SSI-ÄÉÒÅËÔÉ×Å include ÎÅ ÉÓÐÏÌØÚÏ×ÁÌÓÑ, | ||
1599 | 106 | ÅÓÌÉ ÐÕÓÔÏÊ ÏÔ×ÅÔ ÉÍÅÌ ËÏÄ 200. | ||
1600 | 107 | |||
1601 | 108 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÂÌÏË, ÉÓÐÏÌØÚÕÅÍÙÊ × ÐÁÒÁÍÅÔÒÅ stub × SSI-ÄÉÒÅËÔÉ×Å | ||
1602 | 109 | include, ×Ù×ÏÄÉÌÓÑ Ó MIME-ÔÉÐÏÍ "text/plain". | ||
1603 | 110 | |||
1604 | 111 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ÐÒÏËÓÉÒÏ×ÁÎÎÙÊ ÉÌÉ FastCGI ÚÁÐÒÏÓ ×ÎÕÔÒÅÎÎÅ | ||
1605 | 112 | ÐÅÒÅÎÁÐÒÁ×ÌÑÌÓÑ × ÄÒÕÇÏÊ ÐÒÏËÓÉÒÏ×ÁÎÎÙÊ ÉÌÉ FastCGI location, ÔÏ × | ||
1606 | 113 | ÒÁÂÏÞÅÍ ÐÒÏÃÅÓÓÅ ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ | ||
1607 | 114 | × 0.7.65. | ||
1608 | 115 | óÐÁÓÉÂÏ Yichun Zhang. | ||
1609 | 116 | |||
1610 | 117 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÏÅÄÉÎÅÎÉÑ IMAP Ë ÓÅÒ×ÅÒÕ Zimbra ÍÏÇÌÏ ÚÁ×ÉÓÎÕÔØ ÄÏ | ||
1611 | 118 | ÔÁÊÍÁÕÔÁ. | ||
1612 | 119 | óÐÁÓÉÂÏ Alan Batie. | ||
1613 | 120 | |||
1614 | 121 | *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ ÐÅÒÅÄÁÞÕ chunk'ÁÍÉ ÄÌÑ 201-ÙÈ | ||
1615 | 122 | ÏÔ×ÅÔÏ×. | ||
1616 | 123 | óÐÁÓÉÂÏ Julian Reich. | ||
1617 | 124 | |||
1618 | 125 | |||
1619 | 2 | éÚÍÅÎÅÎÉÑ × nginx 0.7.65 01.02.2010 | 126 | éÚÍÅÎÅÎÉÑ × nginx 0.7.65 01.02.2010 |
1620 | 3 | 127 | ||
1621 | 4 | *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÐÒÏÂÅÌÙ × ËÏÎÃÅ URI. | 128 | *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÐÒÏÂÅÌÙ × ËÏÎÃÅ URI. |
1622 | @@ -178,7 +302,7 @@ | |||
1623 | 178 | 302 | ||
1624 | 179 | *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù limit_req_log_level É limit_conn_log_level. | 303 | *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù limit_req_log_level É limit_conn_log_level. |
1625 | 180 | 304 | ||
1627 | 181 | *) éÓÐÒÁ×ÌÅÎÉÅ: ôÅÐÅÒØ ÄÉÒÅËÔÉ×Á limit_req ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÁÌÇÏÒÉÔÍÕ | 305 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÄÉÒÅËÔÉ×Á limit_req ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÁÌÇÏÒÉÔÍÕ |
1628 | 182 | leaky bucket. | 306 | leaky bucket. |
1629 | 183 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | 307 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. |
1630 | 184 | 308 | ||
1631 | @@ -1648,7 +1772,7 @@ | |||
1632 | 1648 | óÐÁÓÉÂÏ áÎÄÒÅÀ îÉÇÍÁÔÕÌÉÎÕ. | 1772 | óÐÁÓÉÂÏ áÎÄÒÅÀ îÉÇÍÁÔÕÌÉÎÕ. |
1633 | 1649 | 1773 | ||
1634 | 1650 | *) éÓÐÒÁ×ÌÅÎÉÅ: ngx_http_memcached_module ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÌ | 1774 | *) éÓÐÒÁ×ÌÅÎÉÅ: ngx_http_memcached_module ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÌ |
1636 | 1651 | upstream_response_time. | 1775 | $upstream_response_time. |
1637 | 1652 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. | 1776 | óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ. |
1638 | 1653 | 1777 | ||
1639 | 1654 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÍÏÇ ÚÁÃÉËÌÉÔØÓÑ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ | 1778 | *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÍÏÇ ÚÁÃÉËÌÉÔØÓÑ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ |
1640 | 1655 | 1779 | ||
1641 | === modified file 'auto/cc/conf' | |||
1642 | --- auto/cc/conf 2007-02-19 10:30:07 +0000 | |||
1643 | +++ auto/cc/conf 2010-07-21 11:15:58 +0000 | |||
1644 | @@ -104,6 +104,7 @@ | |||
1645 | 104 | fi | 104 | fi |
1646 | 105 | 105 | ||
1647 | 106 | CFLAGS="$CFLAGS $NGX_CC_OPT" | 106 | CFLAGS="$CFLAGS $NGX_CC_OPT" |
1648 | 107 | NGX_TEST_LD_OPT="$NGX_LD_OPT" | ||
1649 | 107 | 108 | ||
1650 | 108 | 109 | ||
1651 | 109 | if [ "$NGX_PLATFORM" != win32 ]; then | 110 | if [ "$NGX_PLATFORM" != win32 ]; then |
1652 | 110 | 111 | ||
1653 | === modified file 'auto/cc/gcc' | |||
1654 | --- auto/cc/gcc 2009-10-19 23:22:06 +0000 | |||
1655 | +++ auto/cc/gcc 2010-07-21 11:15:58 +0000 | |||
1656 | @@ -51,8 +51,6 @@ | |||
1657 | 51 | #NGX_GCC_OPT="-Os" | 51 | #NGX_GCC_OPT="-Os" |
1658 | 52 | NGX_GCC_OPT="-O" | 52 | NGX_GCC_OPT="-O" |
1659 | 53 | 53 | ||
1660 | 54 | CFLAGS="$CFLAGS $NGX_GCC_OPT" | ||
1661 | 55 | |||
1662 | 56 | #CFLAGS="$CFLAGS -fomit-frame-pointer" | 54 | #CFLAGS="$CFLAGS -fomit-frame-pointer" |
1663 | 57 | 55 | ||
1664 | 58 | case $CPU in | 56 | case $CPU in |
1665 | 59 | 57 | ||
1666 | === modified file 'auto/feature' | |||
1667 | --- auto/feature 2008-09-02 20:48:58 +0000 | |||
1668 | +++ auto/feature 2010-07-21 11:15:58 +0000 | |||
1669 | @@ -39,7 +39,7 @@ | |||
1670 | 39 | 39 | ||
1671 | 40 | 40 | ||
1672 | 41 | ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ | 41 | ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ |
1674 | 42 | -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" | 42 | -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs" |
1675 | 43 | 43 | ||
1676 | 44 | ngx_feature_inc_path= | 44 | ngx_feature_inc_path= |
1677 | 45 | 45 | ||
1678 | 46 | 46 | ||
1679 | === modified file 'auto/lib/openssl/conf' | |||
1680 | --- auto/lib/openssl/conf 2010-03-03 23:50:36 +0000 | |||
1681 | +++ auto/lib/openssl/conf 2010-07-21 11:15:58 +0000 | |||
1682 | @@ -19,6 +19,8 @@ | |||
1683 | 19 | 19 | ||
1684 | 20 | # libeay32.lib requires gdi32.lib | 20 | # libeay32.lib requires gdi32.lib |
1685 | 21 | CORE_LIBS="$CORE_LIBS gdi32.lib" | 21 | CORE_LIBS="$CORE_LIBS gdi32.lib" |
1686 | 22 | # OpenSSL 1.0.0 requires crypt32.lib | ||
1687 | 23 | CORE_LIBS="$CORE_LIBS crypt32.lib" | ||
1688 | 22 | ;; | 24 | ;; |
1689 | 23 | 25 | ||
1690 | 24 | *) | 26 | *) |
1691 | 25 | 27 | ||
1692 | === modified file 'auto/lib/openssl/make' | |||
1693 | --- auto/lib/openssl/make 2010-03-03 23:50:36 +0000 | |||
1694 | +++ auto/lib/openssl/make 2010-07-21 11:15:58 +0000 | |||
1695 | @@ -57,7 +57,7 @@ | |||
1696 | 57 | && \$(MAKE) clean \\ | 57 | && \$(MAKE) clean \\ |
1697 | 58 | && ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\ | 58 | && ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\ |
1698 | 59 | && \$(MAKE) \\ | 59 | && \$(MAKE) \\ |
1700 | 60 | && \$(MAKE) install | 60 | && \$(MAKE) install LIBDIR=lib |
1701 | 61 | 61 | ||
1702 | 62 | END | 62 | END |
1703 | 63 | 63 | ||
1704 | 64 | 64 | ||
1705 | === modified file 'auto/lib/openssl/makefile.bcc' | |||
1706 | --- auto/lib/openssl/makefile.bcc 2009-10-19 23:22:06 +0000 | |||
1707 | +++ auto/lib/openssl/makefile.bcc 2010-07-21 11:15:58 +0000 | |||
1708 | @@ -5,8 +5,7 @@ | |||
1709 | 5 | all: | 5 | all: |
1710 | 6 | cd $(OPENSSL) | 6 | cd $(OPENSSL) |
1711 | 7 | 7 | ||
1714 | 8 | perl Configure BC-32 no-shared --prefix=openssl -DNO_SYS_TYPES_H \ | 8 | perl Configure BC-32 no-shared --prefix=openssl $(OPENSSL_OPT) |
1713 | 9 | $(OPENSSL_OPT) | ||
1715 | 10 | 9 | ||
1716 | 11 | ms\do_nasm | 10 | ms\do_nasm |
1717 | 12 | 11 | ||
1718 | 13 | 12 | ||
1719 | === modified file 'auto/lib/openssl/makefile.msvc' | |||
1720 | --- auto/lib/openssl/makefile.msvc 2009-10-19 23:22:06 +0000 | |||
1721 | +++ auto/lib/openssl/makefile.msvc 2010-07-21 11:15:58 +0000 | |||
1722 | @@ -5,8 +5,7 @@ | |||
1723 | 5 | all: | 5 | all: |
1724 | 6 | cd $(OPENSSL) | 6 | cd $(OPENSSL) |
1725 | 7 | 7 | ||
1728 | 8 | perl Configure VC-WIN32 no-shared --prefix=openssl -DNO_SYS_TYPES_H \ | 8 | perl Configure VC-WIN32 no-shared --prefix=openssl $(OPENSSL_OPT) |
1727 | 9 | $(OPENSSL_OPT) | ||
1729 | 10 | 9 | ||
1730 | 11 | ms\do_ms | 10 | ms\do_ms |
1731 | 12 | 11 | ||
1732 | 13 | 12 | ||
1733 | === modified file 'auto/lib/zlib/make' | |||
1734 | --- auto/lib/zlib/make 2009-10-19 23:22:06 +0000 | |||
1735 | +++ auto/lib/zlib/make 2010-07-21 11:15:58 +0000 | |||
1736 | @@ -53,7 +53,7 @@ | |||
1737 | 53 | 53 | ||
1738 | 54 | $ZLIB/libz.a: $NGX_MAKEFILE | 54 | $ZLIB/libz.a: $NGX_MAKEFILE |
1739 | 55 | cd $ZLIB \\ | 55 | cd $ZLIB \\ |
1741 | 56 | && \$(MAKE) clean \\ | 56 | && \$(MAKE) distclean \\ |
1742 | 57 | && cp contrib/asm586/match.S . \\ | 57 | && cp contrib/asm586/match.S . \\ |
1743 | 58 | && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\ | 58 | && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\ |
1744 | 59 | ./configure \\ | 59 | ./configure \\ |
1745 | @@ -70,7 +70,7 @@ | |||
1746 | 70 | 70 | ||
1747 | 71 | $ZLIB/libz.a: $NGX_MAKEFILE | 71 | $ZLIB/libz.a: $NGX_MAKEFILE |
1748 | 72 | cd $ZLIB \\ | 72 | cd $ZLIB \\ |
1750 | 73 | && \$(MAKE) clean \\ | 73 | && \$(MAKE) distclean \\ |
1751 | 74 | && cp contrib/asm686/match.S . \\ | 74 | && cp contrib/asm686/match.S . \\ |
1752 | 75 | && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\ | 75 | && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\ |
1753 | 76 | ./configure \\ | 76 | ./configure \\ |
1754 | @@ -103,7 +103,7 @@ | |||
1755 | 103 | 103 | ||
1756 | 104 | $ZLIB/libz.a: $NGX_MAKEFILE | 104 | $ZLIB/libz.a: $NGX_MAKEFILE |
1757 | 105 | cd $ZLIB \\ | 105 | cd $ZLIB \\ |
1759 | 106 | && \$(MAKE) clean \\ | 106 | && \$(MAKE) distclean \\ |
1760 | 107 | && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\ | 107 | && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\ |
1761 | 108 | ./configure \\ | 108 | ./configure \\ |
1762 | 109 | && \$(MAKE) libz.a | 109 | && \$(MAKE) libz.a |
1763 | 110 | 110 | ||
1764 | === modified file 'auto/modules' | |||
1765 | --- auto/modules 2009-11-30 13:34:00 +0000 | |||
1766 | +++ auto/modules 2010-07-21 11:15:58 +0000 | |||
1767 | @@ -101,8 +101,8 @@ | |||
1768 | 101 | # ngx_http_range_header_filter | 101 | # ngx_http_range_header_filter |
1769 | 102 | # ngx_http_gzip_filter | 102 | # ngx_http_gzip_filter |
1770 | 103 | # ngx_http_postpone_filter | 103 | # ngx_http_postpone_filter |
1771 | 104 | # ngx_http_ssi_filter | ||
1772 | 104 | # ngx_http_charset_filter | 105 | # ngx_http_charset_filter |
1773 | 105 | # ngx_http_ssi_filter | ||
1774 | 106 | # ngx_http_xslt_filter | 106 | # ngx_http_xslt_filter |
1775 | 107 | # ngx_http_image_filter_filter | 107 | # ngx_http_image_filter_filter |
1776 | 108 | # ngx_http_sub_filter | 108 | # ngx_http_sub_filter |
1777 | @@ -130,19 +130,19 @@ | |||
1778 | 130 | HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS" | 130 | HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS" |
1779 | 131 | fi | 131 | fi |
1780 | 132 | 132 | ||
1781 | 133 | if [ $HTTP_SSI = YES ]; then | ||
1782 | 134 | have=NGX_HTTP_SSI . auto/have | ||
1783 | 135 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE" | ||
1784 | 136 | HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS" | ||
1785 | 137 | HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS" | ||
1786 | 138 | fi | ||
1787 | 139 | |||
1788 | 133 | if [ $HTTP_CHARSET = YES ]; then | 140 | if [ $HTTP_CHARSET = YES ]; then |
1789 | 134 | have=NGX_HTTP_CHARSET . auto/have | 141 | have=NGX_HTTP_CHARSET . auto/have |
1790 | 135 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE" | 142 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE" |
1791 | 136 | HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS" | 143 | HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS" |
1792 | 137 | fi | 144 | fi |
1793 | 138 | 145 | ||
1794 | 139 | if [ $HTTP_SSI = YES ]; then | ||
1795 | 140 | have=NGX_HTTP_SSI . auto/have | ||
1796 | 141 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE" | ||
1797 | 142 | HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS" | ||
1798 | 143 | HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS" | ||
1799 | 144 | fi | ||
1800 | 145 | |||
1801 | 146 | if [ $HTTP_XSLT = YES ]; then | 146 | if [ $HTTP_XSLT = YES ]; then |
1802 | 147 | USE_LIBXSLT=YES | 147 | USE_LIBXSLT=YES |
1803 | 148 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE" | 148 | HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE" |
1804 | 149 | 149 | ||
1805 | === modified file 'auto/unix' | |||
1806 | --- auto/unix 2009-10-19 23:22:06 +0000 | |||
1807 | +++ auto/unix 2010-07-21 11:15:58 +0000 | |||
1808 | @@ -133,6 +133,16 @@ | |||
1809 | 133 | . auto/feature | 133 | . auto/feature |
1810 | 134 | 134 | ||
1811 | 135 | 135 | ||
1812 | 136 | ngx_feature="sys_errlist[]" | ||
1813 | 137 | ngx_feature_name="NGX_HAVE_SYS_ERRLIST" | ||
1814 | 138 | ngx_feature_run=yes | ||
1815 | 139 | ngx_feature_incs="#include <stdio.h>" | ||
1816 | 140 | ngx_feature_path= | ||
1817 | 141 | ngx_feature_libs= | ||
1818 | 142 | ngx_feature_test="int n = sys_nerr; const char *p = sys_errlist[1];" | ||
1819 | 143 | . auto/feature | ||
1820 | 144 | |||
1821 | 145 | |||
1822 | 136 | ngx_feature="localtime_r()" | 146 | ngx_feature="localtime_r()" |
1823 | 137 | ngx_feature_name="NGX_HAVE_LOCALTIME_R" | 147 | ngx_feature_name="NGX_HAVE_LOCALTIME_R" |
1824 | 138 | ngx_feature_run=no | 148 | ngx_feature_run=no |
1825 | 139 | 149 | ||
1826 | === added file 'debian/README.Debian' | |||
1827 | --- debian/README.Debian 1970-01-01 00:00:00 +0000 | |||
1828 | +++ debian/README.Debian 2010-07-21 11:15:58 +0000 | |||
1829 | @@ -0,0 +1,9 @@ | |||
1830 | 1 | README for Debian | ||
1831 | 2 | ----------------- | ||
1832 | 3 | |||
1833 | 4 | Files under /var/www/ are not supported as per Debian Policy. | ||
1834 | 5 | Please see: http://lintian.debian.org/tags/dir-or-file-in-var-www.html and, | ||
1835 | 6 | http://www.pathname.com/fhs/pub/fhs-2.3.html#THEVARHIERARCHY for more | ||
1836 | 7 | details and explanations. | ||
1837 | 8 | |||
1838 | 9 | -- Kartik Mistry <kartik@debian.org> Fri, 05 Mar 2010 13:31:15 +0530 | ||
1839 | 0 | 10 | ||
1840 | === modified file 'debian/changelog' | |||
1841 | --- debian/changelog 2010-03-05 01:36:05 +0000 | |||
1842 | +++ debian/changelog 2010-07-21 11:15:58 +0000 | |||
1843 | @@ -1,3 +1,104 @@ | |||
1844 | 1 | nginx (0.7.67-2ubuntu1) maverick; urgency=low | ||
1845 | 2 | |||
1846 | 3 | * Merge from Debian unstable (LP: #608172) Remaining changes: | ||
1847 | 4 | + debian/rules: | ||
1848 | 5 | with-http_dav_module | ||
1849 | 6 | with-http_geoip_module | ||
1850 | 7 | with-http_gzip_static_module | ||
1851 | 8 | with-http_realip_module | ||
1852 | 9 | with-http_sub_module | ||
1853 | 10 | + .pc/applied-patches | ||
1854 | 11 | fix_reloading_ipv6.diff | ||
1855 | 12 | |||
1856 | 13 | -- Mikhail Turov <groldster@gmail.com> Wed, 21 Jul 2010 11:57:53 +0100 | ||
1857 | 14 | |||
1858 | 15 | nginx (0.7.67-2) unstable; urgency=low | ||
1859 | 16 | |||
1860 | 17 | * debian/conf/sites-available/default: | ||
1861 | 18 | + Removed reference to SSLv2 protocol (Closes: #589139) | ||
1862 | 19 | * debian/control: | ||
1863 | 20 | + Updated Standards-Version to 3.9.0 | ||
1864 | 21 | * debian/copyright: | ||
1865 | 22 | + Don't point to BSD license file, included exact upstream version of | ||
1866 | 23 | license text | ||
1867 | 24 | + Added missing copyright owner for contrib/ scripts | ||
1868 | 25 | + debian/* license is same as upstream now as discussed with co-maintainers | ||
1869 | 26 | |||
1870 | 27 | -- Kartik Mistry <kartik@debian.org> Mon, 19 Jul 2010 10:36:32 +0530 | ||
1871 | 28 | |||
1872 | 29 | nginx (0.7.67-1) unstable; urgency=low | ||
1873 | 30 | |||
1874 | 31 | * New upstream release | ||
1875 | 32 | |||
1876 | 33 | -- Kartik Mistry <kartik@debian.org> Wed, 16 Jun 2010 01:26:51 +0530 | ||
1877 | 34 | |||
1878 | 35 | nginx (0.7.65-7) unstable; urgency=low | ||
1879 | 36 | |||
1880 | 37 | [Kartik Mistry] | ||
1881 | 38 | * debian/rules: | ||
1882 | 39 | + Enabled HTTPSubModule module in configure (Closes: #584828) | ||
1883 | 40 | + Arranged configure options in better manner | ||
1884 | 41 | |||
1885 | 42 | -- Kartik Mistry <kartik@debian.org> Mon, 07 Jun 2010 14:33:24 +0530 | ||
1886 | 43 | |||
1887 | 44 | nginx (0.7.65-6) unstable; urgency=low | ||
1888 | 45 | |||
1889 | 46 | [Kartik Mistry] | ||
1890 | 47 | * debian/README.Debian: | ||
1891 | 48 | + Fixed typo and somewhat better wordings | ||
1892 | 49 | * debian/conf/mime.types: | ||
1893 | 50 | + Added entry to support 7zip files (Closes: #580423) | ||
1894 | 51 | * debian/init.d: | ||
1895 | 52 | + Do not print config testing info until an error found, Thanks to Ubuntu | ||
1896 | 53 | bug 568293 | ||
1897 | 54 | * debian/copyright: | ||
1898 | 55 | + Updated as per DEP-5 specification | ||
1899 | 56 | |||
1900 | 57 | -- Kartik Mistry <kartik@debian.org> Sat, 22 May 2010 01:41:33 +0530 | ||
1901 | 58 | |||
1902 | 59 | nginx (0.7.65-5) unstable; urgency=low | ||
1903 | 60 | |||
1904 | 61 | [Kartik Mistry] | ||
1905 | 62 | * debian/patches/fix_reloading_ipv6.diff: | ||
1906 | 63 | + Added patch to fix reloading with IPv6 addresses, Thanks to | ||
1907 | 64 | Matthias-Christian Ott <ott@mirix.org> for patch (Closes: #577456) | ||
1908 | 65 | |||
1909 | 66 | -- Kartik Mistry <kartik@debian.org> Wed, 14 Apr 2010 11:36:48 +0530 | ||
1910 | 67 | |||
1911 | 68 | nginx (0.7.65-4) unstable; urgency=low | ||
1912 | 69 | |||
1913 | 70 | [Kartik Mistry] | ||
1914 | 71 | * debian/conf/sites-available/default: | ||
1915 | 72 | + Really listen for both IPv4 and IPv6 addresses. Thanks to Nikolaus | ||
1916 | 73 | Schulz <microschulz@web.de> for notice (Closes: #574983) | ||
1917 | 74 | * debian/control, debian/rules: | ||
1918 | 75 | + Added GeoIP support, Thanks to Caetano Carezzato | ||
1919 | 76 | <caetano@vision.ime.usp.br> (Closes: #575280) | ||
1920 | 77 | * debian/conf/mime.types: | ||
1921 | 78 | + Added svg entry to mime.types, Jeremy Lal <kapouer@melix.org> | ||
1922 | 79 | (Closes: #575155) | ||
1923 | 80 | |||
1924 | 81 | -- Kartik Mistry <kartik@debian.org> Thu, 25 Mar 2010 00:21:50 +0530 | ||
1925 | 82 | |||
1926 | 83 | nginx (0.7.65-3) unstable; urgency=medium | ||
1927 | 84 | |||
1928 | 85 | [Kartik Mistry] | ||
1929 | 86 | * Urgency set to medium due to Release Goal | ||
1930 | 87 | * debian/conf/sites-available/default: | ||
1931 | 88 | + Listen for both IPv4 and IPv6 addresses by default (Closes: #574983) | ||
1932 | 89 | |||
1933 | 90 | -- Kartik Mistry <kartik@debian.org> Tue, 23 Mar 2010 10:30:18 +0530 | ||
1934 | 91 | |||
1935 | 92 | nginx (0.7.65-2) unstable; urgency=low | ||
1936 | 93 | |||
1937 | 94 | * debian/README.Debian: | ||
1938 | 95 | + Added explanation about not installing files in /var/www/ | ||
1939 | 96 | (Closes: #572513) | ||
1940 | 97 | * debian/rules: | ||
1941 | 98 | + Readded realip module support (Closes: #507419) | ||
1942 | 99 | |||
1943 | 100 | -- Kartik Mistry <kartik@debian.org> Sat, 06 Mar 2010 13:14:48 +0530 | ||
1944 | 101 | |||
1945 | 1 | nginx (0.7.65-1ubuntu2) lucid; urgency=low | 102 | nginx (0.7.65-1ubuntu2) lucid; urgency=low |
1946 | 2 | 103 | ||
1947 | 3 | * Re-enable http_realip_module (debian/rules). | 104 | * Re-enable http_realip_module (debian/rules). |
1948 | 4 | 105 | ||
1949 | === modified file 'debian/conf/mime.types' | |||
1950 | --- debian/conf/mime.types 2007-12-08 11:27:54 +0000 | |||
1951 | +++ debian/conf/mime.types 2010-07-21 11:15:58 +0000 | |||
1952 | @@ -20,6 +20,7 @@ | |||
1953 | 20 | image/x-icon ico; | 20 | image/x-icon ico; |
1954 | 21 | image/x-jng jng; | 21 | image/x-jng jng; |
1955 | 22 | image/x-ms-bmp bmp; | 22 | image/x-ms-bmp bmp; |
1956 | 23 | image/svg+xml svg svgz; | ||
1957 | 23 | 24 | ||
1958 | 24 | application/java-archive jar war ear; | 25 | application/java-archive jar war ear; |
1959 | 25 | application/mac-binhex40 hqx; | 26 | application/mac-binhex40 hqx; |
1960 | @@ -31,6 +32,7 @@ | |||
1961 | 31 | application/vnd.ms-powerpoint ppt; | 32 | application/vnd.ms-powerpoint ppt; |
1962 | 32 | application/vnd.wap.wmlc wmlc; | 33 | application/vnd.wap.wmlc wmlc; |
1963 | 33 | application/vnd.wap.xhtml+xml xhtml; | 34 | application/vnd.wap.xhtml+xml xhtml; |
1964 | 35 | application/x-7z-compressed 7z; | ||
1965 | 34 | application/x-cocoa cco; | 36 | application/x-cocoa cco; |
1966 | 35 | application/x-java-archive-diff jardiff; | 37 | application/x-java-archive-diff jardiff; |
1967 | 36 | application/x-java-jnlp-file jnlp; | 38 | application/x-java-jnlp-file jnlp; |
1968 | 37 | 39 | ||
1969 | === modified file 'debian/conf/sites-available/default' | |||
1970 | --- debian/conf/sites-available/default 2010-02-01 23:44:21 +0000 | |||
1971 | +++ debian/conf/sites-available/default 2010-07-21 11:15:58 +0000 | |||
1972 | @@ -5,13 +5,16 @@ | |||
1973 | 5 | # statements for each of your virtual hosts | 5 | # statements for each of your virtual hosts |
1974 | 6 | 6 | ||
1975 | 7 | server { | 7 | server { |
1977 | 8 | listen 80 default; | 8 | |
1978 | 9 | listen 80; ## listen for ipv4 | ||
1979 | 10 | listen [::]:80 default ipv6only=on; ## listen for ipv6 | ||
1980 | 11 | |||
1981 | 9 | server_name localhost; | 12 | server_name localhost; |
1982 | 10 | 13 | ||
1983 | 11 | access_log /var/log/nginx/localhost.access.log; | 14 | access_log /var/log/nginx/localhost.access.log; |
1984 | 12 | 15 | ||
1985 | 13 | location / { | 16 | location / { |
1987 | 14 | root /var/www/nginx-default; | 17 | root /var/www; |
1988 | 15 | index index.html index.htm; | 18 | index index.html index.htm; |
1989 | 16 | } | 19 | } |
1990 | 17 | 20 | ||
1991 | @@ -86,8 +89,8 @@ | |||
1992 | 86 | 89 | ||
1993 | 87 | #ssl_session_timeout 5m; | 90 | #ssl_session_timeout 5m; |
1994 | 88 | 91 | ||
1997 | 89 | #ssl_protocols SSLv2 SSLv3 TLSv1; | 92 | #ssl_protocols SSLv3 TLSv1; |
1998 | 90 | #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; | 93 | #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; |
1999 | 91 | #ssl_prefer_server_ciphers on; | 94 | #ssl_prefer_server_ciphers on; |
2000 | 92 | 95 | ||
2001 | 93 | #location / { | 96 | #location / { |
2002 | 94 | 97 | ||
2003 | === modified file 'debian/control' | |||
2004 | --- debian/control 2010-03-03 23:50:36 +0000 | |||
2005 | +++ debian/control 2010-07-21 11:15:58 +0000 | |||
2006 | @@ -7,10 +7,11 @@ | |||
2007 | 7 | Kartik Mistry <kartik@debian.org> | 7 | Kartik Mistry <kartik@debian.org> |
2008 | 8 | Build-Depends: debhelper (>= 7), | 8 | Build-Depends: debhelper (>= 7), |
2009 | 9 | autotools-dev, | 9 | autotools-dev, |
2010 | 10 | libgeoip-dev, | ||
2011 | 10 | libssl-dev, | 11 | libssl-dev, |
2012 | 11 | libpcre3-dev, | 12 | libpcre3-dev, |
2013 | 12 | zlib1g-dev | 13 | zlib1g-dev |
2015 | 13 | Standards-Version: 3.8.4 | 14 | Standards-Version: 3.9.0 |
2016 | 14 | Homepage: http://nginx.net | 15 | Homepage: http://nginx.net |
2017 | 15 | Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/nginx/trunk | 16 | Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/nginx/trunk |
2018 | 16 | Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/nginx/trunk | 17 | Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/nginx/trunk |
2019 | 17 | 18 | ||
2020 | === modified file 'debian/copyright' | |||
2021 | --- debian/copyright 2010-02-05 11:20:28 +0000 | |||
2022 | +++ debian/copyright 2010-07-21 11:15:58 +0000 | |||
2023 | @@ -1,39 +1,40 @@ | |||
2029 | 1 | This package was debianized by Jose Parrella <joseparrella@cantv.net> on | 1 | Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 |
2030 | 2 | Tue, 5 Sep 2006 11:33:34 -0400. | 2 | Name: nginx |
2031 | 3 | 3 | Maintainer: Jose Parrella <joseparrella@cantv.net> | |
2032 | 4 | It was downloaded from http://nginx.net/ | 4 | Source: http://nginx.net/ |
2028 | 5 | |||
2033 | 6 | Upstream Author: Igor Sysoev <igor@sysoev.ru> | 5 | Upstream Author: Igor Sysoev <igor@sysoev.ru> |
2034 | 7 | 6 | ||
2037 | 8 | Copyright © 2002-2010 Igor Sysoev <igor@sysoev.ru> | 7 | Files: * |
2038 | 9 | 8 | Copyright: © 2002-2010, Igor Sysoev <igor@sysoev.ru> | |
2039 | 10 | License: BSD | 9 | License: BSD |
2069 | 11 | 10 | Redistribution and use in source and binary forms, with or without | |
2070 | 12 | Redistribution and use in source and binary forms, with or without | 11 | modification, are permitted provided that the following conditions are met: |
2071 | 13 | modification, are permitted provided that the following conditions | 12 | . |
2072 | 14 | are met: | 13 | 1. Redistributions of source code must retain the above copyright notice, this |
2073 | 15 | 1. Redistributions of source code must retain the above copyright | 14 | list of conditions and the following disclaimer. |
2074 | 16 | notice, this list of conditions and the following disclaimer. | 15 | 2. Redistributions in binary form must reproduce the above copyright notice, |
2075 | 17 | 2. Redistributions in binary form must reproduce the above copyright | 16 | this list of conditions and the following disclaimer in the documentation |
2076 | 18 | notice, this list of conditions and the following disclaimer in the | 17 | and/or other materials provided with the distribution. |
2077 | 19 | documentation and/or other materials provided with the distribution. | 18 | . |
2078 | 20 | 19 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY | |
2079 | 21 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | 20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
2080 | 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
2081 | 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 22 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY |
2082 | 24 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
2083 | 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
2084 | 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
2085 | 27 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 26 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
2086 | 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
2087 | 29 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2088 | 30 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | |
2089 | 31 | SUCH DAMAGE. | 30 | Files: contrib/geo2nginx.pl |
2090 | 32 | 31 | Copyright: © 2005, Andrei Nigmatulin | |
2091 | 33 | On Debian systems, the complete text of the BSD License can be found in | 32 | |
2092 | 34 | `/usr/share/common-licenses/BSD'. | 33 | Files: modules/nginx-upstream-fair/ngx_http_upstream_fair_module.c |
2093 | 35 | 34 | Copyright: © 2007, Igor Sysoev, Grzegorz Nosek | |
2094 | 36 | The Debian packaging is © 2006-2010, Jose Parrella <joseparrella@cantv.net>, | 35 | |
2095 | 37 | Fabio Tranchitella <kobold@debian.org> and © 2009-2010, Kartik Mistry | 36 | Files: debian/* |
2096 | 38 | <kartik@debian.org> and is licensed under the GPL-2 or later, see | 37 | Copyright: © 2006-2010, Jose Parrella <joseparrella@cantv.net>, |
2097 | 39 | `/usr/share/common-licenses/GPL-2' and `/usr/share/common-licenses/GPL-3'. | 38 | Fabio Tranchitella <kobold@debian.org> |
2098 | 39 | © 2009-2010, Kartik Mistry <kartik@debian.org> | ||
2099 | 40 | License: Same as upstream license. | ||
2100 | 40 | 41 | ||
2101 | === modified file 'debian/init.d' | |||
2102 | --- debian/init.d 2010-03-03 23:50:36 +0000 | |||
2103 | +++ debian/init.d 2010-07-21 11:15:58 +0000 | |||
2104 | @@ -27,10 +27,11 @@ | |||
2105 | 27 | . /lib/lsb/init-functions | 27 | . /lib/lsb/init-functions |
2106 | 28 | 28 | ||
2107 | 29 | test_nginx_config() { | 29 | test_nginx_config() { |
2109 | 30 | if nginx -t $DAEMON_OPTS | 30 | if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1 |
2110 | 31 | then | 31 | then |
2111 | 32 | return 0 | 32 | return 0 |
2112 | 33 | else | 33 | else |
2113 | 34 | $DAEMON -t $DAEMON_OPTS | ||
2114 | 34 | return $? | 35 | return $? |
2115 | 35 | fi | 36 | fi |
2116 | 36 | } | 37 | } |
2117 | 37 | 38 | ||
2118 | === added file 'debian/patches/fix_reloading_ipv6.diff' | |||
2119 | --- debian/patches/fix_reloading_ipv6.diff 1970-01-01 00:00:00 +0000 | |||
2120 | +++ debian/patches/fix_reloading_ipv6.diff 2010-07-21 11:15:58 +0000 | |||
2121 | @@ -0,0 +1,15 @@ | |||
2122 | 1 | Description: Patch to fix reloading IPv6 addresses | ||
2123 | 2 | Debian Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577456 | ||
2124 | 3 | Author: Matthias-Christian Ott <ott@mirix.org> | ||
2125 | 4 | |||
2126 | 5 | --- nginx-0.7.65.orig/src/core/ngx_cycle.c 2010-04-13 10:07:14.000000000 +0530 | ||
2127 | 6 | +++ nginx-0.7.65/src/core/ngx_cycle.c 2010-04-13 10:09:59.000000000 +0530 | ||
2128 | 7 | @@ -847,7 +847,7 @@ | ||
2129 | 8 | sin61 = (struct sockaddr_in6 *) sa1; | ||
2130 | 9 | sin62 = (struct sockaddr_in6 *) sa2; | ||
2131 | 10 | |||
2132 | 11 | - if (sin61->sin6_port != sin61->sin6_port) { | ||
2133 | 12 | + if (sin61->sin6_port != sin62->sin6_port) { | ||
2134 | 13 | return NGX_DECLINED; | ||
2135 | 14 | } | ||
2136 | 15 | |||
2137 | 0 | 16 | ||
2138 | === modified file 'debian/patches/nginx-upstream-fair.diff' (properties changed: +x to -x) | |||
2139 | === modified file 'debian/patches/series' | |||
2140 | --- debian/patches/series 2010-02-01 23:44:21 +0000 | |||
2141 | +++ debian/patches/series 2010-07-21 11:15:58 +0000 | |||
2142 | @@ -1,2 +1,3 @@ | |||
2143 | 1 | nginx-upstream-fair.diff | 1 | nginx-upstream-fair.diff |
2144 | 2 | dlopen.diff | 2 | dlopen.diff |
2145 | 3 | fix_reloading_ipv6.diff | ||
2146 | 3 | 4 | ||
2147 | === modified file 'debian/rules' | |||
2148 | --- debian/rules 2010-03-05 01:36:05 +0000 | |||
2149 | +++ debian/rules 2010-07-21 11:15:58 +0000 | |||
2150 | @@ -23,19 +23,24 @@ | |||
2151 | 23 | endif | 23 | endif |
2152 | 24 | ./configure --conf-path=/etc/nginx/nginx.conf \ | 24 | ./configure --conf-path=/etc/nginx/nginx.conf \ |
2153 | 25 | --error-log-path=/var/log/nginx/error.log \ | 25 | --error-log-path=/var/log/nginx/error.log \ |
2156 | 26 | --pid-path=/var/run/nginx.pid \ | 26 | --http-client-body-temp-path=/var/lib/nginx/body \ |
2157 | 27 | --lock-path=/var/lock/nginx.lock \ | 27 | --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ |
2158 | 28 | --http-log-path=/var/log/nginx/access.log \ | 28 | --http-log-path=/var/log/nginx/access.log \ |
2159 | 29 | --http-client-body-temp-path=/var/lib/nginx/body \ | ||
2160 | 30 | --http-proxy-temp-path=/var/lib/nginx/proxy \ | 29 | --http-proxy-temp-path=/var/lib/nginx/proxy \ |
2162 | 31 | --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ | 30 | --lock-path=/var/lock/nginx.lock \ |
2163 | 31 | --pid-path=/var/run/nginx.pid \ | ||
2164 | 32 | --with-debug \ | 32 | --with-debug \ |
2165 | 33 | --with-http_dav_module \ | ||
2166 | 34 | --with-http_flv_module \ | ||
2167 | 35 | --with-http_geoip_module \ | ||
2168 | 36 | --with-http_gzip_static_module \ | ||
2169 | 37 | --with-http_realip_module \ | ||
2170 | 33 | --with-http_stub_status_module \ | 38 | --with-http_stub_status_module \ |
2171 | 34 | --with-http_flv_module \ | ||
2172 | 35 | --with-http_ssl_module \ | 39 | --with-http_ssl_module \ |
2173 | 36 | --with-http_dav_module \ | 40 | --with-http_dav_module \ |
2174 | 37 | --with-http_gzip_static_module \ | 41 | --with-http_gzip_static_module \ |
2175 | 38 | --with-http_realip_module \ | 42 | --with-http_realip_module \ |
2176 | 43 | --with-http_sub_module \ | ||
2177 | 39 | --with-mail \ | 44 | --with-mail \ |
2178 | 40 | --with-mail_ssl_module \ | 45 | --with-mail_ssl_module \ |
2179 | 41 | --with-ipv6 \ | 46 | --with-ipv6 \ |
2180 | 42 | 47 | ||
2181 | === modified file 'src/core/nginx.h' | |||
2182 | --- src/core/nginx.h 2010-03-03 23:50:36 +0000 | |||
2183 | +++ src/core/nginx.h 2010-07-21 11:15:58 +0000 | |||
2184 | @@ -8,8 +8,8 @@ | |||
2185 | 8 | #define _NGINX_H_INCLUDED_ | 8 | #define _NGINX_H_INCLUDED_ |
2186 | 9 | 9 | ||
2187 | 10 | 10 | ||
2190 | 11 | #define nginx_version 7065 | 11 | #define nginx_version 7067 |
2191 | 12 | #define NGINX_VERSION "0.7.65" | 12 | #define NGINX_VERSION "0.7.67" |
2192 | 13 | #define NGINX_VER "nginx/" NGINX_VERSION | 13 | #define NGINX_VER "nginx/" NGINX_VERSION |
2193 | 14 | 14 | ||
2194 | 15 | #define NGINX_VAR "NGINX" | 15 | #define NGINX_VAR "NGINX" |
2195 | 16 | 16 | ||
2196 | === modified file 'src/core/ngx_cycle.c' | |||
2197 | --- src/core/ngx_cycle.c 2009-11-30 13:34:00 +0000 | |||
2198 | +++ src/core/ngx_cycle.c 2010-07-21 11:15:58 +0000 | |||
2199 | @@ -63,7 +63,7 @@ | |||
2200 | 63 | tp = ngx_timeofday(); | 63 | tp = ngx_timeofday(); |
2201 | 64 | tp->sec = 0; | 64 | tp->sec = 0; |
2202 | 65 | 65 | ||
2204 | 66 | ngx_time_update(0, 0); | 66 | ngx_time_update(); |
2205 | 67 | 67 | ||
2206 | 68 | 68 | ||
2207 | 69 | log = old_cycle->log; | 69 | log = old_cycle->log; |
2208 | @@ -847,7 +847,7 @@ | |||
2209 | 847 | sin61 = (struct sockaddr_in6 *) sa1; | 847 | sin61 = (struct sockaddr_in6 *) sa1; |
2210 | 848 | sin62 = (struct sockaddr_in6 *) sa2; | 848 | sin62 = (struct sockaddr_in6 *) sa2; |
2211 | 849 | 849 | ||
2213 | 850 | if (sin61->sin6_port != sin61->sin6_port) { | 850 | if (sin61->sin6_port != sin62->sin6_port) { |
2214 | 851 | return NGX_DECLINED; | 851 | return NGX_DECLINED; |
2215 | 852 | } | 852 | } |
2216 | 853 | 853 | ||
2217 | 854 | 854 | ||
2218 | === modified file 'src/core/ngx_file.c' | |||
2219 | --- src/core/ngx_file.c 2010-03-03 23:50:36 +0000 | |||
2220 | +++ src/core/ngx_file.c 2010-07-21 11:15:58 +0000 | |||
2221 | @@ -762,10 +762,12 @@ | |||
2222 | 762 | size -= n; | 762 | size -= n; |
2223 | 763 | } | 763 | } |
2224 | 764 | 764 | ||
2229 | 765 | if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) { | 765 | if (cf->time != -1) { |
2230 | 766 | ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, | 766 | if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) { |
2231 | 767 | ngx_set_file_time_n " \"%s\" failed", to); | 767 | ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, |
2232 | 768 | goto failed; | 768 | ngx_set_file_time_n " \"%s\" failed", to); |
2233 | 769 | goto failed; | ||
2234 | 770 | } | ||
2235 | 769 | } | 771 | } |
2236 | 770 | 772 | ||
2237 | 771 | rc = NGX_OK; | 773 | rc = NGX_OK; |
2238 | 772 | 774 | ||
2239 | === modified file 'src/core/ngx_open_file_cache.c' | |||
2240 | --- src/core/ngx_open_file_cache.c 2010-03-03 23:50:36 +0000 | |||
2241 | +++ src/core/ngx_open_file_cache.c 2010-07-21 11:15:58 +0000 | |||
2242 | @@ -487,7 +487,14 @@ | |||
2243 | 487 | } | 487 | } |
2244 | 488 | 488 | ||
2245 | 489 | if (!of->log) { | 489 | if (!of->log) { |
2247 | 490 | fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0); | 490 | |
2248 | 491 | /* | ||
2249 | 492 | * Use non-blocking open() not to hang on FIFO files, etc. | ||
2250 | 493 | * This flag has no effect on a regular files. | ||
2251 | 494 | */ | ||
2252 | 495 | |||
2253 | 496 | fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK, | ||
2254 | 497 | NGX_FILE_OPEN, 0); | ||
2255 | 491 | 498 | ||
2256 | 492 | } else { | 499 | } else { |
2257 | 493 | fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, | 500 | fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN, |
2258 | 494 | 501 | ||
2259 | === modified file 'src/core/ngx_string.c' | |||
2260 | --- src/core/ngx_string.c 2010-03-03 23:50:36 +0000 | |||
2261 | +++ src/core/ngx_string.c 2010-07-21 11:15:58 +0000 | |||
2262 | @@ -1277,13 +1277,13 @@ | |||
2263 | 1277 | 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ | 1277 | 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */ |
2264 | 1278 | }; | 1278 | }; |
2265 | 1279 | 1279 | ||
2267 | 1280 | /* " ", "#", "%", "+", "?", %00-%1F, %7F-%FF */ | 1280 | /* " ", "#", "%", "&", "+", "?", %00-%1F, %7F-%FF */ |
2268 | 1281 | 1281 | ||
2269 | 1282 | static uint32_t args[] = { | 1282 | static uint32_t args[] = { |
2270 | 1283 | 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ | 1283 | 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ |
2271 | 1284 | 1284 | ||
2272 | 1285 | /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ | 1285 | /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ |
2274 | 1286 | 0x80000829, /* 1000 0000 0000 0000 0000 1000 0010 1001 */ | 1286 | 0x80000869, /* 1000 0000 0000 0000 0000 1000 0110 1001 */ |
2275 | 1287 | 1287 | ||
2276 | 1288 | /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ | 1288 | /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ |
2277 | 1289 | 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ | 1289 | 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ |
2278 | 1290 | 1290 | ||
2279 | === modified file 'src/core/ngx_times.c' | |||
2280 | --- src/core/ngx_times.c 2009-10-19 23:22:06 +0000 | |||
2281 | +++ src/core/ngx_times.c 2010-07-21 11:15:58 +0000 | |||
2282 | @@ -28,6 +28,17 @@ | |||
2283 | 28 | volatile ngx_str_t ngx_cached_http_time; | 28 | volatile ngx_str_t ngx_cached_http_time; |
2284 | 29 | volatile ngx_str_t ngx_cached_http_log_time; | 29 | volatile ngx_str_t ngx_cached_http_log_time; |
2285 | 30 | 30 | ||
2286 | 31 | #if !(NGX_WIN32) | ||
2287 | 32 | |||
2288 | 33 | /* | ||
2289 | 34 | * locatime() and localtime_r() are not Async-Signal-Safe functions, therefore, | ||
2290 | 35 | * they must not be called by a signal handler, so we use the cached | ||
2291 | 36 | * GMT offset value. Fortunately the value is changed only two times a year. | ||
2292 | 37 | */ | ||
2293 | 38 | |||
2294 | 39 | static ngx_int_t cached_gmtoff; | ||
2295 | 40 | #endif | ||
2296 | 41 | |||
2297 | 31 | static ngx_time_t cached_time[NGX_TIME_SLOTS]; | 42 | static ngx_time_t cached_time[NGX_TIME_SLOTS]; |
2298 | 32 | static u_char cached_err_log_time[NGX_TIME_SLOTS] | 43 | static u_char cached_err_log_time[NGX_TIME_SLOTS] |
2299 | 33 | [sizeof("1970/09/28 12:00:00")]; | 44 | [sizeof("1970/09/28 12:00:00")]; |
2300 | @@ -50,15 +61,17 @@ | |||
2301 | 50 | 61 | ||
2302 | 51 | ngx_cached_time = &cached_time[0]; | 62 | ngx_cached_time = &cached_time[0]; |
2303 | 52 | 63 | ||
2305 | 53 | ngx_time_update(0, 0); | 64 | ngx_time_update(); |
2306 | 54 | } | 65 | } |
2307 | 55 | 66 | ||
2308 | 56 | 67 | ||
2309 | 57 | void | 68 | void |
2311 | 58 | ngx_time_update(time_t sec, ngx_uint_t msec) | 69 | ngx_time_update(void) |
2312 | 59 | { | 70 | { |
2313 | 60 | u_char *p0, *p1, *p2; | 71 | u_char *p0, *p1, *p2; |
2314 | 61 | ngx_tm_t tm, gmt; | 72 | ngx_tm_t tm, gmt; |
2315 | 73 | time_t sec; | ||
2316 | 74 | ngx_uint_t msec; | ||
2317 | 62 | ngx_time_t *tp; | 75 | ngx_time_t *tp; |
2318 | 63 | struct timeval tv; | 76 | struct timeval tv; |
2319 | 64 | 77 | ||
2320 | @@ -66,12 +79,10 @@ | |||
2321 | 66 | return; | 79 | return; |
2322 | 67 | } | 80 | } |
2323 | 68 | 81 | ||
2326 | 69 | if (sec == 0) { | 82 | ngx_gettimeofday(&tv); |
2325 | 70 | ngx_gettimeofday(&tv); | ||
2327 | 71 | 83 | ||
2331 | 72 | sec = tv.tv_sec; | 84 | sec = tv.tv_sec; |
2332 | 73 | msec = tv.tv_usec / 1000; | 85 | msec = tv.tv_usec / 1000; |
2330 | 74 | } | ||
2333 | 75 | 86 | ||
2334 | 76 | ngx_current_msec = (ngx_msec_t) sec * 1000 + msec; | 87 | ngx_current_msec = (ngx_msec_t) sec * 1000 + msec; |
2335 | 77 | 88 | ||
2336 | @@ -112,12 +123,14 @@ | |||
2337 | 112 | #elif (NGX_HAVE_GMTOFF) | 123 | #elif (NGX_HAVE_GMTOFF) |
2338 | 113 | 124 | ||
2339 | 114 | ngx_localtime(sec, &tm); | 125 | ngx_localtime(sec, &tm); |
2341 | 115 | tp->gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60); | 126 | cached_gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60); |
2342 | 127 | tp->gmtoff = cached_gmtoff; | ||
2343 | 116 | 128 | ||
2344 | 117 | #else | 129 | #else |
2345 | 118 | 130 | ||
2346 | 119 | ngx_localtime(sec, &tm); | 131 | ngx_localtime(sec, &tm); |
2348 | 120 | tp->gmtoff = ngx_timezone(tm.ngx_tm_isdst); | 132 | cached_gmtoff = ngx_timezone(tm.ngx_tm_isdst); |
2349 | 133 | tp->gmtoff = cached_gmtoff; | ||
2350 | 121 | 134 | ||
2351 | 122 | #endif | 135 | #endif |
2352 | 123 | 136 | ||
2353 | @@ -151,6 +164,57 @@ | |||
2354 | 151 | } | 164 | } |
2355 | 152 | 165 | ||
2356 | 153 | 166 | ||
2357 | 167 | #if !(NGX_WIN32) | ||
2358 | 168 | |||
2359 | 169 | void | ||
2360 | 170 | ngx_time_sigsafe_update(void) | ||
2361 | 171 | { | ||
2362 | 172 | u_char *p; | ||
2363 | 173 | ngx_tm_t tm; | ||
2364 | 174 | time_t sec; | ||
2365 | 175 | ngx_time_t *tp; | ||
2366 | 176 | struct timeval tv; | ||
2367 | 177 | |||
2368 | 178 | if (!ngx_trylock(&ngx_time_lock)) { | ||
2369 | 179 | return; | ||
2370 | 180 | } | ||
2371 | 181 | |||
2372 | 182 | ngx_gettimeofday(&tv); | ||
2373 | 183 | |||
2374 | 184 | sec = tv.tv_sec; | ||
2375 | 185 | |||
2376 | 186 | tp = &cached_time[slot]; | ||
2377 | 187 | |||
2378 | 188 | if (tp->sec == sec) { | ||
2379 | 189 | ngx_unlock(&ngx_time_lock); | ||
2380 | 190 | return; | ||
2381 | 191 | } | ||
2382 | 192 | |||
2383 | 193 | if (slot == NGX_TIME_SLOTS - 1) { | ||
2384 | 194 | slot = 0; | ||
2385 | 195 | } else { | ||
2386 | 196 | slot++; | ||
2387 | 197 | } | ||
2388 | 198 | |||
2389 | 199 | ngx_gmtime(sec + cached_gmtoff * 60, &tm); | ||
2390 | 200 | |||
2391 | 201 | p = &cached_err_log_time[slot][0]; | ||
2392 | 202 | |||
2393 | 203 | (void) ngx_sprintf(p, "%4d/%02d/%02d %02d:%02d:%02d", | ||
2394 | 204 | tm.ngx_tm_year, tm.ngx_tm_mon, | ||
2395 | 205 | tm.ngx_tm_mday, tm.ngx_tm_hour, | ||
2396 | 206 | tm.ngx_tm_min, tm.ngx_tm_sec); | ||
2397 | 207 | |||
2398 | 208 | ngx_memory_barrier(); | ||
2399 | 209 | |||
2400 | 210 | ngx_cached_err_log_time.data = p; | ||
2401 | 211 | |||
2402 | 212 | ngx_unlock(&ngx_time_lock); | ||
2403 | 213 | } | ||
2404 | 214 | |||
2405 | 215 | #endif | ||
2406 | 216 | |||
2407 | 217 | |||
2408 | 154 | u_char * | 218 | u_char * |
2409 | 155 | ngx_http_time(u_char *buf, time_t t) | 219 | ngx_http_time(u_char *buf, time_t t) |
2410 | 156 | { | 220 | { |
2411 | 157 | 221 | ||
2412 | === modified file 'src/core/ngx_times.h' | |||
2413 | --- src/core/ngx_times.h 2009-10-19 23:22:06 +0000 | |||
2414 | +++ src/core/ngx_times.h 2010-07-21 11:15:58 +0000 | |||
2415 | @@ -20,7 +20,8 @@ | |||
2416 | 20 | 20 | ||
2417 | 21 | 21 | ||
2418 | 22 | void ngx_time_init(void); | 22 | void ngx_time_init(void); |
2420 | 23 | void ngx_time_update(time_t sec, ngx_uint_t msec); | 23 | void ngx_time_update(void); |
2421 | 24 | void ngx_time_sigsafe_update(void); | ||
2422 | 24 | u_char *ngx_http_time(u_char *buf, time_t t); | 25 | u_char *ngx_http_time(u_char *buf, time_t t); |
2423 | 25 | u_char *ngx_http_cookie_time(u_char *buf, time_t t); | 26 | u_char *ngx_http_cookie_time(u_char *buf, time_t t); |
2424 | 26 | void ngx_gmtime(time_t t, ngx_tm_t *tp); | 27 | void ngx_gmtime(time_t t, ngx_tm_t *tp); |
2425 | 27 | 28 | ||
2426 | === modified file 'src/event/modules/ngx_devpoll_module.c' | |||
2427 | --- src/event/modules/ngx_devpoll_module.c 2009-11-08 09:53:46 +0000 | |||
2428 | +++ src/event/modules/ngx_devpoll_module.c 2010-07-21 11:15:58 +0000 | |||
2429 | @@ -375,8 +375,8 @@ | |||
2430 | 375 | err = 0; | 375 | err = 0; |
2431 | 376 | } | 376 | } |
2432 | 377 | 377 | ||
2435 | 378 | if (flags & NGX_UPDATE_TIME) { | 378 | if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) { |
2436 | 379 | ngx_time_update(0, 0); | 379 | ngx_time_update(); |
2437 | 380 | } | 380 | } |
2438 | 381 | 381 | ||
2439 | 382 | if (err) { | 382 | if (err) { |
2440 | 383 | 383 | ||
2441 | === modified file 'src/event/modules/ngx_epoll_module.c' | |||
2442 | --- src/event/modules/ngx_epoll_module.c 2009-11-08 09:53:46 +0000 | |||
2443 | +++ src/event/modules/ngx_epoll_module.c 2010-07-21 11:15:58 +0000 | |||
2444 | @@ -407,8 +407,8 @@ | |||
2445 | 407 | err = 0; | 407 | err = 0; |
2446 | 408 | } | 408 | } |
2447 | 409 | 409 | ||
2450 | 410 | if (flags & NGX_UPDATE_TIME) { | 410 | if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) { |
2451 | 411 | ngx_time_update(0, 0); | 411 | ngx_time_update(); |
2452 | 412 | } | 412 | } |
2453 | 413 | 413 | ||
2454 | 414 | if (err) { | 414 | if (err) { |
2455 | 415 | 415 | ||
2456 | === modified file 'src/event/modules/ngx_eventport_module.c' | |||
2457 | --- src/event/modules/ngx_eventport_module.c 2009-11-08 09:53:46 +0000 | |||
2458 | +++ src/event/modules/ngx_eventport_module.c 2010-07-21 11:15:58 +0000 | |||
2459 | @@ -405,7 +405,7 @@ | |||
2460 | 405 | err = ngx_errno; | 405 | err = ngx_errno; |
2461 | 406 | 406 | ||
2462 | 407 | if (flags & NGX_UPDATE_TIME) { | 407 | if (flags & NGX_UPDATE_TIME) { |
2464 | 408 | ngx_time_update(0, 0); | 408 | ngx_time_update(); |
2465 | 409 | } | 409 | } |
2466 | 410 | 410 | ||
2467 | 411 | if (n == -1) { | 411 | if (n == -1) { |
2468 | @@ -439,7 +439,7 @@ | |||
2469 | 439 | for (i = 0; i < events; i++) { | 439 | for (i = 0; i < events; i++) { |
2470 | 440 | 440 | ||
2471 | 441 | if (event_list[i].portev_source == PORT_SOURCE_TIMER) { | 441 | if (event_list[i].portev_source == PORT_SOURCE_TIMER) { |
2473 | 442 | ngx_time_update(0, 0); | 442 | ngx_time_update(); |
2474 | 443 | continue; | 443 | continue; |
2475 | 444 | } | 444 | } |
2476 | 445 | 445 | ||
2477 | 446 | 446 | ||
2478 | === modified file 'src/event/modules/ngx_kqueue_module.c' | |||
2479 | --- src/event/modules/ngx_kqueue_module.c 2009-11-30 13:34:00 +0000 | |||
2480 | +++ src/event/modules/ngx_kqueue_module.c 2010-07-21 11:15:58 +0000 | |||
2481 | @@ -543,8 +543,8 @@ | |||
2482 | 543 | err = 0; | 543 | err = 0; |
2483 | 544 | } | 544 | } |
2484 | 545 | 545 | ||
2487 | 546 | if (flags & NGX_UPDATE_TIME) { | 546 | if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) { |
2488 | 547 | ngx_time_update(0, 0); | 547 | ngx_time_update(); |
2489 | 548 | } | 548 | } |
2490 | 549 | 549 | ||
2491 | 550 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 550 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
2492 | @@ -595,7 +595,7 @@ | |||
2493 | 595 | #if (NGX_HAVE_TIMER_EVENT) | 595 | #if (NGX_HAVE_TIMER_EVENT) |
2494 | 596 | 596 | ||
2495 | 597 | if (event_list[i].filter == EVFILT_TIMER) { | 597 | if (event_list[i].filter == EVFILT_TIMER) { |
2497 | 598 | ngx_time_update(0, 0); | 598 | ngx_time_update(); |
2498 | 599 | continue; | 599 | continue; |
2499 | 600 | } | 600 | } |
2500 | 601 | 601 | ||
2501 | 602 | 602 | ||
2502 | === modified file 'src/event/modules/ngx_poll_module.c' | |||
2503 | --- src/event/modules/ngx_poll_module.c 2007-12-08 11:27:54 +0000 | |||
2504 | +++ src/event/modules/ngx_poll_module.c 2010-07-21 11:15:58 +0000 | |||
2505 | @@ -266,8 +266,8 @@ | |||
2506 | 266 | err = 0; | 266 | err = 0; |
2507 | 267 | } | 267 | } |
2508 | 268 | 268 | ||
2511 | 269 | if (flags & NGX_UPDATE_TIME) { | 269 | if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) { |
2512 | 270 | ngx_time_update(0, 0); | 270 | ngx_time_update(); |
2513 | 271 | } | 271 | } |
2514 | 272 | 272 | ||
2515 | 273 | ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 273 | ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
2516 | 274 | 274 | ||
2517 | === modified file 'src/event/modules/ngx_rtsig_module.c' | |||
2518 | --- src/event/modules/ngx_rtsig_module.c 2009-11-08 09:53:46 +0000 | |||
2519 | +++ src/event/modules/ngx_rtsig_module.c 2010-07-21 11:15:58 +0000 | |||
2520 | @@ -323,7 +323,7 @@ | |||
2521 | 323 | "rtsig signo:%d", signo); | 323 | "rtsig signo:%d", signo); |
2522 | 324 | 324 | ||
2523 | 325 | if (flags & NGX_UPDATE_TIME) { | 325 | if (flags & NGX_UPDATE_TIME) { |
2525 | 326 | ngx_time_update(0, 0); | 326 | ngx_time_update(); |
2526 | 327 | } | 327 | } |
2527 | 328 | 328 | ||
2528 | 329 | if (err == NGX_EAGAIN) { | 329 | if (err == NGX_EAGAIN) { |
2529 | @@ -349,7 +349,7 @@ | |||
2530 | 349 | signo, si.si_fd, si.si_band); | 349 | signo, si.si_fd, si.si_band); |
2531 | 350 | 350 | ||
2532 | 351 | if (flags & NGX_UPDATE_TIME) { | 351 | if (flags & NGX_UPDATE_TIME) { |
2534 | 352 | ngx_time_update(0, 0); | 352 | ngx_time_update(); |
2535 | 353 | } | 353 | } |
2536 | 354 | 354 | ||
2537 | 355 | rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module); | 355 | rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module); |
2538 | @@ -419,7 +419,7 @@ | |||
2539 | 419 | 419 | ||
2540 | 420 | } else if (signo == SIGALRM) { | 420 | } else if (signo == SIGALRM) { |
2541 | 421 | 421 | ||
2543 | 422 | ngx_time_update(0, 0); | 422 | ngx_time_update(); |
2544 | 423 | 423 | ||
2545 | 424 | return NGX_OK; | 424 | return NGX_OK; |
2546 | 425 | 425 | ||
2547 | @@ -671,7 +671,7 @@ | |||
2548 | 671 | } | 671 | } |
2549 | 672 | 672 | ||
2550 | 673 | if (flags & NGX_UPDATE_TIME) { | 673 | if (flags & NGX_UPDATE_TIME) { |
2552 | 674 | ngx_time_update(0, 0); | 674 | ngx_time_update(); |
2553 | 675 | } | 675 | } |
2554 | 676 | 676 | ||
2555 | 677 | ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, | 677 | ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, |
2556 | 678 | 678 | ||
2557 | === modified file 'src/event/modules/ngx_select_module.c' | |||
2558 | --- src/event/modules/ngx_select_module.c 2009-10-19 23:22:06 +0000 | |||
2559 | +++ src/event/modules/ngx_select_module.c 2010-07-21 11:15:58 +0000 | |||
2560 | @@ -266,8 +266,8 @@ | |||
2561 | 266 | err = 0; | 266 | err = 0; |
2562 | 267 | } | 267 | } |
2563 | 268 | 268 | ||
2566 | 269 | if (flags & NGX_UPDATE_TIME) { | 269 | if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) { |
2567 | 270 | ngx_time_update(0, 0); | 270 | ngx_time_update(); |
2568 | 271 | } | 271 | } |
2569 | 272 | 272 | ||
2570 | 273 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 273 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
2571 | 274 | 274 | ||
2572 | === modified file 'src/event/modules/ngx_win32_select_module.c' | |||
2573 | --- src/event/modules/ngx_win32_select_module.c 2009-10-19 23:22:06 +0000 | |||
2574 | +++ src/event/modules/ngx_win32_select_module.c 2010-07-21 11:15:58 +0000 | |||
2575 | @@ -273,7 +273,7 @@ | |||
2576 | 273 | } | 273 | } |
2577 | 274 | 274 | ||
2578 | 275 | if (flags & NGX_UPDATE_TIME) { | 275 | if (flags & NGX_UPDATE_TIME) { |
2580 | 276 | ngx_time_update(0, 0); | 276 | ngx_time_update(); |
2581 | 277 | } | 277 | } |
2582 | 278 | 278 | ||
2583 | 279 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 279 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
2584 | 280 | 280 | ||
2585 | === modified file 'src/event/ngx_event.c' | |||
2586 | --- src/event/ngx_event.c 2009-11-30 13:34:00 +0000 | |||
2587 | +++ src/event/ngx_event.c 2010-07-21 11:15:58 +0000 | |||
2588 | @@ -562,8 +562,6 @@ | |||
2589 | 562 | { | 562 | { |
2590 | 563 | ngx_event_timer_alarm = 1; | 563 | ngx_event_timer_alarm = 1; |
2591 | 564 | 564 | ||
2592 | 565 | ngx_time_update(0, 0); | ||
2593 | 566 | |||
2594 | 567 | #if 1 | 565 | #if 1 |
2595 | 568 | ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0, "timer signal"); | 566 | ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0, "timer signal"); |
2596 | 569 | #endif | 567 | #endif |
2597 | 570 | 568 | ||
2598 | === modified file 'src/event/ngx_event_openssl.c' | |||
2599 | --- src/event/ngx_event_openssl.c 2010-03-03 23:50:36 +0000 | |||
2600 | +++ src/event/ngx_event_openssl.c 2010-07-21 11:15:58 +0000 | |||
2601 | @@ -106,6 +106,8 @@ | |||
2602 | 106 | 106 | ||
2603 | 107 | ENGINE_load_builtin_engines(); | 107 | ENGINE_load_builtin_engines(); |
2604 | 108 | 108 | ||
2605 | 109 | OpenSSL_add_all_algorithms(); | ||
2606 | 110 | |||
2607 | 109 | ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); | 111 | ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL); |
2608 | 110 | 112 | ||
2609 | 111 | if (ngx_ssl_connection_index == -1) { | 113 | if (ngx_ssl_connection_index == -1) { |
2610 | @@ -559,6 +561,9 @@ | |||
2611 | 559 | #if (NGX_DEBUG) | 561 | #if (NGX_DEBUG) |
2612 | 560 | { | 562 | { |
2613 | 561 | char buf[129], *s, *d; | 563 | char buf[129], *s, *d; |
2614 | 564 | #if OPENSSL_VERSION_NUMBER >= 0x1000000fL | ||
2615 | 565 | const | ||
2616 | 566 | #endif | ||
2617 | 562 | SSL_CIPHER *cipher; | 567 | SSL_CIPHER *cipher; |
2618 | 563 | 568 | ||
2619 | 564 | cipher = SSL_get_current_cipher(c->ssl->connection); | 569 | cipher = SSL_get_current_cipher(c->ssl->connection); |
2620 | @@ -1308,10 +1313,14 @@ | |||
2621 | 1308 | 1313 | ||
2622 | 1309 | /* handshake failures */ | 1314 | /* handshake failures */ |
2623 | 1310 | if (n == SSL_R_DIGEST_CHECK_FAILED /* 149 */ | 1315 | if (n == SSL_R_DIGEST_CHECK_FAILED /* 149 */ |
2624 | 1316 | || n == SSL_R_LENGTH_MISMATCH /* 159 */ | ||
2625 | 1311 | || n == SSL_R_NO_CIPHERS_PASSED /* 182 */ | 1317 | || n == SSL_R_NO_CIPHERS_PASSED /* 182 */ |
2626 | 1318 | || n == SSL_R_NO_CIPHERS_SPECIFIED /* 183 */ | ||
2627 | 1312 | || n == SSL_R_NO_SHARED_CIPHER /* 193 */ | 1319 | || n == SSL_R_NO_SHARED_CIPHER /* 193 */ |
2628 | 1320 | || n == SSL_R_RECORD_LENGTH_MISMATCH /* 213 */ | ||
2629 | 1313 | || n == SSL_R_UNEXPECTED_MESSAGE /* 244 */ | 1321 | || n == SSL_R_UNEXPECTED_MESSAGE /* 244 */ |
2630 | 1314 | || n == SSL_R_UNEXPECTED_RECORD /* 245 */ | 1322 | || n == SSL_R_UNEXPECTED_RECORD /* 245 */ |
2631 | 1323 | || n == SSL_R_UNKNOWN_ALERT_TYPE /* 246 */ | ||
2632 | 1315 | || n == SSL_R_UNKNOWN_PROTOCOL /* 252 */ | 1324 | || n == SSL_R_UNKNOWN_PROTOCOL /* 252 */ |
2633 | 1316 | || n == SSL_R_WRONG_VERSION_NUMBER /* 267 */ | 1325 | || n == SSL_R_WRONG_VERSION_NUMBER /* 267 */ |
2634 | 1317 | || n == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC /* 281 */ | 1326 | || n == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC /* 281 */ |
2635 | @@ -1424,6 +1433,8 @@ | |||
2636 | 1424 | return NGX_OK; | 1433 | return NGX_OK; |
2637 | 1425 | } | 1434 | } |
2638 | 1426 | 1435 | ||
2639 | 1436 | SSL_CTX_set_session_id_context(ssl->ctx, sess_ctx->data, sess_ctx->len); | ||
2640 | 1437 | |||
2641 | 1427 | if (builtin_session_cache == NGX_SSL_NONE_SCACHE) { | 1438 | if (builtin_session_cache == NGX_SSL_NONE_SCACHE) { |
2642 | 1428 | 1439 | ||
2643 | 1429 | /* | 1440 | /* |
2644 | @@ -1455,8 +1466,6 @@ | |||
2645 | 1455 | 1466 | ||
2646 | 1456 | SSL_CTX_set_session_cache_mode(ssl->ctx, cache_mode); | 1467 | SSL_CTX_set_session_cache_mode(ssl->ctx, cache_mode); |
2647 | 1457 | 1468 | ||
2648 | 1458 | SSL_CTX_set_session_id_context(ssl->ctx, sess_ctx->data, sess_ctx->len); | ||
2649 | 1459 | |||
2650 | 1460 | if (builtin_session_cache != NGX_SSL_NO_BUILTIN_SCACHE) { | 1469 | if (builtin_session_cache != NGX_SSL_NO_BUILTIN_SCACHE) { |
2651 | 1461 | 1470 | ||
2652 | 1462 | if (builtin_session_cache != NGX_SSL_DFLT_BUILTIN_SCACHE) { | 1471 | if (builtin_session_cache != NGX_SSL_DFLT_BUILTIN_SCACHE) { |
2653 | @@ -2311,5 +2320,6 @@ | |||
2654 | 2311 | static void | 2320 | static void |
2655 | 2312 | ngx_openssl_exit(ngx_cycle_t *cycle) | 2321 | ngx_openssl_exit(ngx_cycle_t *cycle) |
2656 | 2313 | { | 2322 | { |
2657 | 2323 | EVP_cleanup(); | ||
2658 | 2314 | ENGINE_cleanup(); | 2324 | ENGINE_cleanup(); |
2659 | 2315 | } | 2325 | } |
2660 | 2316 | 2326 | ||
2661 | === modified file 'src/event/ngx_event_openssl.h' | |||
2662 | --- src/event/ngx_event_openssl.h 2010-03-03 23:50:36 +0000 | |||
2663 | +++ src/event/ngx_event_openssl.h 2010-07-21 11:15:58 +0000 | |||
2664 | @@ -15,6 +15,7 @@ | |||
2665 | 15 | #include <openssl/err.h> | 15 | #include <openssl/err.h> |
2666 | 16 | #include <openssl/conf.h> | 16 | #include <openssl/conf.h> |
2667 | 17 | #include <openssl/engine.h> | 17 | #include <openssl/engine.h> |
2668 | 18 | #include <openssl/evp.h> | ||
2669 | 18 | 19 | ||
2670 | 19 | #define NGX_SSL_NAME "OpenSSL" | 20 | #define NGX_SSL_NAME "OpenSSL" |
2671 | 20 | 21 | ||
2672 | 21 | 22 | ||
2673 | === modified file 'src/http/modules/ngx_http_autoindex_module.c' | |||
2674 | --- src/http/modules/ngx_http_autoindex_module.c 2009-11-30 13:34:00 +0000 | |||
2675 | +++ src/http/modules/ngx_http_autoindex_module.c 2010-07-21 11:15:58 +0000 | |||
2676 | @@ -160,10 +160,6 @@ | |||
2677 | 160 | return NGX_DECLINED; | 160 | return NGX_DECLINED; |
2678 | 161 | } | 161 | } |
2679 | 162 | 162 | ||
2680 | 163 | if (r->zero_in_uri) { | ||
2681 | 164 | return NGX_DECLINED; | ||
2682 | 165 | } | ||
2683 | 166 | |||
2684 | 167 | if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { | 163 | if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { |
2685 | 168 | return NGX_DECLINED; | 164 | return NGX_DECLINED; |
2686 | 169 | } | 165 | } |
2687 | 170 | 166 | ||
2688 | === modified file 'src/http/modules/ngx_http_chunked_filter_module.c' | |||
2689 | --- src/http/modules/ngx_http_chunked_filter_module.c 2009-10-19 23:22:06 +0000 | |||
2690 | +++ src/http/modules/ngx_http_chunked_filter_module.c 2010-07-21 11:15:58 +0000 | |||
2691 | @@ -50,9 +50,10 @@ | |||
2692 | 50 | static ngx_int_t | 50 | static ngx_int_t |
2693 | 51 | ngx_http_chunked_header_filter(ngx_http_request_t *r) | 51 | ngx_http_chunked_header_filter(ngx_http_request_t *r) |
2694 | 52 | { | 52 | { |
2695 | 53 | ngx_http_core_loc_conf_t *clcf; | ||
2696 | 54 | |||
2697 | 53 | if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED | 55 | if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED |
2698 | 54 | || r->headers_out.status == NGX_HTTP_NO_CONTENT | 56 | || r->headers_out.status == NGX_HTTP_NO_CONTENT |
2699 | 55 | || r->headers_out.status == NGX_HTTP_CREATED | ||
2700 | 56 | || r != r->main | 57 | || r != r->main |
2701 | 57 | || (r->method & NGX_HTTP_HEAD)) | 58 | || (r->method & NGX_HTTP_HEAD)) |
2702 | 58 | { | 59 | { |
2703 | @@ -64,7 +65,14 @@ | |||
2704 | 64 | r->keepalive = 0; | 65 | r->keepalive = 0; |
2705 | 65 | 66 | ||
2706 | 66 | } else { | 67 | } else { |
2708 | 67 | r->chunked = 1; | 68 | clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
2709 | 69 | |||
2710 | 70 | if (clcf->chunked_transfer_encoding) { | ||
2711 | 71 | r->chunked = 1; | ||
2712 | 72 | |||
2713 | 73 | } else { | ||
2714 | 74 | r->keepalive = 0; | ||
2715 | 75 | } | ||
2716 | 68 | } | 76 | } |
2717 | 69 | } | 77 | } |
2718 | 70 | 78 | ||
2719 | 71 | 79 | ||
2720 | === modified file 'src/http/modules/ngx_http_dav_module.c' | |||
2721 | --- src/http/modules/ngx_http_dav_module.c 2009-11-30 13:34:00 +0000 | |||
2722 | +++ src/http/modules/ngx_http_dav_module.c 2010-07-21 11:15:58 +0000 | |||
2723 | @@ -146,10 +146,6 @@ | |||
2724 | 146 | ngx_int_t rc; | 146 | ngx_int_t rc; |
2725 | 147 | ngx_http_dav_loc_conf_t *dlcf; | 147 | ngx_http_dav_loc_conf_t *dlcf; |
2726 | 148 | 148 | ||
2727 | 149 | if (r->zero_in_uri) { | ||
2728 | 150 | return NGX_DECLINED; | ||
2729 | 151 | } | ||
2730 | 152 | |||
2731 | 153 | dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module); | 149 | dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module); |
2732 | 154 | 150 | ||
2733 | 155 | if (!(r->method & dlcf->methods)) { | 151 | if (!(r->method & dlcf->methods)) { |
2734 | @@ -325,13 +321,13 @@ | |||
2735 | 325 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 321 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2736 | 326 | "http delete filename: \"%s\"", path.data); | 322 | "http delete filename: \"%s\"", path.data); |
2737 | 327 | 323 | ||
2739 | 328 | if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) { | 324 | if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) { |
2740 | 329 | err = ngx_errno; | 325 | err = ngx_errno; |
2741 | 330 | 326 | ||
2742 | 331 | rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND; | 327 | rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND; |
2743 | 332 | 328 | ||
2744 | 333 | return ngx_http_dav_error(r->connection->log, err, | 329 | return ngx_http_dav_error(r->connection->log, err, |
2746 | 334 | rc, ngx_file_info_n, path.data); | 330 | rc, ngx_link_info_n, path.data); |
2747 | 335 | } | 331 | } |
2748 | 336 | 332 | ||
2749 | 337 | if (ngx_is_dir(&fi)) { | 333 | if (ngx_is_dir(&fi)) { |
2750 | @@ -358,7 +354,7 @@ | |||
2751 | 358 | 354 | ||
2752 | 359 | /* | 355 | /* |
2753 | 360 | * we do not need to test (r->uri.data[r->uri.len - 1] == '/') | 356 | * we do not need to test (r->uri.data[r->uri.len - 1] == '/') |
2755 | 361 | * because ngx_file_info("/file/") returned NGX_ENOTDIR above | 357 | * because ngx_link_info("/file/") returned NGX_ENOTDIR above |
2756 | 362 | */ | 358 | */ |
2757 | 363 | 359 | ||
2758 | 364 | depth = ngx_http_dav_depth(r, 0); | 360 | depth = ngx_http_dav_depth(r, 0); |
2759 | @@ -685,12 +681,12 @@ | |||
2760 | 685 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 681 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2761 | 686 | "http copy to: \"%s\"", copy.path.data); | 682 | "http copy to: \"%s\"", copy.path.data); |
2762 | 687 | 683 | ||
2764 | 688 | if (ngx_file_info(copy.path.data, &fi) == NGX_FILE_ERROR) { | 684 | if (ngx_link_info(copy.path.data, &fi) == NGX_FILE_ERROR) { |
2765 | 689 | err = ngx_errno; | 685 | err = ngx_errno; |
2766 | 690 | 686 | ||
2767 | 691 | if (err != NGX_ENOENT) { | 687 | if (err != NGX_ENOENT) { |
2768 | 692 | return ngx_http_dav_error(r->connection->log, err, | 688 | return ngx_http_dav_error(r->connection->log, err, |
2770 | 693 | NGX_HTTP_NOT_FOUND, ngx_file_info_n, | 689 | NGX_HTTP_NOT_FOUND, ngx_link_info_n, |
2771 | 694 | copy.path.data); | 690 | copy.path.data); |
2772 | 695 | } | 691 | } |
2773 | 696 | 692 | ||
2774 | @@ -719,9 +715,9 @@ | |||
2775 | 719 | dir = ngx_is_dir(&fi); | 715 | dir = ngx_is_dir(&fi); |
2776 | 720 | } | 716 | } |
2777 | 721 | 717 | ||
2779 | 722 | if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) { | 718 | if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) { |
2780 | 723 | return ngx_http_dav_error(r->connection->log, ngx_errno, | 719 | return ngx_http_dav_error(r->connection->log, ngx_errno, |
2782 | 724 | NGX_HTTP_NOT_FOUND, ngx_file_info_n, | 720 | NGX_HTTP_NOT_FOUND, ngx_link_info_n, |
2783 | 725 | path.data); | 721 | path.data); |
2784 | 726 | } | 722 | } |
2785 | 727 | 723 | ||
2786 | 728 | 724 | ||
2787 | === modified file 'src/http/modules/ngx_http_fastcgi_module.c' | |||
2788 | --- src/http/modules/ngx_http_fastcgi_module.c 2010-03-03 23:50:36 +0000 | |||
2789 | +++ src/http/modules/ngx_http_fastcgi_module.c 2010-07-21 11:15:58 +0000 | |||
2790 | @@ -333,6 +333,13 @@ | |||
2791 | 333 | 0, | 333 | 0, |
2792 | 334 | &ngx_http_fastcgi_module }, | 334 | &ngx_http_fastcgi_module }, |
2793 | 335 | 335 | ||
2794 | 336 | { ngx_string("fastcgi_no_cache"), | ||
2795 | 337 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | ||
2796 | 338 | ngx_http_no_cache_set_slot, | ||
2797 | 339 | NGX_HTTP_LOC_CONF_OFFSET, | ||
2798 | 340 | offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache), | ||
2799 | 341 | NULL }, | ||
2800 | 342 | |||
2801 | 336 | { ngx_string("fastcgi_cache_valid"), | 343 | { ngx_string("fastcgi_cache_valid"), |
2802 | 337 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | 344 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
2803 | 338 | ngx_http_file_cache_valid_set_slot, | 345 | ngx_http_file_cache_valid_set_slot, |
2804 | @@ -1890,6 +1897,7 @@ | |||
2805 | 1890 | #if (NGX_HTTP_CACHE) | 1897 | #if (NGX_HTTP_CACHE) |
2806 | 1891 | conf->upstream.cache = NGX_CONF_UNSET_PTR; | 1898 | conf->upstream.cache = NGX_CONF_UNSET_PTR; |
2807 | 1892 | conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; | 1899 | conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; |
2808 | 1900 | conf->upstream.no_cache = NGX_CONF_UNSET_PTR; | ||
2809 | 1893 | conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; | 1901 | conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; |
2810 | 1894 | #endif | 1902 | #endif |
2811 | 1895 | 1903 | ||
2812 | @@ -2111,6 +2119,9 @@ | |||
2813 | 2111 | 2119 | ||
2814 | 2112 | conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; | 2120 | conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD; |
2815 | 2113 | 2121 | ||
2816 | 2122 | ngx_conf_merge_ptr_value(conf->upstream.no_cache, | ||
2817 | 2123 | prev->upstream.no_cache, NULL); | ||
2818 | 2124 | |||
2819 | 2114 | ngx_conf_merge_ptr_value(conf->upstream.cache_valid, | 2125 | ngx_conf_merge_ptr_value(conf->upstream.cache_valid, |
2820 | 2115 | prev->upstream.cache_valid, NULL); | 2126 | prev->upstream.cache_valid, NULL); |
2821 | 2116 | 2127 | ||
2822 | 2117 | 2128 | ||
2823 | === modified file 'src/http/modules/ngx_http_flv_module.c' | |||
2824 | --- src/http/modules/ngx_http_flv_module.c 2009-10-19 23:22:06 +0000 | |||
2825 | +++ src/http/modules/ngx_http_flv_module.c 2010-07-21 11:15:58 +0000 | |||
2826 | @@ -80,10 +80,6 @@ | |||
2827 | 80 | return NGX_DECLINED; | 80 | return NGX_DECLINED; |
2828 | 81 | } | 81 | } |
2829 | 82 | 82 | ||
2830 | 83 | if (r->zero_in_uri) { | ||
2831 | 84 | return NGX_DECLINED; | ||
2832 | 85 | } | ||
2833 | 86 | |||
2834 | 87 | rc = ngx_http_discard_request_body(r); | 83 | rc = ngx_http_discard_request_body(r); |
2835 | 88 | 84 | ||
2836 | 89 | if (rc != NGX_OK) { | 85 | if (rc != NGX_OK) { |
2837 | 90 | 86 | ||
2838 | === modified file 'src/http/modules/ngx_http_geo_module.c' | |||
2839 | --- src/http/modules/ngx_http_geo_module.c 2009-11-30 13:34:00 +0000 | |||
2840 | +++ src/http/modules/ngx_http_geo_module.c 2010-07-21 11:15:58 +0000 | |||
2841 | @@ -589,7 +589,7 @@ | |||
2842 | 589 | ngx_array_t *a; | 589 | ngx_array_t *a; |
2843 | 590 | ngx_http_geo_range_t *range; | 590 | ngx_http_geo_range_t *range; |
2844 | 591 | 591 | ||
2846 | 592 | for (n = start; n <= end; n += 0x10000) { | 592 | for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) { |
2847 | 593 | 593 | ||
2848 | 594 | h = n >> 16; | 594 | h = n >> 16; |
2849 | 595 | 595 | ||
2850 | 596 | 596 | ||
2851 | === modified file 'src/http/modules/ngx_http_geoip_module.c' | |||
2852 | --- src/http/modules/ngx_http_geoip_module.c 2009-11-08 09:53:46 +0000 | |||
2853 | +++ src/http/modules/ngx_http_geoip_module.c 2010-07-21 11:15:58 +0000 | |||
2854 | @@ -30,6 +30,9 @@ | |||
2855 | 30 | ngx_http_variable_value_t *v, uintptr_t data); | 30 | ngx_http_variable_value_t *v, uintptr_t data); |
2856 | 31 | static ngx_int_t ngx_http_geoip_city_variable(ngx_http_request_t *r, | 31 | static ngx_int_t ngx_http_geoip_city_variable(ngx_http_request_t *r, |
2857 | 32 | ngx_http_variable_value_t *v, uintptr_t data); | 32 | ngx_http_variable_value_t *v, uintptr_t data); |
2858 | 33 | static ngx_int_t ngx_http_geoip_city_float_variable(ngx_http_request_t *r, | ||
2859 | 34 | ngx_http_variable_value_t *v, uintptr_t data); | ||
2860 | 35 | static GeoIPRecord *ngx_http_geoip_get_city_record(ngx_http_request_t *r); | ||
2861 | 33 | 36 | ||
2862 | 34 | static ngx_int_t ngx_http_geoip_add_variables(ngx_conf_t *cf); | 37 | static ngx_int_t ngx_http_geoip_add_variables(ngx_conf_t *cf); |
2863 | 35 | static void *ngx_http_geoip_create_conf(ngx_conf_t *cf); | 38 | static void *ngx_http_geoip_create_conf(ngx_conf_t *cf); |
2864 | @@ -93,23 +96,32 @@ | |||
2865 | 93 | 96 | ||
2866 | 94 | static ngx_http_variable_t ngx_http_geoip_vars[] = { | 97 | static ngx_http_variable_t ngx_http_geoip_vars[] = { |
2867 | 95 | 98 | ||
2869 | 96 | { ngx_string("geoip_country_code"), NULL, ngx_http_geoip_country_variable, | 99 | { ngx_string("geoip_country_code"), NULL, |
2870 | 100 | ngx_http_geoip_country_variable, | ||
2871 | 97 | (uintptr_t) GeoIP_country_code_by_ipnum, 0, 0 }, | 101 | (uintptr_t) GeoIP_country_code_by_ipnum, 0, 0 }, |
2872 | 98 | 102 | ||
2874 | 99 | { ngx_string("geoip_country_code3"), NULL, ngx_http_geoip_country_variable, | 103 | { ngx_string("geoip_country_code3"), NULL, |
2875 | 104 | ngx_http_geoip_country_variable, | ||
2876 | 100 | (uintptr_t) GeoIP_country_code3_by_ipnum, 0, 0 }, | 105 | (uintptr_t) GeoIP_country_code3_by_ipnum, 0, 0 }, |
2877 | 101 | 106 | ||
2879 | 102 | { ngx_string("geoip_country_name"), NULL, ngx_http_geoip_country_variable, | 107 | { ngx_string("geoip_country_name"), NULL, |
2880 | 108 | ngx_http_geoip_country_variable, | ||
2881 | 103 | (uintptr_t) GeoIP_country_name_by_ipnum, 0, 0 }, | 109 | (uintptr_t) GeoIP_country_name_by_ipnum, 0, 0 }, |
2882 | 104 | 110 | ||
2884 | 105 | { ngx_string("geoip_city_country_code"), NULL, ngx_http_geoip_city_variable, | 111 | { ngx_string("geoip_city_continent_code"), NULL, |
2885 | 112 | ngx_http_geoip_city_variable, | ||
2886 | 113 | offsetof(GeoIPRecord, continent_code), 0, 0 }, | ||
2887 | 114 | |||
2888 | 115 | { ngx_string("geoip_city_country_code"), NULL, | ||
2889 | 116 | ngx_http_geoip_city_variable, | ||
2890 | 106 | offsetof(GeoIPRecord, country_code), 0, 0 }, | 117 | offsetof(GeoIPRecord, country_code), 0, 0 }, |
2891 | 107 | 118 | ||
2892 | 108 | { ngx_string("geoip_city_country_code3"), NULL, | 119 | { ngx_string("geoip_city_country_code3"), NULL, |
2893 | 109 | ngx_http_geoip_city_variable, | 120 | ngx_http_geoip_city_variable, |
2894 | 110 | offsetof(GeoIPRecord, country_code3), 0, 0 }, | 121 | offsetof(GeoIPRecord, country_code3), 0, 0 }, |
2895 | 111 | 122 | ||
2897 | 112 | { ngx_string("geoip_city_country_name"), NULL, ngx_http_geoip_city_variable, | 123 | { ngx_string("geoip_city_country_name"), NULL, |
2898 | 124 | ngx_http_geoip_city_variable, | ||
2899 | 113 | offsetof(GeoIPRecord, country_name), 0, 0 }, | 125 | offsetof(GeoIPRecord, country_name), 0, 0 }, |
2900 | 114 | 126 | ||
2901 | 115 | { ngx_string("geoip_region"), NULL, | 127 | { ngx_string("geoip_region"), NULL, |
2902 | @@ -124,6 +136,14 @@ | |||
2903 | 124 | ngx_http_geoip_city_variable, | 136 | ngx_http_geoip_city_variable, |
2904 | 125 | offsetof(GeoIPRecord, postal_code), 0, 0 }, | 137 | offsetof(GeoIPRecord, postal_code), 0, 0 }, |
2905 | 126 | 138 | ||
2906 | 139 | { ngx_string("geoip_latitude"), NULL, | ||
2907 | 140 | ngx_http_geoip_city_float_variable, | ||
2908 | 141 | offsetof(GeoIPRecord, latitude), 0, 0 }, | ||
2909 | 142 | |||
2910 | 143 | { ngx_string("geoip_longitude"), NULL, | ||
2911 | 144 | ngx_http_geoip_city_float_variable, | ||
2912 | 145 | offsetof(GeoIPRecord, longitude), 0, 0 }, | ||
2913 | 146 | |||
2914 | 127 | { ngx_null_string, NULL, NULL, 0, 0, 0 } | 147 | { ngx_null_string, NULL, NULL, 0, 0, 0 } |
2915 | 128 | }; | 148 | }; |
2916 | 129 | 149 | ||
2917 | @@ -179,34 +199,16 @@ | |||
2918 | 179 | ngx_http_geoip_city_variable(ngx_http_request_t *r, | 199 | ngx_http_geoip_city_variable(ngx_http_request_t *r, |
2919 | 180 | ngx_http_variable_value_t *v, uintptr_t data) | 200 | ngx_http_variable_value_t *v, uintptr_t data) |
2920 | 181 | { | 201 | { |
2943 | 182 | u_long addr; | 202 | char *val; |
2944 | 183 | char *val; | 203 | size_t len; |
2945 | 184 | size_t len; | 204 | GeoIPRecord *gr; |
2946 | 185 | GeoIPRecord *gr; | 205 | |
2947 | 186 | struct sockaddr_in *sin; | 206 | gr = ngx_http_geoip_get_city_record(r); |
2926 | 187 | ngx_http_geoip_conf_t *gcf; | ||
2927 | 188 | |||
2928 | 189 | gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); | ||
2929 | 190 | |||
2930 | 191 | if (gcf->city == NULL) { | ||
2931 | 192 | goto not_found; | ||
2932 | 193 | } | ||
2933 | 194 | |||
2934 | 195 | if (r->connection->sockaddr->sa_family != AF_INET) { | ||
2935 | 196 | goto not_found; | ||
2936 | 197 | } | ||
2937 | 198 | |||
2938 | 199 | sin = (struct sockaddr_in *) r->connection->sockaddr; | ||
2939 | 200 | addr = ntohl(sin->sin_addr.s_addr); | ||
2940 | 201 | |||
2941 | 202 | gr = GeoIP_record_by_ipnum(gcf->city, addr); | ||
2942 | 203 | |||
2948 | 204 | if (gr == NULL) { | 207 | if (gr == NULL) { |
2949 | 205 | goto not_found; | 208 | goto not_found; |
2950 | 206 | } | 209 | } |
2951 | 207 | 210 | ||
2952 | 208 | val = *(char **) ((char *) gr + data); | 211 | val = *(char **) ((char *) gr + data); |
2953 | 209 | |||
2954 | 210 | if (val == NULL) { | 212 | if (val == NULL) { |
2955 | 211 | goto no_value; | 213 | goto no_value; |
2956 | 212 | } | 214 | } |
2957 | @@ -243,6 +245,56 @@ | |||
2958 | 243 | 245 | ||
2959 | 244 | 246 | ||
2960 | 245 | static ngx_int_t | 247 | static ngx_int_t |
2961 | 248 | ngx_http_geoip_city_float_variable(ngx_http_request_t *r, | ||
2962 | 249 | ngx_http_variable_value_t *v, uintptr_t data) | ||
2963 | 250 | { | ||
2964 | 251 | float val; | ||
2965 | 252 | GeoIPRecord *gr; | ||
2966 | 253 | |||
2967 | 254 | gr = ngx_http_geoip_get_city_record(r); | ||
2968 | 255 | if (gr == NULL) { | ||
2969 | 256 | v->not_found = 1; | ||
2970 | 257 | return NGX_OK; | ||
2971 | 258 | } | ||
2972 | 259 | |||
2973 | 260 | v->data = ngx_pnalloc(r->pool, NGX_INT64_LEN + 5); | ||
2974 | 261 | if (v->data == NULL) { | ||
2975 | 262 | GeoIPRecord_delete(gr); | ||
2976 | 263 | return NGX_ERROR; | ||
2977 | 264 | } | ||
2978 | 265 | |||
2979 | 266 | val = *(float *) ((char *) gr + data); | ||
2980 | 267 | |||
2981 | 268 | v->len = ngx_sprintf(v->data, "%.4f", val) - v->data; | ||
2982 | 269 | |||
2983 | 270 | GeoIPRecord_delete(gr); | ||
2984 | 271 | |||
2985 | 272 | return NGX_OK; | ||
2986 | 273 | } | ||
2987 | 274 | |||
2988 | 275 | |||
2989 | 276 | static GeoIPRecord * | ||
2990 | 277 | ngx_http_geoip_get_city_record(ngx_http_request_t *r) | ||
2991 | 278 | { | ||
2992 | 279 | u_long addr; | ||
2993 | 280 | struct sockaddr_in *sin; | ||
2994 | 281 | ngx_http_geoip_conf_t *gcf; | ||
2995 | 282 | |||
2996 | 283 | gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module); | ||
2997 | 284 | |||
2998 | 285 | if (gcf->city && r->connection->sockaddr->sa_family == AF_INET) { | ||
2999 | 286 | |||
3000 | 287 | sin = (struct sockaddr_in *) r->connection->sockaddr; | ||
3001 | 288 | addr = ntohl(sin->sin_addr.s_addr); | ||
3002 | 289 | |||
3003 | 290 | return GeoIP_record_by_ipnum(gcf->city, addr); | ||
3004 | 291 | } | ||
3005 | 292 | |||
3006 | 293 | return NULL; | ||
3007 | 294 | } | ||
3008 | 295 | |||
3009 | 296 | |||
3010 | 297 | static ngx_int_t | ||
3011 | 246 | ngx_http_geoip_add_variables(ngx_conf_t *cf) | 298 | ngx_http_geoip_add_variables(ngx_conf_t *cf) |
3012 | 247 | { | 299 | { |
3013 | 248 | ngx_http_variable_t *var, *v; | 300 | ngx_http_variable_t *var, *v; |
3014 | 249 | 301 | ||
3015 | === modified file 'src/http/modules/ngx_http_gzip_static_module.c' | |||
3016 | --- src/http/modules/ngx_http_gzip_static_module.c 2010-03-03 23:50:36 +0000 | |||
3017 | +++ src/http/modules/ngx_http_gzip_static_module.c 2010-07-21 11:15:58 +0000 | |||
3018 | @@ -89,10 +89,6 @@ | |||
3019 | 89 | return NGX_DECLINED; | 89 | return NGX_DECLINED; |
3020 | 90 | } | 90 | } |
3021 | 91 | 91 | ||
3022 | 92 | if (r->zero_in_uri) { | ||
3023 | 93 | return NGX_DECLINED; | ||
3024 | 94 | } | ||
3025 | 95 | |||
3026 | 96 | gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module); | 92 | gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module); |
3027 | 97 | 93 | ||
3028 | 98 | if (!gzcf->enable) { | 94 | if (!gzcf->enable) { |
3029 | @@ -179,7 +175,7 @@ | |||
3030 | 179 | #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ | 175 | #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ |
3031 | 180 | 176 | ||
3032 | 181 | if (!of.is_file) { | 177 | if (!of.is_file) { |
3034 | 182 | ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, | 178 | ngx_log_error(NGX_LOG_CRIT, log, 0, |
3035 | 183 | "\"%s\" is not a regular file", path.data); | 179 | "\"%s\" is not a regular file", path.data); |
3036 | 184 | 180 | ||
3037 | 185 | return NGX_HTTP_NOT_FOUND; | 181 | return NGX_HTTP_NOT_FOUND; |
3038 | 186 | 182 | ||
3039 | === modified file 'src/http/modules/ngx_http_image_filter_module.c' | |||
3040 | --- src/http/modules/ngx_http_image_filter_module.c 2009-11-30 13:34:00 +0000 | |||
3041 | +++ src/http/modules/ngx_http_image_filter_module.c 2010-07-21 11:15:58 +0000 | |||
3042 | @@ -63,6 +63,7 @@ | |||
3043 | 63 | 63 | ||
3044 | 64 | ngx_uint_t phase; | 64 | ngx_uint_t phase; |
3045 | 65 | ngx_uint_t type; | 65 | ngx_uint_t type; |
3046 | 66 | ngx_uint_t force; | ||
3047 | 66 | } ngx_http_image_filter_ctx_t; | 67 | } ngx_http_image_filter_ctx_t; |
3048 | 67 | 68 | ||
3049 | 68 | 69 | ||
3050 | @@ -501,7 +502,8 @@ | |||
3051 | 501 | 502 | ||
3052 | 502 | if (rc == NGX_OK | 503 | if (rc == NGX_OK |
3053 | 503 | && ctx->width <= ctx->max_width | 504 | && ctx->width <= ctx->max_width |
3055 | 504 | && ctx->height <= ctx->max_height) | 505 | && ctx->height <= ctx->max_height |
3056 | 506 | && !ctx->force) | ||
3057 | 505 | { | 507 | { |
3058 | 506 | return ngx_http_image_asis(r, ctx); | 508 | return ngx_http_image_asis(r, ctx); |
3059 | 507 | } | 509 | } |
3060 | @@ -601,6 +603,7 @@ | |||
3061 | 601 | ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx) | 603 | ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx) |
3062 | 602 | { | 604 | { |
3063 | 603 | u_char *p, *last; | 605 | u_char *p, *last; |
3064 | 606 | size_t len, app; | ||
3065 | 604 | ngx_uint_t width, height; | 607 | ngx_uint_t width, height; |
3066 | 605 | 608 | ||
3067 | 606 | p = ctx->image; | 609 | p = ctx->image; |
3068 | @@ -611,26 +614,38 @@ | |||
3069 | 611 | 614 | ||
3070 | 612 | p += 2; | 615 | p += 2; |
3071 | 613 | last = ctx->image + ctx->length - 10; | 616 | last = ctx->image + ctx->length - 10; |
3072 | 617 | width = 0; | ||
3073 | 618 | height = 0; | ||
3074 | 619 | app = 0; | ||
3075 | 614 | 620 | ||
3076 | 615 | while (p < last) { | 621 | while (p < last) { |
3077 | 616 | 622 | ||
3078 | 617 | if (p[0] == 0xff && p[1] != 0xff) { | 623 | if (p[0] == 0xff && p[1] != 0xff) { |
3079 | 618 | 624 | ||
3080 | 619 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 625 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
3082 | 620 | "JPEG: %02xd %02xd", *p, *(p + 1)); | 626 | "JPEG: %02xd %02xd", p[0], p[1]); |
3083 | 621 | 627 | ||
3084 | 622 | p++; | 628 | p++; |
3085 | 623 | 629 | ||
3088 | 624 | if (*p == 0xc0 || *p == 0xc1 || *p == 0xc2 || *p == 0xc3 | 630 | if ((*p == 0xc0 || *p == 0xc1 || *p == 0xc2 || *p == 0xc3 |
3089 | 625 | || *p == 0xc9 || *p == 0xca || *p == 0xcb) | 631 | || *p == 0xc9 || *p == 0xca || *p == 0xcb) |
3090 | 632 | && (width == 0 || height == 0)) | ||
3091 | 626 | { | 633 | { |
3093 | 627 | goto found; | 634 | width = p[6] * 256 + p[7]; |
3094 | 635 | height = p[4] * 256 + p[5]; | ||
3095 | 628 | } | 636 | } |
3096 | 629 | 637 | ||
3097 | 630 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 638 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
3098 | 631 | "JPEG: %02xd %02xd", p[1], p[2]); | 639 | "JPEG: %02xd %02xd", p[1], p[2]); |
3099 | 632 | 640 | ||
3101 | 633 | p += p[1] * 256 + p[2]; | 641 | len = p[1] * 256 + p[2]; |
3102 | 642 | |||
3103 | 643 | if (*p >= 0xe1 && *p <= 0xef) { | ||
3104 | 644 | /* application data, e.g., EXIF, Adobe XMP, etc. */ | ||
3105 | 645 | app += len; | ||
3106 | 646 | } | ||
3107 | 647 | |||
3108 | 648 | p += len; | ||
3109 | 634 | 649 | ||
3110 | 635 | continue; | 650 | continue; |
3111 | 636 | } | 651 | } |
3112 | @@ -638,12 +653,16 @@ | |||
3113 | 638 | p++; | 653 | p++; |
3114 | 639 | } | 654 | } |
3115 | 640 | 655 | ||
3122 | 641 | return NGX_DECLINED; | 656 | if (width == 0 || height == 0) { |
3123 | 642 | 657 | return NGX_DECLINED; | |
3124 | 643 | found: | 658 | } |
3125 | 644 | 659 | ||
3126 | 645 | width = p[6] * 256 + p[7]; | 660 | if (ctx->length / 20 < app) { |
3127 | 646 | height = p[4] * 256 + p[5]; | 661 | /* force conversion if application data consume more than 5% */ |
3128 | 662 | ctx->force = 1; | ||
3129 | 663 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | ||
3130 | 664 | "app data size: %uz", app); | ||
3131 | 665 | } | ||
3132 | 647 | 666 | ||
3133 | 648 | break; | 667 | break; |
3134 | 649 | 668 | ||
3135 | @@ -708,7 +727,8 @@ | |||
3136 | 708 | 727 | ||
3137 | 709 | conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module); | 728 | conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module); |
3138 | 710 | 729 | ||
3140 | 711 | if ((ngx_uint_t) sx <= ctx->max_width | 730 | if (!ctx->force |
3141 | 731 | && (ngx_uint_t) sx <= ctx->max_width | ||
3142 | 712 | && (ngx_uint_t) sy <= ctx->max_height) | 732 | && (ngx_uint_t) sy <= ctx->max_height) |
3143 | 713 | { | 733 | { |
3144 | 714 | gdImageDestroy(src); | 734 | gdImageDestroy(src); |
3145 | 715 | 735 | ||
3146 | === modified file 'src/http/modules/ngx_http_index_module.c' | |||
3147 | --- src/http/modules/ngx_http_index_module.c 2010-03-03 23:50:36 +0000 | |||
3148 | +++ src/http/modules/ngx_http_index_module.c 2010-07-21 11:15:58 +0000 | |||
3149 | @@ -116,10 +116,6 @@ | |||
3150 | 116 | return NGX_DECLINED; | 116 | return NGX_DECLINED; |
3151 | 117 | } | 117 | } |
3152 | 118 | 118 | ||
3153 | 119 | if (r->zero_in_uri) { | ||
3154 | 120 | return NGX_DECLINED; | ||
3155 | 121 | } | ||
3156 | 122 | |||
3157 | 123 | ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module); | 119 | ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module); |
3158 | 124 | clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 120 | clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
3159 | 125 | 121 | ||
3160 | 126 | 122 | ||
3161 | === modified file 'src/http/modules/ngx_http_memcached_module.c' | |||
3162 | --- src/http/modules/ngx_http_memcached_module.c 2009-11-30 13:34:00 +0000 | |||
3163 | +++ src/http/modules/ngx_http_memcached_module.c 2010-07-21 11:15:58 +0000 | |||
3164 | @@ -423,15 +423,20 @@ | |||
3165 | 423 | 423 | ||
3166 | 424 | if (ngx_strncmp(b->last, | 424 | if (ngx_strncmp(b->last, |
3167 | 425 | ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest, | 425 | ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest, |
3169 | 426 | ctx->rest) | 426 | bytes) |
3170 | 427 | != 0) | 427 | != 0) |
3171 | 428 | { | 428 | { |
3172 | 429 | ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, | 429 | ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0, |
3173 | 430 | "memcached sent invalid trailer"); | 430 | "memcached sent invalid trailer"); |
3174 | 431 | |||
3175 | 432 | u->length = 0; | ||
3176 | 433 | ctx->rest = 0; | ||
3177 | 434 | |||
3178 | 435 | return NGX_OK; | ||
3179 | 431 | } | 436 | } |
3180 | 432 | 437 | ||
3183 | 433 | u->length = 0; | 438 | u->length -= bytes; |
3184 | 434 | ctx->rest = 0; | 439 | ctx->rest -= bytes; |
3185 | 435 | 440 | ||
3186 | 436 | return NGX_OK; | 441 | return NGX_OK; |
3187 | 437 | } | 442 | } |
3188 | 438 | 443 | ||
3189 | === modified file 'src/http/modules/ngx_http_proxy_module.c' | |||
3190 | --- src/http/modules/ngx_http_proxy_module.c 2010-03-03 23:50:36 +0000 | |||
3191 | +++ src/http/modules/ngx_http_proxy_module.c 2010-07-21 11:15:58 +0000 | |||
3192 | @@ -357,6 +357,13 @@ | |||
3193 | 357 | 0, | 357 | 0, |
3194 | 358 | &ngx_http_proxy_module }, | 358 | &ngx_http_proxy_module }, |
3195 | 359 | 359 | ||
3196 | 360 | { ngx_string("proxy_no_cache"), | ||
3197 | 361 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | ||
3198 | 362 | ngx_http_no_cache_set_slot, | ||
3199 | 363 | NGX_HTTP_LOC_CONF_OFFSET, | ||
3200 | 364 | offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache), | ||
3201 | 365 | NULL }, | ||
3202 | 366 | |||
3203 | 360 | { ngx_string("proxy_cache_valid"), | 367 | { ngx_string("proxy_cache_valid"), |
3204 | 361 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | 368 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
3205 | 362 | ngx_http_file_cache_valid_set_slot, | 369 | ngx_http_file_cache_valid_set_slot, |
3206 | @@ -630,6 +637,7 @@ | |||
3207 | 630 | u->process_header = ngx_http_proxy_process_status_line; | 637 | u->process_header = ngx_http_proxy_process_status_line; |
3208 | 631 | u->abort_request = ngx_http_proxy_abort_request; | 638 | u->abort_request = ngx_http_proxy_abort_request; |
3209 | 632 | u->finalize_request = ngx_http_proxy_finalize_request; | 639 | u->finalize_request = ngx_http_proxy_finalize_request; |
3210 | 640 | r->state = 0; | ||
3211 | 633 | 641 | ||
3212 | 634 | if (plcf->redirects) { | 642 | if (plcf->redirects) { |
3213 | 635 | u->rewrite_redirect = ngx_http_proxy_rewrite_redirect; | 643 | u->rewrite_redirect = ngx_http_proxy_rewrite_redirect; |
3214 | @@ -1191,6 +1199,7 @@ | |||
3215 | 1191 | ctx->status_end = NULL; | 1199 | ctx->status_end = NULL; |
3216 | 1192 | 1200 | ||
3217 | 1193 | r->upstream->process_header = ngx_http_proxy_process_status_line; | 1201 | r->upstream->process_header = ngx_http_proxy_process_status_line; |
3218 | 1202 | r->state = 0; | ||
3219 | 1194 | 1203 | ||
3220 | 1195 | return NGX_OK; | 1204 | return NGX_OK; |
3221 | 1196 | } | 1205 | } |
3222 | @@ -1906,7 +1915,7 @@ | |||
3223 | 1906 | * conf->body_set_len = NULL; | 1915 | * conf->body_set_len = NULL; |
3224 | 1907 | * conf->body_set = NULL; | 1916 | * conf->body_set = NULL; |
3225 | 1908 | * conf->body_source = { 0, NULL }; | 1917 | * conf->body_source = { 0, NULL }; |
3227 | 1909 | * conf->rewrite_locations = NULL; | 1918 | * conf->redirects = NULL; |
3228 | 1910 | */ | 1919 | */ |
3229 | 1911 | 1920 | ||
3230 | 1912 | conf->upstream.store = NGX_CONF_UNSET; | 1921 | conf->upstream.store = NGX_CONF_UNSET; |
3231 | @@ -1931,6 +1940,7 @@ | |||
3232 | 1931 | #if (NGX_HTTP_CACHE) | 1940 | #if (NGX_HTTP_CACHE) |
3233 | 1932 | conf->upstream.cache = NGX_CONF_UNSET_PTR; | 1941 | conf->upstream.cache = NGX_CONF_UNSET_PTR; |
3234 | 1933 | conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; | 1942 | conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; |
3235 | 1943 | conf->upstream.no_cache = NGX_CONF_UNSET_PTR; | ||
3236 | 1934 | conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; | 1944 | conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; |
3237 | 1935 | #endif | 1945 | #endif |
3238 | 1936 | 1946 | ||
3239 | @@ -2155,6 +2165,9 @@ | |||
3240 | 2155 | |NGX_HTTP_UPSTREAM_FT_OFF; | 2165 | |NGX_HTTP_UPSTREAM_FT_OFF; |
3241 | 2156 | } | 2166 | } |
3242 | 2157 | 2167 | ||
3243 | 2168 | ngx_conf_merge_ptr_value(conf->upstream.no_cache, | ||
3244 | 2169 | prev->upstream.no_cache, NULL); | ||
3245 | 2170 | |||
3246 | 2158 | ngx_conf_merge_ptr_value(conf->upstream.cache_valid, | 2171 | ngx_conf_merge_ptr_value(conf->upstream.cache_valid, |
3247 | 2159 | prev->upstream.cache_valid, NULL); | 2172 | prev->upstream.cache_valid, NULL); |
3248 | 2160 | 2173 | ||
3249 | @@ -2747,9 +2760,16 @@ | |||
3250 | 2747 | } | 2760 | } |
3251 | 2748 | 2761 | ||
3252 | 2749 | if (ngx_strcmp(value[1].data, "default") == 0) { | 2762 | if (ngx_strcmp(value[1].data, "default") == 0) { |
3253 | 2763 | if (plcf->proxy_lengths) { | ||
3254 | 2764 | ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | ||
3255 | 2765 | "\"proxy_redirect default\" may not be used " | ||
3256 | 2766 | "with \"proxy_pass\" directive with variables"); | ||
3257 | 2767 | return NGX_CONF_ERROR; | ||
3258 | 2768 | } | ||
3259 | 2769 | |||
3260 | 2750 | if (plcf->url.data == NULL) { | 2770 | if (plcf->url.data == NULL) { |
3261 | 2751 | ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 2771 | ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
3263 | 2752 | "\"proxy_rewrite_location default\" must go " | 2772 | "\"proxy_redirect default\" must go " |
3264 | 2753 | "after the \"proxy_pass\" directive"); | 2773 | "after the \"proxy_pass\" directive"); |
3265 | 2754 | return NGX_CONF_ERROR; | 2774 | return NGX_CONF_ERROR; |
3266 | 2755 | } | 2775 | } |
3267 | 2756 | 2776 | ||
3268 | === modified file 'src/http/modules/ngx_http_random_index_module.c' | |||
3269 | --- src/http/modules/ngx_http_random_index_module.c 2010-03-03 23:50:36 +0000 | |||
3270 | +++ src/http/modules/ngx_http_random_index_module.c 2010-07-21 11:15:58 +0000 | |||
3271 | @@ -86,10 +86,6 @@ | |||
3272 | 86 | return NGX_DECLINED; | 86 | return NGX_DECLINED; |
3273 | 87 | } | 87 | } |
3274 | 88 | 88 | ||
3275 | 89 | if (r->zero_in_uri) { | ||
3276 | 90 | return NGX_DECLINED; | ||
3277 | 91 | } | ||
3278 | 92 | |||
3279 | 93 | if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) { | 89 | if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) { |
3280 | 94 | return NGX_DECLINED; | 90 | return NGX_DECLINED; |
3281 | 95 | } | 91 | } |
3282 | 96 | 92 | ||
3283 | === modified file 'src/http/modules/ngx_http_referer_module.c' | |||
3284 | --- src/http/modules/ngx_http_referer_module.c 2009-11-27 11:10:18 +0000 | |||
3285 | +++ src/http/modules/ngx_http_referer_module.c 2010-07-21 11:15:58 +0000 | |||
3286 | @@ -124,18 +124,27 @@ | |||
3287 | 124 | len = r->headers_in.referer->value.len; | 124 | len = r->headers_in.referer->value.len; |
3288 | 125 | ref = r->headers_in.referer->value.data; | 125 | ref = r->headers_in.referer->value.data; |
3289 | 126 | 126 | ||
3295 | 127 | if (len < sizeof("http://i.ru") - 1 | 127 | if (len >= sizeof("http://i.ru") - 1) { |
3296 | 128 | || (ngx_strncasecmp(ref, (u_char *) "http://", 7) != 0)) | 128 | last = ref + len; |
3297 | 129 | { | 129 | |
3298 | 130 | if (rlcf->blocked_referer) { | 130 | if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) { |
3299 | 131 | goto valid; | 131 | ref += 7; |
3300 | 132 | goto valid_scheme; | ||
3301 | 133 | |||
3302 | 134 | } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) { | ||
3303 | 135 | ref += 8; | ||
3304 | 136 | goto valid_scheme; | ||
3305 | 132 | } | 137 | } |
3312 | 133 | 138 | } | |
3313 | 134 | goto invalid; | 139 | |
3314 | 135 | } | 140 | if (rlcf->blocked_referer) { |
3315 | 136 | 141 | goto valid; | |
3316 | 137 | last = ref + len; | 142 | } |
3317 | 138 | ref += 7; | 143 | |
3318 | 144 | goto invalid; | ||
3319 | 145 | |||
3320 | 146 | valid_scheme: | ||
3321 | 147 | |||
3322 | 139 | i = 0; | 148 | i = 0; |
3323 | 140 | key = 0; | 149 | key = 0; |
3324 | 141 | 150 | ||
3325 | 142 | 151 | ||
3326 | === modified file 'src/http/modules/ngx_http_rewrite_module.c' | |||
3327 | --- src/http/modules/ngx_http_rewrite_module.c 2009-11-30 13:34:00 +0000 | |||
3328 | +++ src/http/modules/ngx_http_rewrite_module.c 2010-07-21 11:15:58 +0000 | |||
3329 | @@ -340,13 +340,10 @@ | |||
3330 | 340 | 340 | ||
3331 | 341 | last = 0; | 341 | last = 0; |
3332 | 342 | 342 | ||
3340 | 343 | if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0) { | 343 | if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0 |
3341 | 344 | regex->status = NGX_HTTP_MOVED_TEMPORARILY; | 344 | || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0 |
3342 | 345 | regex->redirect = 1; | 345 | || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0) |
3343 | 346 | last = 1; | 346 | { |
3337 | 347 | } | ||
3338 | 348 | |||
3339 | 349 | if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) { | ||
3344 | 350 | regex->status = NGX_HTTP_MOVED_TEMPORARILY; | 347 | regex->status = NGX_HTTP_MOVED_TEMPORARILY; |
3345 | 351 | regex->redirect = 1; | 348 | regex->redirect = 1; |
3346 | 352 | last = 1; | 349 | last = 1; |
3347 | 353 | 350 | ||
3348 | === modified file 'src/http/modules/ngx_http_ssi_filter_module.c' | |||
3349 | --- src/http/modules/ngx_http_ssi_filter_module.c 2009-11-30 13:34:00 +0000 | |||
3350 | +++ src/http/modules/ngx_http_ssi_filter_module.c 2010-07-21 11:15:58 +0000 | |||
3351 | @@ -14,7 +14,6 @@ | |||
3352 | 14 | 14 | ||
3353 | 15 | #define NGX_HTTP_SSI_ADD_PREFIX 1 | 15 | #define NGX_HTTP_SSI_ADD_PREFIX 1 |
3354 | 16 | #define NGX_HTTP_SSI_ADD_ZERO 2 | 16 | #define NGX_HTTP_SSI_ADD_ZERO 2 |
3355 | 17 | #define NGX_HTTP_SSI_EXPR_TEST 4 | ||
3356 | 18 | 17 | ||
3357 | 19 | 18 | ||
3358 | 20 | typedef struct { | 19 | typedef struct { |
3359 | @@ -1701,8 +1700,7 @@ | |||
3360 | 1701 | val = ngx_http_ssi_get_variable(r, &var, key); | 1700 | val = ngx_http_ssi_get_variable(r, &var, key); |
3361 | 1702 | 1701 | ||
3362 | 1703 | if (val == NULL) { | 1702 | if (val == NULL) { |
3365 | 1704 | vv = ngx_http_get_variable(r, &var, key, | 1703 | vv = ngx_http_get_variable(r, &var, key); |
3364 | 1705 | flags & NGX_HTTP_SSI_EXPR_TEST); | ||
3366 | 1706 | if (vv == NULL) { | 1704 | if (vv == NULL) { |
3367 | 1707 | return NGX_ERROR; | 1705 | return NGX_ERROR; |
3368 | 1708 | } | 1706 | } |
3369 | @@ -2061,9 +2059,9 @@ | |||
3370 | 2061 | out = data; | 2059 | out = data; |
3371 | 2062 | 2060 | ||
3372 | 2063 | if (!r->header_sent) { | 2061 | if (!r->header_sent) { |
3376 | 2064 | if (ngx_http_set_content_type(r) != NGX_OK) { | 2062 | r->headers_out.content_type_len = |
3377 | 2065 | return NGX_ERROR; | 2063 | r->parent->headers_out.content_type_len; |
3378 | 2066 | } | 2064 | r->headers_out.content_type = r->parent->headers_out.content_type; |
3379 | 2067 | 2065 | ||
3380 | 2068 | if (ngx_http_send_header(r) == NGX_ERROR) { | 2066 | if (ngx_http_send_header(r) == NGX_ERROR) { |
3381 | 2069 | return NGX_ERROR; | 2067 | return NGX_ERROR; |
3382 | @@ -2110,7 +2108,7 @@ | |||
3383 | 2110 | value = ngx_http_ssi_get_variable(r, var, key); | 2108 | value = ngx_http_ssi_get_variable(r, var, key); |
3384 | 2111 | 2109 | ||
3385 | 2112 | if (value == NULL) { | 2110 | if (value == NULL) { |
3387 | 2113 | vv = ngx_http_get_variable(r, var, key, 1); | 2111 | vv = ngx_http_get_variable(r, var, key); |
3388 | 2114 | 2112 | ||
3389 | 2115 | if (vv == NULL) { | 2113 | if (vv == NULL) { |
3390 | 2116 | return NGX_HTTP_SSI_ERROR; | 2114 | return NGX_HTTP_SSI_ERROR; |
3391 | @@ -2161,11 +2159,10 @@ | |||
3392 | 2161 | } | 2159 | } |
3393 | 2162 | } | 2160 | } |
3394 | 2163 | 2161 | ||
3395 | 2162 | p = value->data; | ||
3396 | 2163 | |||
3397 | 2164 | switch (ctx->encoding) { | 2164 | switch (ctx->encoding) { |
3398 | 2165 | 2165 | ||
3399 | 2166 | case NGX_HTTP_SSI_NO_ENCODING: | ||
3400 | 2167 | break; | ||
3401 | 2168 | |||
3402 | 2169 | case NGX_HTTP_SSI_URL_ENCODING: | 2166 | case NGX_HTTP_SSI_URL_ENCODING: |
3403 | 2170 | len = 2 * ngx_escape_uri(NULL, value->data, value->len, | 2167 | len = 2 * ngx_escape_uri(NULL, value->data, value->len, |
3404 | 2171 | NGX_ESCAPE_HTML); | 2168 | NGX_ESCAPE_HTML); |
3405 | @@ -2177,11 +2174,9 @@ | |||
3406 | 2177 | } | 2174 | } |
3407 | 2178 | 2175 | ||
3408 | 2179 | (void) ngx_escape_uri(p, value->data, value->len, NGX_ESCAPE_HTML); | 2176 | (void) ngx_escape_uri(p, value->data, value->len, NGX_ESCAPE_HTML); |
3409 | 2180 | |||
3410 | 2181 | value->len += len; | ||
3411 | 2182 | value->data = p; | ||
3412 | 2183 | } | 2177 | } |
3413 | 2184 | 2178 | ||
3414 | 2179 | len += value->len; | ||
3415 | 2185 | break; | 2180 | break; |
3416 | 2186 | 2181 | ||
3417 | 2187 | case NGX_HTTP_SSI_ENTITY_ENCODING: | 2182 | case NGX_HTTP_SSI_ENTITY_ENCODING: |
3418 | @@ -2194,11 +2189,13 @@ | |||
3419 | 2194 | } | 2189 | } |
3420 | 2195 | 2190 | ||
3421 | 2196 | (void) ngx_escape_html(p, value->data, value->len); | 2191 | (void) ngx_escape_html(p, value->data, value->len); |
3422 | 2197 | |||
3423 | 2198 | value->len += len; | ||
3424 | 2199 | value->data = p; | ||
3425 | 2200 | } | 2192 | } |
3426 | 2201 | 2193 | ||
3427 | 2194 | len += value->len; | ||
3428 | 2195 | break; | ||
3429 | 2196 | |||
3430 | 2197 | default: /* NGX_HTTP_SSI_NO_ENCODING */ | ||
3431 | 2198 | len = value->len; | ||
3432 | 2202 | break; | 2199 | break; |
3433 | 2203 | } | 2200 | } |
3434 | 2204 | 2201 | ||
3435 | @@ -2213,8 +2210,8 @@ | |||
3436 | 2213 | } | 2210 | } |
3437 | 2214 | 2211 | ||
3438 | 2215 | b->memory = 1; | 2212 | b->memory = 1; |
3441 | 2216 | b->pos = value->data; | 2213 | b->pos = p; |
3442 | 2217 | b->last = value->data + value->len; | 2214 | b->last = p + len; |
3443 | 2218 | 2215 | ||
3444 | 2219 | cl->buf = b; | 2216 | cl->buf = b; |
3445 | 2220 | cl->next = NULL; | 2217 | cl->next = NULL; |
3446 | @@ -2362,7 +2359,7 @@ | |||
3447 | 2362 | p++; | 2359 | p++; |
3448 | 2363 | } | 2360 | } |
3449 | 2364 | 2361 | ||
3451 | 2365 | flags = (p == last) ? NGX_HTTP_SSI_EXPR_TEST : 0; | 2362 | flags = 0; |
3452 | 2366 | 2363 | ||
3453 | 2367 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 2364 | ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
3454 | 2368 | "left: \"%V\"", &left); | 2365 | "left: \"%V\"", &left); |
3455 | @@ -2614,8 +2611,7 @@ | |||
3456 | 2614 | return NGX_ERROR; | 2611 | return NGX_ERROR; |
3457 | 2615 | } | 2612 | } |
3458 | 2616 | 2613 | ||
3461 | 2617 | v->len = ngx_sprintf(v->data, "%T", tp->sec + (gmt ? 0 : tp->gmtoff)) | 2614 | v->len = ngx_sprintf(v->data, "%T", tp->sec) - v->data; |
3460 | 2618 | - v->data; | ||
3462 | 2619 | 2615 | ||
3463 | 2620 | return NGX_OK; | 2616 | return NGX_OK; |
3464 | 2621 | } | 2617 | } |
3465 | 2622 | 2618 | ||
3466 | === modified file 'src/http/modules/ngx_http_static_module.c' | |||
3467 | --- src/http/modules/ngx_http_static_module.c 2009-10-19 23:22:06 +0000 | |||
3468 | +++ src/http/modules/ngx_http_static_module.c 2010-07-21 11:15:58 +0000 | |||
3469 | @@ -66,10 +66,6 @@ | |||
3470 | 66 | return NGX_DECLINED; | 66 | return NGX_DECLINED; |
3471 | 67 | } | 67 | } |
3472 | 68 | 68 | ||
3473 | 69 | if (r->zero_in_uri) { | ||
3474 | 70 | return NGX_DECLINED; | ||
3475 | 71 | } | ||
3476 | 72 | |||
3477 | 73 | log = r->connection->log; | 69 | log = r->connection->log; |
3478 | 74 | 70 | ||
3479 | 75 | /* | 71 | /* |
3480 | @@ -188,7 +184,7 @@ | |||
3481 | 188 | #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ | 184 | #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ |
3482 | 189 | 185 | ||
3483 | 190 | if (!of.is_file) { | 186 | if (!of.is_file) { |
3485 | 191 | ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, | 187 | ngx_log_error(NGX_LOG_CRIT, log, 0, |
3486 | 192 | "\"%s\" is not a regular file", path.data); | 188 | "\"%s\" is not a regular file", path.data); |
3487 | 193 | 189 | ||
3488 | 194 | return NGX_HTTP_NOT_FOUND; | 190 | return NGX_HTTP_NOT_FOUND; |
3489 | 195 | 191 | ||
3490 | === modified file 'src/http/modules/ngx_http_userid_filter_module.c' | |||
3491 | --- src/http/modules/ngx_http_userid_filter_module.c 2009-11-30 13:34:00 +0000 | |||
3492 | +++ src/http/modules/ngx_http_userid_filter_module.c 2010-07-21 11:15:58 +0000 | |||
3493 | @@ -545,7 +545,7 @@ | |||
3494 | 545 | { | 545 | { |
3495 | 546 | ngx_http_variable_t *var; | 546 | ngx_http_variable_t *var; |
3496 | 547 | 547 | ||
3498 | 548 | var = ngx_http_add_variable(cf, &ngx_http_userid_got, NGX_HTTP_VAR_NOHASH); | 548 | var = ngx_http_add_variable(cf, &ngx_http_userid_got, 0); |
3499 | 549 | if (var == NULL) { | 549 | if (var == NULL) { |
3500 | 550 | return NGX_ERROR; | 550 | return NGX_ERROR; |
3501 | 551 | } | 551 | } |
3502 | 552 | 552 | ||
3503 | === modified file 'src/http/modules/perl/nginx.pm' | |||
3504 | --- src/http/modules/perl/nginx.pm 2010-03-03 23:50:36 +0000 | |||
3505 | +++ src/http/modules/perl/nginx.pm 2010-07-21 11:15:58 +0000 | |||
3506 | @@ -47,7 +47,7 @@ | |||
3507 | 47 | HTTP_INSUFFICIENT_STORAGE | 47 | HTTP_INSUFFICIENT_STORAGE |
3508 | 48 | ); | 48 | ); |
3509 | 49 | 49 | ||
3511 | 50 | our $VERSION = '0.7.65'; | 50 | our $VERSION = '0.7.67'; |
3512 | 51 | 51 | ||
3513 | 52 | require XSLoader; | 52 | require XSLoader; |
3514 | 53 | XSLoader::load('nginx', $VERSION); | 53 | XSLoader::load('nginx', $VERSION); |
3515 | 54 | 54 | ||
3516 | === modified file 'src/http/modules/perl/nginx.xs' | |||
3517 | --- src/http/modules/perl/nginx.xs 2009-10-19 23:22:06 +0000 | |||
3518 | +++ src/http/modules/perl/nginx.xs 2010-07-21 11:15:58 +0000 | |||
3519 | @@ -847,7 +847,7 @@ | |||
3520 | 847 | 847 | ||
3521 | 848 | #endif | 848 | #endif |
3522 | 849 | 849 | ||
3524 | 850 | vv = ngx_http_get_variable(r, &var, hash, 1); | 850 | vv = ngx_http_get_variable(r, &var, hash); |
3525 | 851 | if (vv == NULL) { | 851 | if (vv == NULL) { |
3526 | 852 | XSRETURN_UNDEF; | 852 | XSRETURN_UNDEF; |
3527 | 853 | } | 853 | } |
3528 | @@ -901,9 +901,6 @@ | |||
3529 | 901 | XSRETURN_UNDEF; | 901 | XSRETURN_UNDEF; |
3530 | 902 | } | 902 | } |
3531 | 903 | 903 | ||
3532 | 904 | ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | ||
3533 | 905 | "variable \"%V\" not found", &var); | ||
3534 | 906 | |||
3535 | 907 | XSRETURN_UNDEF; | 904 | XSRETURN_UNDEF; |
3536 | 908 | } | 905 | } |
3537 | 909 | 906 | ||
3538 | 910 | 907 | ||
3539 | === modified file 'src/http/modules/perl/ngx_http_perl_module.c' | |||
3540 | --- src/http/modules/perl/ngx_http_perl_module.c 2010-03-03 23:50:36 +0000 | |||
3541 | +++ src/http/modules/perl/ngx_http_perl_module.c 2010-07-21 11:15:58 +0000 | |||
3542 | @@ -30,12 +30,6 @@ | |||
3543 | 30 | } ngx_http_perl_variable_t; | 30 | } ngx_http_perl_variable_t; |
3544 | 31 | 31 | ||
3545 | 32 | 32 | ||
3546 | 33 | typedef struct { | ||
3547 | 34 | SV *sv; | ||
3548 | 35 | PerlInterpreter *perl; | ||
3549 | 36 | } ngx_http_perl_cleanup_t; | ||
3550 | 37 | |||
3551 | 38 | |||
3552 | 39 | #if (NGX_HTTP_SSI) | 33 | #if (NGX_HTTP_SSI) |
3553 | 40 | static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r, | 34 | static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r, |
3554 | 41 | ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params); | 35 | ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params); |
3555 | @@ -174,10 +168,6 @@ | |||
3556 | 174 | static ngx_int_t | 168 | static ngx_int_t |
3557 | 175 | ngx_http_perl_handler(ngx_http_request_t *r) | 169 | ngx_http_perl_handler(ngx_http_request_t *r) |
3558 | 176 | { | 170 | { |
3559 | 177 | if (r->zero_in_uri) { | ||
3560 | 178 | return NGX_HTTP_NOT_FOUND; | ||
3561 | 179 | } | ||
3562 | 180 | |||
3563 | 181 | ngx_http_perl_handle_request(r); | 171 | ngx_http_perl_handle_request(r); |
3564 | 182 | 172 | ||
3565 | 183 | return NGX_DONE; | 173 | return NGX_DONE; |
3566 | 184 | 174 | ||
3567 | === modified file 'src/http/ngx_http_cache.h' | |||
3568 | --- src/http/ngx_http_cache.h 2009-11-30 13:34:00 +0000 | |||
3569 | +++ src/http/ngx_http_cache.h 2010-07-21 11:15:58 +0000 | |||
3570 | @@ -133,6 +133,11 @@ | |||
3571 | 133 | char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, | 133 | char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, |
3572 | 134 | void *conf); | 134 | void *conf); |
3573 | 135 | 135 | ||
3574 | 136 | ngx_int_t ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache); | ||
3575 | 137 | char *ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, | ||
3576 | 138 | void *conf); | ||
3577 | 139 | |||
3578 | 140 | |||
3579 | 136 | extern ngx_str_t ngx_http_cache_status[]; | 141 | extern ngx_str_t ngx_http_cache_status[]; |
3580 | 137 | 142 | ||
3581 | 138 | 143 | ||
3582 | 139 | 144 | ||
3583 | === modified file 'src/http/ngx_http_copy_filter_module.c' | |||
3584 | --- src/http/ngx_http_copy_filter_module.c 2009-10-19 23:22:06 +0000 | |||
3585 | +++ src/http/ngx_http_copy_filter_module.c 2010-07-21 11:15:58 +0000 | |||
3586 | @@ -104,7 +104,9 @@ | |||
3587 | 104 | ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; | 104 | ctx->output_filter = (ngx_output_chain_filter_pt) ngx_http_next_filter; |
3588 | 105 | ctx->filter_ctx = r; | 105 | ctx->filter_ctx = r; |
3589 | 106 | 106 | ||
3591 | 107 | r->request_output = 1; | 107 | if (in && in->buf && ngx_buf_size(in->buf)) { |
3592 | 108 | r->request_output = 1; | ||
3593 | 109 | } | ||
3594 | 108 | } | 110 | } |
3595 | 109 | 111 | ||
3596 | 110 | rc = ngx_output_chain(ctx, in); | 112 | rc = ngx_output_chain(ctx, in); |
3597 | 111 | 113 | ||
3598 | === modified file 'src/http/ngx_http_core_module.c' | |||
3599 | --- src/http/ngx_http_core_module.c 2010-03-03 23:50:36 +0000 | |||
3600 | +++ src/http/ngx_http_core_module.c 2010-07-21 11:15:58 +0000 | |||
3601 | @@ -560,6 +560,13 @@ | |||
3602 | 560 | offsetof(ngx_http_core_loc_conf_t, if_modified_since), | 560 | offsetof(ngx_http_core_loc_conf_t, if_modified_since), |
3603 | 561 | &ngx_http_core_if_modified_since }, | 561 | &ngx_http_core_if_modified_since }, |
3604 | 562 | 562 | ||
3605 | 563 | { ngx_string("chunked_transfer_encoding"), | ||
3606 | 564 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, | ||
3607 | 565 | ngx_conf_set_flag_slot, | ||
3608 | 566 | NGX_HTTP_LOC_CONF_OFFSET, | ||
3609 | 567 | offsetof(ngx_http_core_loc_conf_t, chunked_transfer_encoding), | ||
3610 | 568 | NULL }, | ||
3611 | 569 | |||
3612 | 563 | { ngx_string("error_page"), | 570 | { ngx_string("error_page"), |
3613 | 564 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF | 571 | NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF |
3614 | 565 | |NGX_CONF_2MORE, | 572 | |NGX_CONF_2MORE, |
3615 | @@ -744,14 +751,24 @@ | |||
3616 | 744 | break; | 751 | break; |
3617 | 745 | } | 752 | } |
3618 | 746 | 753 | ||
3627 | 747 | if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) { | 754 | if (r->keepalive) { |
3628 | 748 | 755 | ||
3629 | 749 | /* | 756 | if (r->headers_in.msie6) { |
3630 | 750 | * MSIE may wait for some time if an response for | 757 | if (r->method == NGX_HTTP_POST) { |
3631 | 751 | * a POST request was sent over a keepalive connection | 758 | /* |
3632 | 752 | */ | 759 | * MSIE may wait for some time if an response for |
3633 | 753 | 760 | * a POST request was sent over a keepalive connection | |
3634 | 754 | r->keepalive = 0; | 761 | */ |
3635 | 762 | r->keepalive = 0; | ||
3636 | 763 | } | ||
3637 | 764 | |||
3638 | 765 | } else if (r->headers_in.safari) { | ||
3639 | 766 | /* | ||
3640 | 767 | * Safari may send a POST request to a closed keepalive | ||
3641 | 768 | * connection and stalls for some time | ||
3642 | 769 | */ | ||
3643 | 770 | r->keepalive = 0; | ||
3644 | 771 | } | ||
3645 | 755 | } | 772 | } |
3646 | 756 | 773 | ||
3647 | 757 | if (r->headers_in.content_length_n > 0) { | 774 | if (r->headers_in.content_length_n > 0) { |
3648 | @@ -1288,7 +1305,7 @@ | |||
3649 | 1288 | 1305 | ||
3650 | 1289 | /* no content handler was found */ | 1306 | /* no content handler was found */ |
3651 | 1290 | 1307 | ||
3653 | 1291 | if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) { | 1308 | if (r->uri.data[r->uri.len - 1] == '/') { |
3654 | 1292 | 1309 | ||
3655 | 1293 | if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) { | 1310 | if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) { |
3656 | 1294 | ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | 1311 | ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
3657 | @@ -2076,7 +2093,6 @@ | |||
3658 | 2076 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, | 2093 | ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, |
3659 | 2077 | "http subrequest \"%V?%V\"", uri, &sr->args); | 2094 | "http subrequest \"%V?%V\"", uri, &sr->args); |
3660 | 2078 | 2095 | ||
3661 | 2079 | sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0; | ||
3662 | 2080 | sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0; | 2096 | sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0; |
3663 | 2081 | sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0; | 2097 | sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0; |
3664 | 2082 | 2098 | ||
3665 | @@ -2944,6 +2960,7 @@ | |||
3666 | 2944 | lcf->log_subrequest = NGX_CONF_UNSET; | 2960 | lcf->log_subrequest = NGX_CONF_UNSET; |
3667 | 2945 | lcf->recursive_error_pages = NGX_CONF_UNSET; | 2961 | lcf->recursive_error_pages = NGX_CONF_UNSET; |
3668 | 2946 | lcf->server_tokens = NGX_CONF_UNSET; | 2962 | lcf->server_tokens = NGX_CONF_UNSET; |
3669 | 2963 | lcf->chunked_transfer_encoding = NGX_CONF_UNSET; | ||
3670 | 2947 | lcf->types_hash_max_size = NGX_CONF_UNSET_UINT; | 2964 | lcf->types_hash_max_size = NGX_CONF_UNSET_UINT; |
3671 | 2948 | lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT; | 2965 | lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT; |
3672 | 2949 | 2966 | ||
3673 | @@ -3181,6 +3198,8 @@ | |||
3674 | 3181 | ngx_conf_merge_value(conf->recursive_error_pages, | 3198 | ngx_conf_merge_value(conf->recursive_error_pages, |
3675 | 3182 | prev->recursive_error_pages, 0); | 3199 | prev->recursive_error_pages, 0); |
3676 | 3183 | ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1); | 3200 | ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1); |
3677 | 3201 | ngx_conf_merge_value(conf->chunked_transfer_encoding, | ||
3678 | 3202 | prev->chunked_transfer_encoding, 1); | ||
3679 | 3184 | 3203 | ||
3680 | 3185 | ngx_conf_merge_ptr_value(conf->open_file_cache, | 3204 | ngx_conf_merge_ptr_value(conf->open_file_cache, |
3681 | 3186 | prev->open_file_cache, NULL); | 3205 | prev->open_file_cache, NULL); |
3682 | 3187 | 3206 | ||
3683 | === modified file 'src/http/ngx_http_core_module.h' | |||
3684 | --- src/http/ngx_http_core_module.h 2009-11-30 13:34:00 +0000 | |||
3685 | +++ src/http/ngx_http_core_module.h 2010-07-21 11:15:58 +0000 | |||
3686 | @@ -358,6 +358,7 @@ | |||
3687 | 358 | ngx_flag_t log_subrequest; /* log_subrequest */ | 358 | ngx_flag_t log_subrequest; /* log_subrequest */ |
3688 | 359 | ngx_flag_t recursive_error_pages; /* recursive_error_pages */ | 359 | ngx_flag_t recursive_error_pages; /* recursive_error_pages */ |
3689 | 360 | ngx_flag_t server_tokens; /* server_tokens */ | 360 | ngx_flag_t server_tokens; /* server_tokens */ |
3690 | 361 | ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */ | ||
3691 | 361 | 362 | ||
3692 | 362 | #if (NGX_HTTP_GZIP) | 363 | #if (NGX_HTTP_GZIP) |
3693 | 363 | ngx_flag_t gzip_vary; /* gzip_vary */ | 364 | ngx_flag_t gzip_vary; /* gzip_vary */ |
3694 | 364 | 365 | ||
3695 | === modified file 'src/http/ngx_http_file_cache.c' | |||
3696 | --- src/http/ngx_http_file_cache.c 2010-03-03 23:50:36 +0000 | |||
3697 | +++ src/http/ngx_http_file_cache.c 2010-07-21 11:15:58 +0000 | |||
3698 | @@ -1128,7 +1128,7 @@ | |||
3699 | 1128 | 1128 | ||
3700 | 1129 | if (cache->files++ > 100) { | 1129 | if (cache->files++ > 100) { |
3701 | 1130 | 1130 | ||
3703 | 1131 | ngx_time_update(0, 0); | 1131 | ngx_time_update(); |
3704 | 1132 | 1132 | ||
3705 | 1133 | elapsed = ngx_abs((ngx_msec_int_t) (ngx_current_msec - cache->last)); | 1133 | elapsed = ngx_abs((ngx_msec_int_t) (ngx_current_msec - cache->last)); |
3706 | 1134 | 1134 | ||
3707 | @@ -1145,7 +1145,7 @@ | |||
3708 | 1145 | 1145 | ||
3709 | 1146 | ngx_msleep(200); | 1146 | ngx_msleep(200); |
3710 | 1147 | 1147 | ||
3712 | 1148 | ngx_time_update(0, 0); | 1148 | ngx_time_update(); |
3713 | 1149 | } | 1149 | } |
3714 | 1150 | 1150 | ||
3715 | 1151 | cache->last = ngx_current_msec; | 1151 | cache->last = ngx_current_msec; |
3716 | @@ -1604,3 +1604,69 @@ | |||
3717 | 1604 | 1604 | ||
3718 | 1605 | return NGX_CONF_OK; | 1605 | return NGX_CONF_OK; |
3719 | 1606 | } | 1606 | } |
3720 | 1607 | |||
3721 | 1608 | |||
3722 | 1609 | ngx_int_t | ||
3723 | 1610 | ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache) | ||
3724 | 1611 | { | ||
3725 | 1612 | ngx_str_t val; | ||
3726 | 1613 | ngx_uint_t i; | ||
3727 | 1614 | ngx_http_complex_value_t *cv; | ||
3728 | 1615 | |||
3729 | 1616 | cv = no_cache->elts; | ||
3730 | 1617 | |||
3731 | 1618 | for (i = 0; i < no_cache->nelts; i++) { | ||
3732 | 1619 | if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) { | ||
3733 | 1620 | return NGX_ERROR; | ||
3734 | 1621 | } | ||
3735 | 1622 | |||
3736 | 1623 | if (val.len && val.data[0] != '0') { | ||
3737 | 1624 | return NGX_DECLINED; | ||
3738 | 1625 | } | ||
3739 | 1626 | } | ||
3740 | 1627 | |||
3741 | 1628 | return NGX_OK; | ||
3742 | 1629 | } | ||
3743 | 1630 | |||
3744 | 1631 | |||
3745 | 1632 | char * | ||
3746 | 1633 | ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | ||
3747 | 1634 | { | ||
3748 | 1635 | char *p = conf; | ||
3749 | 1636 | |||
3750 | 1637 | ngx_str_t *value; | ||
3751 | 1638 | ngx_uint_t i; | ||
3752 | 1639 | ngx_array_t **a; | ||
3753 | 1640 | ngx_http_complex_value_t *cv; | ||
3754 | 1641 | ngx_http_compile_complex_value_t ccv; | ||
3755 | 1642 | |||
3756 | 1643 | a = (ngx_array_t **) (p + cmd->offset); | ||
3757 | 1644 | |||
3758 | 1645 | if (*a == NGX_CONF_UNSET_PTR) { | ||
3759 | 1646 | *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t)); | ||
3760 | 1647 | if (*a == NULL) { | ||
3761 | 1648 | return NGX_CONF_ERROR; | ||
3762 | 1649 | } | ||
3763 | 1650 | } | ||
3764 | 1651 | |||
3765 | 1652 | value = cf->args->elts; | ||
3766 | 1653 | |||
3767 | 1654 | for (i = 1; i < cf->args->nelts; i++) { | ||
3768 | 1655 | cv = ngx_array_push(*a); | ||
3769 | 1656 | if (cv == NULL) { | ||
3770 | 1657 | return NGX_CONF_ERROR; | ||
3771 | 1658 | } | ||
3772 | 1659 | |||
3773 | 1660 | ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t)); | ||
3774 | 1661 | |||
3775 | 1662 | ccv.cf = cf; | ||
3776 | 1663 | ccv.value = &value[i]; | ||
3777 | 1664 | ccv.complex_value = cv; | ||
3778 | 1665 | |||
3779 | 1666 | if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | ||
3780 | 1667 | return NGX_CONF_ERROR; | ||
3781 | 1668 | } | ||
3782 | 1669 | } | ||
3783 | 1670 | |||
3784 | 1671 | return NGX_CONF_OK; | ||
3785 | 1672 | } | ||
3786 | 1607 | 1673 | ||
3787 | === modified file 'src/http/ngx_http_header_filter_module.c' | |||
3788 | --- src/http/ngx_http_header_filter_module.c 2010-03-03 23:50:36 +0000 | |||
3789 | +++ src/http/ngx_http_header_filter_module.c 2010-07-21 11:15:58 +0000 | |||
3790 | @@ -538,8 +538,8 @@ | |||
3791 | 538 | 538 | ||
3792 | 539 | r->headers_out.location->value.len = b->last - p; | 539 | r->headers_out.location->value.len = b->last - p; |
3793 | 540 | r->headers_out.location->value.data = p; | 540 | r->headers_out.location->value.data = p; |
3796 | 541 | r->headers_out.location->key.len = sizeof("Location: ") - 1; | 541 | r->headers_out.location->key.len = sizeof("Location") - 1; |
3797 | 542 | r->headers_out.location->key.data = (u_char *) "Location: "; | 542 | r->headers_out.location->key.data = (u_char *) "Location"; |
3798 | 543 | 543 | ||
3799 | 544 | *b->last++ = CR; *b->last++ = LF; | 544 | *b->last++ = CR; *b->last++ = LF; |
3800 | 545 | } | 545 | } |
3801 | 546 | 546 | ||
3802 | === modified file 'src/http/ngx_http_parse.c' | |||
3803 | --- src/http/ngx_http_parse.c 2009-11-30 13:34:00 +0000 | |||
3804 | +++ src/http/ngx_http_parse.c 2010-07-21 11:15:58 +0000 | |||
3805 | @@ -438,8 +438,7 @@ | |||
3806 | 438 | r->plus_in_uri = 1; | 438 | r->plus_in_uri = 1; |
3807 | 439 | break; | 439 | break; |
3808 | 440 | case '\0': | 440 | case '\0': |
3811 | 441 | r->zero_in_uri = 1; | 441 | return NGX_HTTP_PARSE_INVALID_REQUEST; |
3810 | 442 | break; | ||
3812 | 443 | default: | 442 | default: |
3813 | 444 | state = sw_check_uri; | 443 | state = sw_check_uri; |
3814 | 445 | break; | 444 | break; |
3815 | @@ -496,8 +495,7 @@ | |||
3816 | 496 | r->plus_in_uri = 1; | 495 | r->plus_in_uri = 1; |
3817 | 497 | break; | 496 | break; |
3818 | 498 | case '\0': | 497 | case '\0': |
3821 | 499 | r->zero_in_uri = 1; | 498 | return NGX_HTTP_PARSE_INVALID_REQUEST; |
3820 | 500 | break; | ||
3822 | 501 | } | 499 | } |
3823 | 502 | break; | 500 | break; |
3824 | 503 | 501 | ||
3825 | @@ -526,8 +524,7 @@ | |||
3826 | 526 | r->complex_uri = 1; | 524 | r->complex_uri = 1; |
3827 | 527 | break; | 525 | break; |
3828 | 528 | case '\0': | 526 | case '\0': |
3831 | 529 | r->zero_in_uri = 1; | 527 | return NGX_HTTP_PARSE_INVALID_REQUEST; |
3830 | 530 | break; | ||
3832 | 531 | } | 528 | } |
3833 | 532 | break; | 529 | break; |
3834 | 533 | 530 | ||
3835 | @@ -1202,7 +1199,7 @@ | |||
3836 | 1202 | ch = *p++; | 1199 | ch = *p++; |
3837 | 1203 | 1200 | ||
3838 | 1204 | } else if (ch == '\0') { | 1201 | } else if (ch == '\0') { |
3840 | 1205 | r->zero_in_uri = 1; | 1202 | return NGX_HTTP_PARSE_INVALID_REQUEST; |
3841 | 1206 | } | 1203 | } |
3842 | 1207 | 1204 | ||
3843 | 1208 | state = quoted_state; | 1205 | state = quoted_state; |
3844 | @@ -1304,8 +1301,7 @@ | |||
3845 | 1304 | } | 1301 | } |
3846 | 1305 | 1302 | ||
3847 | 1306 | if (ch == '\0') { | 1303 | if (ch == '\0') { |
3850 | 1307 | *flags |= NGX_HTTP_ZERO_IN_URI; | 1304 | goto unsafe; |
3849 | 1308 | continue; | ||
3851 | 1309 | } | 1305 | } |
3852 | 1310 | 1306 | ||
3853 | 1311 | if (ngx_path_separator(ch) && len > 2) { | 1307 | if (ngx_path_separator(ch) && len > 2) { |
3854 | @@ -1449,34 +1445,19 @@ | |||
3855 | 1449 | void | 1445 | void |
3856 | 1450 | ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args) | 1446 | ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args) |
3857 | 1451 | { | 1447 | { |
3887 | 1452 | u_char ch, *p, *last; | 1448 | u_char *p, *last; |
3888 | 1453 | 1449 | ||
3889 | 1454 | p = uri->data; | 1450 | last = uri->data + uri->len; |
3890 | 1455 | 1451 | ||
3891 | 1456 | last = p + uri->len; | 1452 | p = ngx_strlchr(uri->data, last, '?'); |
3892 | 1457 | 1453 | ||
3893 | 1458 | args->len = 0; | 1454 | if (p) { |
3894 | 1459 | 1455 | uri->len = p - uri->data; | |
3895 | 1460 | while (p < last) { | 1456 | p++; |
3896 | 1461 | 1457 | args->len = last - p; | |
3897 | 1462 | ch = *p++; | 1458 | args->data = p; |
3898 | 1463 | 1459 | ||
3899 | 1464 | if (ch == '?') { | 1460 | } else { |
3900 | 1465 | args->len = last - p; | 1461 | args->len = 0; |
3872 | 1466 | args->data = p; | ||
3873 | 1467 | |||
3874 | 1468 | uri->len = p - 1 - uri->data; | ||
3875 | 1469 | |||
3876 | 1470 | if (ngx_strlchr(p, last, '\0') != NULL) { | ||
3877 | 1471 | r->zero_in_uri = 1; | ||
3878 | 1472 | } | ||
3879 | 1473 | |||
3880 | 1474 | return; | ||
3881 | 1475 | } | ||
3882 | 1476 | |||
3883 | 1477 | if (ch == '\0') { | ||
3884 | 1478 | r->zero_in_uri = 1; | ||
3885 | 1479 | continue; | ||
3886 | 1480 | } | ||
3901 | 1481 | } | 1462 | } |
3902 | 1482 | } | 1463 | } |
3903 | 1483 | 1464 | ||
3904 | === modified file 'src/http/ngx_http_request.c' | |||
3905 | --- src/http/ngx_http_request.c 2010-03-03 23:50:36 +0000 | |||
3906 | +++ src/http/ngx_http_request.c 2010-07-21 11:15:58 +0000 | |||
3907 | @@ -784,16 +784,31 @@ | |||
3908 | 784 | 784 | ||
3909 | 785 | p = r->uri.data + r->uri.len - 1; | 785 | p = r->uri.data + r->uri.len - 1; |
3910 | 786 | 786 | ||
3917 | 787 | if (*p == '.' || *p == ' ') { | 787 | while (p > r->uri.data) { |
3918 | 788 | 788 | ||
3919 | 789 | while (--p > r->uri.data && (*p == '.' || *p == ' ')) { | 789 | if (*p == ' ') { |
3920 | 790 | /* void */ | 790 | p--; |
3921 | 791 | } | 791 | continue; |
3922 | 792 | 792 | } | |
3923 | 793 | |||
3924 | 794 | if (*p == '.') { | ||
3925 | 795 | p--; | ||
3926 | 796 | continue; | ||
3927 | 797 | } | ||
3928 | 798 | |||
3929 | 799 | if (ngx_strncasecmp(p - 6, (u_char *) "::$data", 7) == 0) { | ||
3930 | 800 | p -= 7; | ||
3931 | 801 | continue; | ||
3932 | 802 | } | ||
3933 | 803 | |||
3934 | 804 | break; | ||
3935 | 805 | } | ||
3936 | 806 | |||
3937 | 807 | if (p != r->uri.data + r->uri.len - 1) { | ||
3938 | 793 | r->uri.len = p + 1 - r->uri.data; | 808 | r->uri.len = p + 1 - r->uri.data; |
3939 | 794 | |||
3940 | 795 | ngx_http_set_exten(r); | 809 | ngx_http_set_exten(r); |
3941 | 796 | } | 810 | } |
3942 | 811 | |||
3943 | 797 | } | 812 | } |
3944 | 798 | #endif | 813 | #endif |
3945 | 799 | 814 | ||
3946 | @@ -1443,6 +1458,12 @@ | |||
3947 | 1443 | if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { | 1458 | if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) { |
3948 | 1444 | r->headers_in.gecko = 1; | 1459 | r->headers_in.gecko = 1; |
3949 | 1445 | 1460 | ||
3950 | 1461 | } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) { | ||
3951 | 1462 | r->headers_in.chrome = 1; | ||
3952 | 1463 | |||
3953 | 1464 | } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) { | ||
3954 | 1465 | r->headers_in.safari = 1; | ||
3955 | 1466 | |||
3956 | 1446 | } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { | 1467 | } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) { |
3957 | 1447 | r->headers_in.konqueror = 1; | 1468 | r->headers_in.konqueror = 1; |
3958 | 1448 | } | 1469 | } |
3959 | 1449 | 1470 | ||
3960 | === modified file 'src/http/ngx_http_request.h' | |||
3961 | --- src/http/ngx_http_request.h 2010-03-03 23:50:36 +0000 | |||
3962 | +++ src/http/ngx_http_request.h 2010-07-21 11:15:58 +0000 | |||
3963 | @@ -57,7 +57,7 @@ | |||
3964 | 57 | #define NGX_HTTP_PARSE_INVALID_HEADER 13 | 57 | #define NGX_HTTP_PARSE_INVALID_HEADER 13 |
3965 | 58 | 58 | ||
3966 | 59 | 59 | ||
3968 | 60 | #define NGX_HTTP_ZERO_IN_URI 1 | 60 | /* unused 1 */ |
3969 | 61 | #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 | 61 | #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 |
3970 | 62 | #define NGX_HTTP_SUBREQUEST_WAITED 4 | 62 | #define NGX_HTTP_SUBREQUEST_WAITED 4 |
3971 | 63 | #define NGX_HTTP_LOG_UNSAFE 8 | 63 | #define NGX_HTTP_LOG_UNSAFE 8 |
3972 | @@ -220,6 +220,8 @@ | |||
3973 | 220 | unsigned msie6:1; | 220 | unsigned msie6:1; |
3974 | 221 | unsigned opera:1; | 221 | unsigned opera:1; |
3975 | 222 | unsigned gecko:1; | 222 | unsigned gecko:1; |
3976 | 223 | unsigned chrome:1; | ||
3977 | 224 | unsigned safari:1; | ||
3978 | 223 | unsigned konqueror:1; | 225 | unsigned konqueror:1; |
3979 | 224 | } ngx_http_headers_in_t; | 226 | } ngx_http_headers_in_t; |
3980 | 225 | 227 | ||
3981 | @@ -428,9 +430,6 @@ | |||
3982 | 428 | /* URI with "+" */ | 430 | /* URI with "+" */ |
3983 | 429 | unsigned plus_in_uri:1; | 431 | unsigned plus_in_uri:1; |
3984 | 430 | 432 | ||
3985 | 431 | /* URI with "\0" or "%00" */ | ||
3986 | 432 | unsigned zero_in_uri:1; | ||
3987 | 433 | |||
3988 | 434 | unsigned invalid_header:1; | 433 | unsigned invalid_header:1; |
3989 | 435 | 434 | ||
3990 | 436 | unsigned valid_location:1; | 435 | unsigned valid_location:1; |
3991 | 437 | 436 | ||
3992 | === modified file 'src/http/ngx_http_special_response.c' | |||
3993 | --- src/http/ngx_http_special_response.c 2009-10-19 23:22:06 +0000 | |||
3994 | +++ src/http/ngx_http_special_response.c 2010-07-21 11:15:58 +0000 | |||
3995 | @@ -31,13 +31,13 @@ | |||
3996 | 31 | ; | 31 | ; |
3997 | 32 | 32 | ||
3998 | 33 | 33 | ||
4006 | 34 | static u_char ngx_http_msie_stub[] = | 34 | static u_char ngx_http_msie_padding[] = |
4007 | 35 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 35 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4008 | 36 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 36 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4009 | 37 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 37 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4010 | 38 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 38 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4011 | 39 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 39 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4012 | 40 | "<!-- The padding to disable MSIE's friendly error page -->" CRLF | 40 | "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF |
4013 | 41 | ; | 41 | ; |
4014 | 42 | 42 | ||
4015 | 43 | 43 | ||
4016 | @@ -517,8 +517,6 @@ | |||
4017 | 517 | 517 | ||
4018 | 518 | r->err_status = overwrite; | 518 | r->err_status = overwrite; |
4019 | 519 | 519 | ||
4020 | 520 | r->zero_in_uri = 0; | ||
4021 | 521 | |||
4022 | 522 | if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { | 520 | if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { |
4023 | 523 | return NGX_ERROR; | 521 | return NGX_ERROR; |
4024 | 524 | } | 522 | } |
4025 | @@ -598,12 +596,12 @@ | |||
4026 | 598 | r->headers_out.content_length_n = ngx_http_error_pages[err].len | 596 | r->headers_out.content_length_n = ngx_http_error_pages[err].len |
4027 | 599 | + len; | 597 | + len; |
4028 | 600 | if (clcf->msie_padding | 598 | if (clcf->msie_padding |
4030 | 601 | && r->headers_in.msie | 599 | && (r->headers_in.msie || r->headers_in.chrome) |
4031 | 602 | && r->http_version >= NGX_HTTP_VERSION_10 | 600 | && r->http_version >= NGX_HTTP_VERSION_10 |
4032 | 603 | && err >= NGX_HTTP_LEVEL_300) | 601 | && err >= NGX_HTTP_LEVEL_300) |
4033 | 604 | { | 602 | { |
4034 | 605 | r->headers_out.content_length_n += | 603 | r->headers_out.content_length_n += |
4036 | 606 | sizeof(ngx_http_msie_stub) - 1; | 604 | sizeof(ngx_http_msie_padding) - 1; |
4037 | 607 | msie_padding = 1; | 605 | msie_padding = 1; |
4038 | 608 | } | 606 | } |
4039 | 609 | 607 | ||
4040 | @@ -671,8 +669,8 @@ | |||
4041 | 671 | } | 669 | } |
4042 | 672 | 670 | ||
4043 | 673 | b->memory = 1; | 671 | b->memory = 1; |
4046 | 674 | b->pos = ngx_http_msie_stub; | 672 | b->pos = ngx_http_msie_padding; |
4047 | 675 | b->last = ngx_http_msie_stub + sizeof(ngx_http_msie_stub) - 1; | 673 | b->last = ngx_http_msie_padding + sizeof(ngx_http_msie_padding) - 1; |
4048 | 676 | 674 | ||
4049 | 677 | out[1].next = &out[2]; | 675 | out[1].next = &out[2]; |
4050 | 678 | out[2].buf = b; | 676 | out[2].buf = b; |
4051 | 679 | 677 | ||
4052 | === modified file 'src/http/ngx_http_upstream.c' | |||
4053 | --- src/http/ngx_http_upstream.c 2010-03-03 23:50:36 +0000 | |||
4054 | +++ src/http/ngx_http_upstream.c 2010-07-21 11:15:58 +0000 | |||
4055 | @@ -363,8 +363,6 @@ | |||
4056 | 363 | 363 | ||
4057 | 364 | if (u && u->cleanup) { | 364 | if (u && u->cleanup) { |
4058 | 365 | ngx_http_upstream_cleanup(r); | 365 | ngx_http_upstream_cleanup(r); |
4059 | 366 | *u->cleanup = NULL; | ||
4060 | 367 | u->cleanup = NULL; | ||
4061 | 368 | } | 366 | } |
4062 | 369 | 367 | ||
4063 | 370 | u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); | 368 | u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t)); |
4064 | @@ -587,6 +585,13 @@ | |||
4065 | 587 | ngx_int_t rc; | 585 | ngx_int_t rc; |
4066 | 588 | ngx_http_cache_t *c; | 586 | ngx_http_cache_t *c; |
4067 | 589 | 587 | ||
4068 | 588 | if (u->conf->no_cache) { | ||
4069 | 589 | rc = ngx_http_cache(r, u->conf->no_cache); | ||
4070 | 590 | if (rc != NGX_OK) { | ||
4071 | 591 | return rc; | ||
4072 | 592 | } | ||
4073 | 593 | } | ||
4074 | 594 | |||
4075 | 590 | if (!(r->method & u->conf->cache_methods)) { | 595 | if (!(r->method & u->conf->cache_methods)) { |
4076 | 591 | return NGX_DECLINED; | 596 | return NGX_DECLINED; |
4077 | 592 | } | 597 | } |
4078 | @@ -1775,10 +1780,6 @@ | |||
4079 | 1775 | return NGX_DONE; | 1780 | return NGX_DONE; |
4080 | 1776 | } | 1781 | } |
4081 | 1777 | 1782 | ||
4082 | 1778 | if (flags & NGX_HTTP_ZERO_IN_URI) { | ||
4083 | 1779 | r->zero_in_uri = 1; | ||
4084 | 1780 | } | ||
4085 | 1781 | |||
4086 | 1782 | if (r->method != NGX_HTTP_HEAD) { | 1783 | if (r->method != NGX_HTTP_HEAD) { |
4087 | 1783 | r->method = NGX_HTTP_GET; | 1784 | r->method = NGX_HTTP_GET; |
4088 | 1784 | } | 1785 | } |
4089 | @@ -3004,16 +3005,18 @@ | |||
4090 | 3004 | return NGX_OK; | 3005 | return NGX_OK; |
4091 | 3005 | } | 3006 | } |
4092 | 3006 | 3007 | ||
4094 | 3007 | last = h->value.data + h->value.len; | 3008 | p = h->value.data; |
4095 | 3009 | last = p + h->value.len; | ||
4096 | 3008 | 3010 | ||
4099 | 3009 | if (ngx_strlcasestrn(h->value.data, last, (u_char *) "no-cache", 8 - 1) | 3011 | if (ngx_strlcasestrn(p, last, (u_char *) "no-cache", 8 - 1) != NULL |
4100 | 3010 | != NULL) | 3012 | || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL |
4101 | 3013 | || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL) | ||
4102 | 3011 | { | 3014 | { |
4103 | 3012 | u->cacheable = 0; | 3015 | u->cacheable = 0; |
4104 | 3013 | return NGX_OK; | 3016 | return NGX_OK; |
4105 | 3014 | } | 3017 | } |
4106 | 3015 | 3018 | ||
4108 | 3016 | p = ngx_strlcasestrn(h->value.data, last, (u_char *) "max-age=", 8 - 1); | 3019 | p = ngx_strlcasestrn(p, last, (u_char *) "max-age=", 8 - 1); |
4109 | 3017 | 3020 | ||
4110 | 3018 | if (p == NULL) { | 3021 | if (p == NULL) { |
4111 | 3019 | return NGX_OK; | 3022 | return NGX_OK; |
4112 | 3020 | 3023 | ||
4113 | === modified file 'src/http/ngx_http_upstream.h' | |||
4114 | --- src/http/ngx_http_upstream.h 2009-11-30 13:34:00 +0000 | |||
4115 | +++ src/http/ngx_http_upstream.h 2010-07-21 11:15:58 +0000 | |||
4116 | @@ -160,6 +160,7 @@ | |||
4117 | 160 | ngx_uint_t cache_methods; | 160 | ngx_uint_t cache_methods; |
4118 | 161 | 161 | ||
4119 | 162 | ngx_array_t *cache_valid; | 162 | ngx_array_t *cache_valid; |
4120 | 163 | ngx_array_t *no_cache; /* ngx_http_complex_value_t */ | ||
4121 | 163 | #endif | 164 | #endif |
4122 | 164 | 165 | ||
4123 | 165 | ngx_array_t *store_lengths; | 166 | ngx_array_t *store_lengths; |
4124 | 166 | 167 | ||
4125 | === modified file 'src/http/ngx_http_variables.c' | |||
4126 | --- src/http/ngx_http_variables.c 2010-03-03 23:50:36 +0000 | |||
4127 | +++ src/http/ngx_http_variables.c 2010-07-21 11:15:58 +0000 | |||
4128 | @@ -196,7 +196,8 @@ | |||
4129 | 196 | { ngx_string("server_name"), NULL, ngx_http_variable_server_name, 0, 0, 0 }, | 196 | { ngx_string("server_name"), NULL, ngx_http_variable_server_name, 0, 0, 0 }, |
4130 | 197 | 197 | ||
4131 | 198 | { ngx_string("request_method"), NULL, | 198 | { ngx_string("request_method"), NULL, |
4133 | 199 | ngx_http_variable_request_method, 0, 0, 0 }, | 199 | ngx_http_variable_request_method, 0, |
4134 | 200 | NGX_HTTP_VAR_NOCACHEABLE, 0 }, | ||
4135 | 200 | 201 | ||
4136 | 201 | { ngx_string("remote_user"), NULL, ngx_http_variable_remote_user, 0, 0, 0 }, | 202 | { ngx_string("remote_user"), NULL, ngx_http_variable_remote_user, 0, 0, 0 }, |
4137 | 202 | 203 | ||
4138 | @@ -440,8 +441,7 @@ | |||
4139 | 440 | 441 | ||
4140 | 441 | 442 | ||
4141 | 442 | ngx_http_variable_value_t * | 443 | ngx_http_variable_value_t * |
4144 | 443 | ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key, | 444 | ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key) |
4143 | 444 | ngx_uint_t nowarn) | ||
4145 | 445 | { | 445 | { |
4146 | 446 | ngx_http_variable_t *v; | 446 | ngx_http_variable_t *v; |
4147 | 447 | ngx_http_variable_value_t *vv; | 447 | ngx_http_variable_value_t *vv; |
4148 | @@ -453,7 +453,7 @@ | |||
4149 | 453 | 453 | ||
4150 | 454 | if (v) { | 454 | if (v) { |
4151 | 455 | if (v->flags & NGX_HTTP_VAR_INDEXED) { | 455 | if (v->flags & NGX_HTTP_VAR_INDEXED) { |
4153 | 456 | return ngx_http_get_indexed_variable(r, v->index); | 456 | return ngx_http_get_flushed_variable(r, v->index); |
4154 | 457 | 457 | ||
4155 | 458 | } else { | 458 | } else { |
4156 | 459 | 459 | ||
4157 | @@ -494,7 +494,7 @@ | |||
4158 | 494 | return NULL; | 494 | return NULL; |
4159 | 495 | } | 495 | } |
4160 | 496 | 496 | ||
4162 | 497 | if (ngx_strncmp(name->data, "upstream_http_", 10) == 0) { | 497 | if (ngx_strncmp(name->data, "upstream_http_", 14) == 0) { |
4163 | 498 | 498 | ||
4164 | 499 | if (ngx_http_upstream_header_variable(r, vv, (uintptr_t) name) | 499 | if (ngx_http_upstream_header_variable(r, vv, (uintptr_t) name) |
4165 | 500 | == NGX_OK) | 500 | == NGX_OK) |
4166 | @@ -525,11 +525,6 @@ | |||
4167 | 525 | 525 | ||
4168 | 526 | vv->not_found = 1; | 526 | vv->not_found = 1; |
4169 | 527 | 527 | ||
4170 | 528 | if (nowarn == 0) { | ||
4171 | 529 | ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | ||
4172 | 530 | "unknown \"%V\" variable", name); | ||
4173 | 531 | } | ||
4174 | 532 | |||
4175 | 533 | return vv; | 528 | return vv; |
4176 | 534 | } | 529 | } |
4177 | 535 | 530 | ||
4178 | @@ -1781,6 +1776,7 @@ | |||
4179 | 1781 | if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) { | 1776 | if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) { |
4180 | 1782 | v[i].get_handler = ngx_http_variable_argument; | 1777 | v[i].get_handler = ngx_http_variable_argument; |
4181 | 1783 | v[i].data = (uintptr_t) &v[i].name; | 1778 | v[i].data = (uintptr_t) &v[i].name; |
4182 | 1779 | v[i].flags = NGX_HTTP_VAR_NOCACHEABLE; | ||
4183 | 1784 | 1780 | ||
4184 | 1785 | continue; | 1781 | continue; |
4185 | 1786 | } | 1782 | } |
4186 | 1787 | 1783 | ||
4187 | === modified file 'src/http/ngx_http_variables.h' | |||
4188 | --- src/http/ngx_http_variables.h 2009-10-19 23:22:06 +0000 | |||
4189 | +++ src/http/ngx_http_variables.h 2010-07-21 11:15:58 +0000 | |||
4190 | @@ -50,7 +50,7 @@ | |||
4191 | 50 | ngx_uint_t index); | 50 | ngx_uint_t index); |
4192 | 51 | 51 | ||
4193 | 52 | ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r, | 52 | ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r, |
4195 | 53 | ngx_str_t *name, ngx_uint_t key, ngx_uint_t nowarn); | 53 | ngx_str_t *name, ngx_uint_t key); |
4196 | 54 | 54 | ||
4197 | 55 | ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, | 55 | ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, |
4198 | 56 | ngx_str_t *var, ngx_list_part_t *part, size_t prefix); | 56 | ngx_str_t *var, ngx_list_part_t *part, size_t prefix); |
4199 | 57 | 57 | ||
4200 | === modified file 'src/mail/ngx_mail_pop3_handler.c' | |||
4201 | --- src/mail/ngx_mail_pop3_handler.c 2009-10-19 23:22:06 +0000 | |||
4202 | +++ src/mail/ngx_mail_pop3_handler.c 2010-07-21 11:15:58 +0000 | |||
4203 | @@ -188,7 +188,6 @@ | |||
4204 | 188 | 188 | ||
4205 | 189 | default: | 189 | default: |
4206 | 190 | rc = NGX_MAIL_PARSE_INVALID_COMMAND; | 190 | rc = NGX_MAIL_PARSE_INVALID_COMMAND; |
4207 | 191 | s->mail_state = ngx_pop3_start; | ||
4208 | 192 | break; | 191 | break; |
4209 | 193 | } | 192 | } |
4210 | 194 | 193 | ||
4211 | @@ -215,7 +214,6 @@ | |||
4212 | 215 | 214 | ||
4213 | 216 | default: | 215 | default: |
4214 | 217 | rc = NGX_MAIL_PARSE_INVALID_COMMAND; | 216 | rc = NGX_MAIL_PARSE_INVALID_COMMAND; |
4215 | 218 | s->mail_state = ngx_pop3_start; | ||
4216 | 219 | break; | 217 | break; |
4217 | 220 | } | 218 | } |
4218 | 221 | 219 | ||
4219 | 222 | 220 | ||
4220 | === modified file 'src/mail/ngx_mail_proxy_module.c' | |||
4221 | --- src/mail/ngx_mail_proxy_module.c 2009-11-30 13:34:00 +0000 | |||
4222 | +++ src/mail/ngx_mail_proxy_module.c 2010-07-21 11:15:58 +0000 | |||
4223 | @@ -726,7 +726,7 @@ | |||
4224 | 726 | 726 | ||
4225 | 727 | b->last += n; | 727 | b->last += n; |
4226 | 728 | 728 | ||
4228 | 729 | if (b->last - b->pos < 5) { | 729 | if (b->last - b->pos < 4) { |
4229 | 730 | return NGX_AGAIN; | 730 | return NGX_AGAIN; |
4230 | 731 | } | 731 | } |
4231 | 732 | 732 | ||
4232 | 733 | 733 | ||
4233 | === modified file 'src/os/unix/ngx_errno.h' | |||
4234 | --- src/os/unix/ngx_errno.h 2009-11-30 13:34:00 +0000 | |||
4235 | +++ src/os/unix/ngx_errno.h 2010-07-21 11:15:58 +0000 | |||
4236 | @@ -64,10 +64,22 @@ | |||
4237 | 64 | 64 | ||
4238 | 65 | /* Solaris and Tru64 UNIX have thread-safe strerror() */ | 65 | /* Solaris and Tru64 UNIX have thread-safe strerror() */ |
4239 | 66 | 66 | ||
4241 | 67 | #define ngx_strerror_r(err, errstr, size) \ | 67 | #define ngx_strerror_r(err, errstr, size) \ |
4242 | 68 | ngx_cpystrn(errstr, (u_char *) strerror(err), size) | 68 | ngx_cpystrn(errstr, (u_char *) strerror(err), size) |
4243 | 69 | 69 | ||
4244 | 70 | #endif | 70 | #endif |
4245 | 71 | 71 | ||
4246 | 72 | 72 | ||
4247 | 73 | #if (NGX_HAVE_SYS_ERRLIST) | ||
4248 | 74 | |||
4249 | 75 | #define ngx_sigsafe_strerror(err) \ | ||
4250 | 76 | (err > 0 && err < sys_nerr) ? sys_errlist[err] : "Unknown error" | ||
4251 | 77 | |||
4252 | 78 | #else | ||
4253 | 79 | |||
4254 | 80 | #define ngx_sigsafe_strerror(err) "" | ||
4255 | 81 | |||
4256 | 82 | #endif | ||
4257 | 83 | |||
4258 | 84 | |||
4259 | 73 | #endif /* _NGX_ERRNO_H_INCLUDED_ */ | 85 | #endif /* _NGX_ERRNO_H_INCLUDED_ */ |
4260 | 74 | 86 | ||
4261 | === modified file 'src/os/unix/ngx_files.h' | |||
4262 | --- src/os/unix/ngx_files.h 2010-03-03 23:50:36 +0000 | |||
4263 | +++ src/os/unix/ngx_files.h 2010-07-21 11:15:58 +0000 | |||
4264 | @@ -64,6 +64,7 @@ | |||
4265 | 64 | #define NGX_FILE_OPEN 0 | 64 | #define NGX_FILE_OPEN 0 |
4266 | 65 | #define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC | 65 | #define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC |
4267 | 66 | #define NGX_FILE_APPEND O_WRONLY|O_APPEND | 66 | #define NGX_FILE_APPEND O_WRONLY|O_APPEND |
4268 | 67 | #define NGX_FILE_NONBLOCK O_NONBLOCK | ||
4269 | 67 | 68 | ||
4270 | 68 | #define NGX_FILE_DEFAULT_ACCESS 0644 | 69 | #define NGX_FILE_DEFAULT_ACCESS 0644 |
4271 | 69 | #define NGX_FILE_OWNER_ACCESS 0600 | 70 | #define NGX_FILE_OWNER_ACCESS 0600 |
4272 | @@ -138,6 +139,9 @@ | |||
4273 | 138 | #define ngx_fd_info(fd, sb) fstat(fd, sb) | 139 | #define ngx_fd_info(fd, sb) fstat(fd, sb) |
4274 | 139 | #define ngx_fd_info_n "fstat()" | 140 | #define ngx_fd_info_n "fstat()" |
4275 | 140 | 141 | ||
4276 | 142 | #define ngx_link_info(file, sb) lstat((const char *) file, sb) | ||
4277 | 143 | #define ngx_link_info_n "lstat()" | ||
4278 | 144 | |||
4279 | 141 | #define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode)) | 145 | #define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode)) |
4280 | 142 | #define ngx_is_file(sb) (S_ISREG((sb)->st_mode)) | 146 | #define ngx_is_file(sb) (S_ISREG((sb)->st_mode)) |
4281 | 143 | #define ngx_is_link(sb) (S_ISLNK((sb)->st_mode)) | 147 | #define ngx_is_link(sb) (S_ISLNK((sb)->st_mode)) |
4282 | 144 | 148 | ||
4283 | === modified file 'src/os/unix/ngx_process.c' | |||
4284 | --- src/os/unix/ngx_process.c 2009-11-30 13:34:00 +0000 | |||
4285 | +++ src/os/unix/ngx_process.c 2010-07-21 11:15:58 +0000 | |||
4286 | @@ -315,7 +315,7 @@ | |||
4287 | 315 | } | 315 | } |
4288 | 316 | } | 316 | } |
4289 | 317 | 317 | ||
4291 | 318 | ngx_time_update(0, 0); | 318 | ngx_time_sigsafe_update(); |
4292 | 319 | 319 | ||
4293 | 320 | action = ""; | 320 | action = ""; |
4294 | 321 | 321 | ||
4295 | @@ -476,16 +476,17 @@ | |||
4296 | 476 | */ | 476 | */ |
4297 | 477 | 477 | ||
4298 | 478 | if (err == NGX_ECHILD) { | 478 | if (err == NGX_ECHILD) { |
4301 | 479 | ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, errno, | 479 | ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, 0, |
4302 | 480 | "waitpid() failed"); | 480 | "waitpid() failed (%d: %s)", |
4303 | 481 | err, ngx_sigsafe_strerror(err)); | ||
4304 | 481 | return; | 482 | return; |
4305 | 482 | } | 483 | } |
4306 | 483 | 484 | ||
4307 | 484 | #endif | 485 | #endif |
4308 | 485 | 486 | ||
4312 | 486 | ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, errno, | 487 | ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, |
4313 | 487 | "waitpid() failed"); | 488 | "waitpid() failed (%d: %s)", |
4314 | 488 | 489 | err, ngx_sigsafe_strerror(err)); | |
4315 | 489 | return; | 490 | return; |
4316 | 490 | } | 491 | } |
4317 | 491 | 492 | ||
4318 | 492 | 493 | ||
4319 | === modified file 'src/os/unix/ngx_process_cycle.c' | |||
4320 | --- src/os/unix/ngx_process_cycle.c 2010-03-03 23:50:36 +0000 | |||
4321 | +++ src/os/unix/ngx_process_cycle.c 2010-07-21 11:15:58 +0000 | |||
4322 | @@ -168,7 +168,7 @@ | |||
4323 | 168 | 168 | ||
4324 | 169 | sigsuspend(&set); | 169 | sigsuspend(&set); |
4325 | 170 | 170 | ||
4327 | 171 | ngx_time_update(0, 0); | 171 | ngx_time_update(); |
4328 | 172 | 172 | ||
4329 | 173 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, | 173 | ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, |
4330 | 174 | "wake up, sigio %i", sigio); | 174 | "wake up, sigio %i", sigio); |
4331 | @@ -1337,7 +1337,7 @@ | |||
4332 | 1337 | 1337 | ||
4333 | 1338 | next = (n <= next) ? n : next; | 1338 | next = (n <= next) ? n : next; |
4334 | 1339 | 1339 | ||
4336 | 1340 | ngx_time_update(0, 0); | 1340 | ngx_time_update(); |
4337 | 1341 | } | 1341 | } |
4338 | 1342 | } | 1342 | } |
4339 | 1343 | 1343 | ||
4340 | @@ -1367,7 +1367,7 @@ | |||
4341 | 1367 | 1367 | ||
4342 | 1368 | if (path[i]->loader) { | 1368 | if (path[i]->loader) { |
4343 | 1369 | path[i]->loader(path[i]->data); | 1369 | path[i]->loader(path[i]->data); |
4345 | 1370 | ngx_time_update(0, 0); | 1370 | ngx_time_update(); |
4346 | 1371 | } | 1371 | } |
4347 | 1372 | } | 1372 | } |
4348 | 1373 | 1373 |
Good work.