Merge lp:~groldster/ubuntu/maverick/nginx/merge-from-sid-0.7.67-2 into lp:ubuntu/maverick/nginx

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
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Ubuntu branches Pending
Review via email: mp+30513@code.launchpad.net

Description of the change

merging nginx 0.7.67 (httpd) from Debian unstable (httpd)

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Good work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2010-03-03 23:50:36 +0000
+++ .pc/applied-patches 2010-07-21 11:15:58 +0000
@@ -1,2 +1,3 @@
1nginx-upstream-fair.diff1nginx-upstream-fair.diff
2dlopen.diff2dlopen.diff
3fix_reloading_ipv6.diff
34
=== added directory '.pc/fix_reloading_ipv6.diff'
=== added directory '.pc/fix_reloading_ipv6.diff/src'
=== added directory '.pc/fix_reloading_ipv6.diff/src/core'
=== added file '.pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c'
--- .pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c 1970-01-01 00:00:00 +0000
+++ .pc/fix_reloading_ipv6.diff/src/core/ngx_cycle.c 2010-07-21 11:15:58 +0000
@@ -0,0 +1,1343 @@
1
2/*
3 * Copyright (C) Igor Sysoev
4 */
5
6
7#include <ngx_config.h>
8#include <ngx_core.h>
9#include <ngx_event.h>
10
11
12static void ngx_destroy_cycle_pools(ngx_conf_t *conf);
13static ngx_int_t ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2);
14static ngx_int_t ngx_init_zone_pool(ngx_cycle_t *cycle,
15 ngx_shm_zone_t *shm_zone);
16static ngx_int_t ngx_test_lockfile(u_char *file, ngx_log_t *log);
17static void ngx_clean_old_cycles(ngx_event_t *ev);
18
19
20volatile ngx_cycle_t *ngx_cycle;
21ngx_array_t ngx_old_cycles;
22
23static ngx_pool_t *ngx_temp_pool;
24static ngx_event_t ngx_cleaner_event;
25
26ngx_uint_t ngx_test_config;
27
28#if (NGX_THREADS)
29ngx_tls_key_t ngx_core_tls_key;
30#endif
31
32
33/* STUB NAME */
34static ngx_connection_t dumb;
35/* STUB */
36
37static ngx_str_t error_log = ngx_string(NGX_ERROR_LOG_PATH);
38
39
40ngx_cycle_t *
41ngx_init_cycle(ngx_cycle_t *old_cycle)
42{
43 void *rv;
44 char **senv, **env;
45 ngx_uint_t i, n;
46 ngx_log_t *log;
47 ngx_time_t *tp;
48 ngx_conf_t conf;
49 ngx_pool_t *pool;
50 ngx_cycle_t *cycle, **old;
51 ngx_shm_zone_t *shm_zone, *oshm_zone;
52 ngx_list_part_t *part, *opart;
53 ngx_open_file_t *file;
54 ngx_listening_t *ls, *nls;
55 ngx_core_conf_t *ccf, *old_ccf;
56 ngx_core_module_t *module;
57 char hostname[NGX_MAXHOSTNAMELEN];
58
59 ngx_timezone_update();
60
61 /* force localtime update with a new timezone */
62
63 tp = ngx_timeofday();
64 tp->sec = 0;
65
66 ngx_time_update();
67
68
69 log = old_cycle->log;
70
71 pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, log);
72 if (pool == NULL) {
73 return NULL;
74 }
75 pool->log = log;
76
77 cycle = ngx_pcalloc(pool, sizeof(ngx_cycle_t));
78 if (cycle == NULL) {
79 ngx_destroy_pool(pool);
80 return NULL;
81 }
82
83 cycle->pool = pool;
84 cycle->log = log;
85 cycle->new_log.log_level = NGX_LOG_ERR;
86 cycle->old_cycle = old_cycle;
87
88 cycle->conf_prefix.len = old_cycle->conf_prefix.len;
89 cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix);
90 if (cycle->conf_prefix.data == NULL) {
91 ngx_destroy_pool(pool);
92 return NULL;
93 }
94
95 cycle->prefix.len = old_cycle->prefix.len;
96 cycle->prefix.data = ngx_pstrdup(pool, &old_cycle->prefix);
97 if (cycle->prefix.data == NULL) {
98 ngx_destroy_pool(pool);
99 return NULL;
100 }
101
102 cycle->conf_file.len = old_cycle->conf_file.len;
103 cycle->conf_file.data = ngx_pnalloc(pool, old_cycle->conf_file.len + 1);
104 if (cycle->conf_file.data == NULL) {
105 ngx_destroy_pool(pool);
106 return NULL;
107 }
108 ngx_cpystrn(cycle->conf_file.data, old_cycle->conf_file.data,
109 old_cycle->conf_file.len + 1);
110
111 cycle->conf_param.len = old_cycle->conf_param.len;
112 cycle->conf_param.data = ngx_pstrdup(pool, &old_cycle->conf_param);
113 if (cycle->conf_param.data == NULL) {
114 ngx_destroy_pool(pool);
115 return NULL;
116 }
117
118
119 n = old_cycle->pathes.nelts ? old_cycle->pathes.nelts : 10;
120
121 cycle->pathes.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *));
122 if (cycle->pathes.elts == NULL) {
123 ngx_destroy_pool(pool);
124 return NULL;
125 }
126
127 cycle->pathes.nelts = 0;
128 cycle->pathes.size = sizeof(ngx_path_t *);
129 cycle->pathes.nalloc = n;
130 cycle->pathes.pool = pool;
131
132
133 if (old_cycle->open_files.part.nelts) {
134 n = old_cycle->open_files.part.nelts;
135 for (part = old_cycle->open_files.part.next; part; part = part->next) {
136 n += part->nelts;
137 }
138
139 } else {
140 n = 20;
141 }
142
143 if (ngx_list_init(&cycle->open_files, pool, n, sizeof(ngx_open_file_t))
144 != NGX_OK)
145 {
146 ngx_destroy_pool(pool);
147 return NULL;
148 }
149
150
151 if (old_cycle->shared_memory.part.nelts) {
152 n = old_cycle->shared_memory.part.nelts;
153 for (part = old_cycle->shared_memory.part.next; part; part = part->next)
154 {
155 n += part->nelts;
156 }
157
158 } else {
159 n = 1;
160 }
161
162 if (ngx_list_init(&cycle->shared_memory, pool, n, sizeof(ngx_shm_zone_t))
163 != NGX_OK)
164 {
165 ngx_destroy_pool(pool);
166 return NULL;
167 }
168
169 n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;
170
171 cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t));
172 if (cycle->listening.elts == NULL) {
173 ngx_destroy_pool(pool);
174 return NULL;
175 }
176
177 cycle->listening.nelts = 0;
178 cycle->listening.size = sizeof(ngx_listening_t);
179 cycle->listening.nalloc = n;
180 cycle->listening.pool = pool;
181
182
183 cycle->conf_ctx = ngx_pcalloc(pool, ngx_max_module * sizeof(void *));
184 if (cycle->conf_ctx == NULL) {
185 ngx_destroy_pool(pool);
186 return NULL;
187 }
188
189
190 if (gethostname(hostname, NGX_MAXHOSTNAMELEN) == -1) {
191 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "gethostname() failed");
192 ngx_destroy_pool(pool);
193 return NULL;
194 }
195
196 /* on Linux gethostname() silently truncates name that does not fit */
197
198 hostname[NGX_MAXHOSTNAMELEN - 1] = '\0';
199 cycle->hostname.len = ngx_strlen(hostname);
200
201 cycle->hostname.data = ngx_pnalloc(pool, cycle->hostname.len);
202 if (cycle->hostname.data == NULL) {
203 ngx_destroy_pool(pool);
204 return NULL;
205 }
206
207 ngx_memcpy(cycle->hostname.data, hostname, cycle->hostname.len);
208
209
210 for (i = 0; ngx_modules[i]; i++) {
211 if (ngx_modules[i]->type != NGX_CORE_MODULE) {
212 continue;
213 }
214
215 module = ngx_modules[i]->ctx;
216
217 if (module->create_conf) {
218 rv = module->create_conf(cycle);
219 if (rv == NULL) {
220 ngx_destroy_pool(pool);
221 return NULL;
222 }
223 cycle->conf_ctx[ngx_modules[i]->index] = rv;
224 }
225 }
226
227
228 senv = environ;
229
230
231 ngx_memzero(&conf, sizeof(ngx_conf_t));
232 /* STUB: init array ? */
233 conf.args = ngx_array_create(pool, 10, sizeof(ngx_str_t));
234 if (conf.args == NULL) {
235 ngx_destroy_pool(pool);
236 return NULL;
237 }
238
239 conf.temp_pool = ngx_create_pool(NGX_CYCLE_POOL_SIZE, log);
240 if (conf.temp_pool == NULL) {
241 ngx_destroy_pool(pool);
242 return NULL;
243 }
244
245
246 conf.ctx = cycle->conf_ctx;
247 conf.cycle = cycle;
248 conf.pool = pool;
249 conf.log = log;
250 conf.module_type = NGX_CORE_MODULE;
251 conf.cmd_type = NGX_MAIN_CONF;
252
253#if 0
254 log->log_level = NGX_LOG_DEBUG_ALL;
255#endif
256
257 if (ngx_conf_param(&conf) != NGX_CONF_OK) {
258 environ = senv;
259 ngx_destroy_cycle_pools(&conf);
260 return NULL;
261 }
262
263 if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
264 environ = senv;
265 ngx_destroy_cycle_pools(&conf);
266 return NULL;
267 }
268
269 if (ngx_test_config) {
270 ngx_log_stderr(0, "the configuration file %s syntax is ok",
271 cycle->conf_file.data);
272 }
273
274 for (i = 0; ngx_modules[i]; i++) {
275 if (ngx_modules[i]->type != NGX_CORE_MODULE) {
276 continue;
277 }
278
279 module = ngx_modules[i]->ctx;
280
281 if (module->init_conf) {
282 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index])
283 == NGX_CONF_ERROR)
284 {
285 environ = senv;
286 ngx_destroy_cycle_pools(&conf);
287 return NULL;
288 }
289 }
290 }
291
292 if (ngx_process == NGX_PROCESS_SIGNALLER) {
293 return cycle;
294 }
295
296 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
297
298 if (ngx_test_config) {
299
300 if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) {
301 goto failed;
302 }
303
304 } else if (!ngx_is_init_cycle(old_cycle)) {
305
306 /*
307 * we do not create the pid file in the first ngx_init_cycle() call
308 * because we need to write the demonized process pid
309 */
310
311 old_ccf = (ngx_core_conf_t *) ngx_get_conf(old_cycle->conf_ctx,
312 ngx_core_module);
313 if (ccf->pid.len != old_ccf->pid.len
314 || ngx_strcmp(ccf->pid.data, old_ccf->pid.data) != 0)
315 {
316 /* new pid file name */
317
318 if (ngx_create_pidfile(&ccf->pid, log) != NGX_OK) {
319 goto failed;
320 }
321
322 ngx_delete_pidfile(old_cycle);
323 }
324 }
325
326
327 if (ngx_test_lockfile(cycle->lock_file.data, log) != NGX_OK) {
328 goto failed;
329 }
330
331
332 if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) {
333 goto failed;
334 }
335
336
337 if (cycle->new_log.file == NULL) {
338 cycle->new_log.file = ngx_conf_open_file(cycle, &error_log);
339 if (cycle->new_log.file == NULL) {
340 goto failed;
341 }
342 }
343
344 /* open the new files */
345
346 part = &cycle->open_files.part;
347 file = part->elts;
348
349 for (i = 0; /* void */ ; i++) {
350
351 if (i >= part->nelts) {
352 if (part->next == NULL) {
353 break;
354 }
355 part = part->next;
356 file = part->elts;
357 i = 0;
358 }
359
360 if (file[i].name.len == 0) {
361 continue;
362 }
363
364 file[i].fd = ngx_open_file(file[i].name.data,
365 NGX_FILE_APPEND,
366 NGX_FILE_CREATE_OR_OPEN,
367 NGX_FILE_DEFAULT_ACCESS);
368
369 ngx_log_debug3(NGX_LOG_DEBUG_CORE, log, 0,
370 "log: %p %d \"%s\"",
371 &file[i], file[i].fd, file[i].name.data);
372
373 if (file[i].fd == NGX_INVALID_FILE) {
374 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
375 ngx_open_file_n " \"%s\" failed",
376 file[i].name.data);
377 goto failed;
378 }
379
380#if !(NGX_WIN32)
381 if (fcntl(file[i].fd, F_SETFD, FD_CLOEXEC) == -1) {
382 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
383 "fcntl(FD_CLOEXEC) \"%s\" failed",
384 file[i].name.data);
385 goto failed;
386 }
387#endif
388 }
389
390 cycle->log = &cycle->new_log;
391 pool->log = &cycle->new_log;
392
393
394 /* create shared memory */
395
396 part = &cycle->shared_memory.part;
397 shm_zone = part->elts;
398
399 for (i = 0; /* void */ ; i++) {
400
401 if (i >= part->nelts) {
402 if (part->next == NULL) {
403 break;
404 }
405 part = part->next;
406 shm_zone = part->elts;
407 i = 0;
408 }
409
410 if (shm_zone[i].shm.size == 0) {
411 ngx_log_error(NGX_LOG_EMERG, log, 0,
412 "zero size shared memory zone \"%V\"",
413 &shm_zone[i].shm.name);
414 goto failed;
415 }
416
417 if (shm_zone[i].init == NULL) {
418 /* unused shared zone */
419 continue;
420 }
421
422 shm_zone[i].shm.log = cycle->log;
423
424 opart = &old_cycle->shared_memory.part;
425 oshm_zone = opart->elts;
426
427 for (n = 0; /* void */ ; n++) {
428
429 if (n >= opart->nelts) {
430 if (opart->next == NULL) {
431 break;
432 }
433 opart = opart->next;
434 oshm_zone = opart->elts;
435 n = 0;
436 }
437
438 if (shm_zone[i].shm.name.len != oshm_zone[n].shm.name.len) {
439 continue;
440 }
441
442 if (ngx_strncmp(shm_zone[i].shm.name.data,
443 oshm_zone[n].shm.name.data,
444 shm_zone[i].shm.name.len)
445 != 0)
446 {
447 continue;
448 }
449
450 if (shm_zone[i].shm.size == oshm_zone[n].shm.size) {
451 shm_zone[i].shm.addr = oshm_zone[n].shm.addr;
452
453 if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data)
454 != NGX_OK)
455 {
456 goto failed;
457 }
458
459 goto shm_zone_found;
460 }
461
462 ngx_shm_free(&oshm_zone[n].shm);
463
464 break;
465 }
466
467 if (ngx_shm_alloc(&shm_zone[i].shm) != NGX_OK) {
468 goto failed;
469 }
470
471 if (ngx_init_zone_pool(cycle, &shm_zone[i]) != NGX_OK) {
472 goto failed;
473 }
474
475 if (shm_zone[i].init(&shm_zone[i], NULL) != NGX_OK) {
476 goto failed;
477 }
478
479 shm_zone_found:
480
481 continue;
482 }
483
484
485 /* handle the listening sockets */
486
487 if (old_cycle->listening.nelts) {
488 ls = old_cycle->listening.elts;
489 for (i = 0; i < old_cycle->listening.nelts; i++) {
490 ls[i].remain = 0;
491 }
492
493 nls = cycle->listening.elts;
494 for (n = 0; n < cycle->listening.nelts; n++) {
495
496 for (i = 0; i < old_cycle->listening.nelts; i++) {
497 if (ls[i].ignore) {
498 continue;
499 }
500
501 if (ngx_cmp_sockaddr(nls[n].sockaddr, ls[i].sockaddr) == NGX_OK)
502 {
503 nls[n].fd = ls[i].fd;
504 nls[n].previous = &ls[i];
505 ls[i].remain = 1;
506
507 if (ls[n].backlog != nls[i].backlog) {
508 nls[n].listen = 1;
509 }
510
511#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
512
513 /*
514 * FreeBSD, except the most recent versions,
515 * could not remove accept filter
516 */
517 nls[n].deferred_accept = ls[i].deferred_accept;
518
519 if (ls[i].accept_filter && nls[n].accept_filter) {
520 if (ngx_strcmp(ls[i].accept_filter,
521 nls[n].accept_filter)
522 != 0)
523 {
524 nls[n].delete_deferred = 1;
525 nls[n].add_deferred = 1;
526 }
527
528 } else if (ls[i].accept_filter) {
529 nls[n].delete_deferred = 1;
530
531 } else if (nls[n].accept_filter) {
532 nls[n].add_deferred = 1;
533 }
534#endif
535
536#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
537
538 if (ls[n].deferred_accept && !nls[n].deferred_accept) {
539 nls[n].delete_deferred = 1;
540
541 } else if (ls[i].deferred_accept != nls[n].deferred_accept)
542 {
543 nls[n].add_deferred = 1;
544 }
545#endif
546 break;
547 }
548 }
549
550 if (nls[n].fd == -1) {
551 nls[n].open = 1;
552 }
553 }
554
555 } else {
556 ls = cycle->listening.elts;
557 for (i = 0; i < cycle->listening.nelts; i++) {
558 ls[i].open = 1;
559#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
560 if (ls[i].accept_filter) {
561 ls[i].add_deferred = 1;
562 }
563#endif
564#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
565 if (ls[i].deferred_accept) {
566 ls[i].add_deferred = 1;
567 }
568#endif
569 }
570 }
571
572 if (ngx_open_listening_sockets(cycle) != NGX_OK) {
573 goto failed;
574 }
575
576 if (!ngx_test_config) {
577 ngx_configure_listening_sockets(cycle);
578 }
579
580
581 /* commit the new cycle configuration */
582
583 if (!ngx_use_stderr && cycle->log->file->fd != ngx_stderr) {
584
585 if (ngx_set_stderr(cycle->log->file->fd) == NGX_FILE_ERROR) {
586 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
587 ngx_set_stderr_n " failed");
588 }
589 }
590
591 pool->log = cycle->log;
592
593 for (i = 0; ngx_modules[i]; i++) {
594 if (ngx_modules[i]->init_module) {
595 if (ngx_modules[i]->init_module(cycle) != NGX_OK) {
596 /* fatal */
597 exit(1);
598 }
599 }
600 }
601
602
603 /* close and delete stuff that lefts from an old cycle */
604
605 /* free the unnecessary shared memory */
606
607 opart = &old_cycle->shared_memory.part;
608 oshm_zone = opart->elts;
609
610 for (i = 0; /* void */ ; i++) {
611
612 if (i >= opart->nelts) {
613 if (opart->next == NULL) {
614 goto old_shm_zone_done;
615 }
616 opart = opart->next;
617 oshm_zone = opart->elts;
618 i = 0;
619 }
620
621 part = &cycle->shared_memory.part;
622 shm_zone = part->elts;
623
624 for (n = 0; /* void */ ; n++) {
625
626 if (n >= part->nelts) {
627 if (part->next == NULL) {
628 break;
629 }
630 part = part->next;
631 shm_zone = part->elts;
632 n = 0;
633 }
634
635 if (oshm_zone[i].shm.name.len == shm_zone[n].shm.name.len
636 && ngx_strncmp(oshm_zone[i].shm.name.data,
637 shm_zone[n].shm.name.data,
638 oshm_zone[i].shm.name.len)
639 == 0)
640 {
641 goto live_shm_zone;
642 }
643 }
644
645 ngx_shm_free(&oshm_zone[i].shm);
646
647 live_shm_zone:
648
649 continue;
650 }
651
652old_shm_zone_done:
653
654
655 /* close the unnecessary listening sockets */
656
657 ls = old_cycle->listening.elts;
658 for (i = 0; i < old_cycle->listening.nelts; i++) {
659
660 if (ls[i].remain || ls[i].fd == -1) {
661 continue;
662 }
663
664 if (ngx_close_socket(ls[i].fd) == -1) {
665 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
666 ngx_close_socket_n " listening socket on %V failed",
667 &ls[i].addr_text);
668 }
669 }
670
671
672 /* close the unnecessary open files */
673
674 part = &old_cycle->open_files.part;
675 file = part->elts;
676
677 for (i = 0; /* void */ ; i++) {
678
679 if (i >= part->nelts) {
680 if (part->next == NULL) {
681 break;
682 }
683 part = part->next;
684 file = part->elts;
685 i = 0;
686 }
687
688 if (file[i].fd == NGX_INVALID_FILE || file[i].fd == ngx_stderr) {
689 continue;
690 }
691
692 if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) {
693 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
694 ngx_close_file_n " \"%s\" failed",
695 file[i].name.data);
696 }
697 }
698
699 ngx_destroy_pool(conf.temp_pool);
700
701 if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) {
702
703 /*
704 * perl_destruct() frees environ, if it is not the same as it was at
705 * perl_construct() time, therefore we save the previous cycle
706 * environment before ngx_conf_parse() where it will be changed.
707 */
708
709 env = environ;
710 environ = senv;
711
712 ngx_destroy_pool(old_cycle->pool);
713 cycle->old_cycle = NULL;
714
715 environ = env;
716
717 return cycle;
718 }
719
720
721 if (ngx_temp_pool == NULL) {
722 ngx_temp_pool = ngx_create_pool(128, cycle->log);
723 if (ngx_temp_pool == NULL) {
724 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
725 "can not create ngx_temp_pool");
726 exit(1);
727 }
728
729 n = 10;
730 ngx_old_cycles.elts = ngx_pcalloc(ngx_temp_pool,
731 n * sizeof(ngx_cycle_t *));
732 if (ngx_old_cycles.elts == NULL) {
733 exit(1);
734 }
735 ngx_old_cycles.nelts = 0;
736 ngx_old_cycles.size = sizeof(ngx_cycle_t *);
737 ngx_old_cycles.nalloc = n;
738 ngx_old_cycles.pool = ngx_temp_pool;
739
740 ngx_cleaner_event.handler = ngx_clean_old_cycles;
741 ngx_cleaner_event.log = cycle->log;
742 ngx_cleaner_event.data = &dumb;
743 dumb.fd = (ngx_socket_t) -1;
744 }
745
746 ngx_temp_pool->log = cycle->log;
747
748 old = ngx_array_push(&ngx_old_cycles);
749 if (old == NULL) {
750 exit(1);
751 }
752 *old = old_cycle;
753
754 if (!ngx_cleaner_event.timer_set) {
755 ngx_add_timer(&ngx_cleaner_event, 30000);
756 ngx_cleaner_event.timer_set = 1;
757 }
758
759 return cycle;
760
761
762failed:
763
764 if (!ngx_is_init_cycle(old_cycle)) {
765 old_ccf = (ngx_core_conf_t *) ngx_get_conf(old_cycle->conf_ctx,
766 ngx_core_module);
767 if (old_ccf->environment) {
768 environ = old_ccf->environment;
769 }
770 }
771
772 /* rollback the new cycle configuration */
773
774 part = &cycle->open_files.part;
775 file = part->elts;
776
777 for (i = 0; /* void */ ; i++) {
778
779 if (i >= part->nelts) {
780 if (part->next == NULL) {
781 break;
782 }
783 part = part->next;
784 file = part->elts;
785 i = 0;
786 }
787
788 if (file[i].fd == NGX_INVALID_FILE || file[i].fd == ngx_stderr) {
789 continue;
790 }
791
792 if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) {
793 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
794 ngx_close_file_n " \"%s\" failed",
795 file[i].name.data);
796 }
797 }
798
799 if (ngx_test_config) {
800 ngx_destroy_cycle_pools(&conf);
801 return NULL;
802 }
803
804 ls = cycle->listening.elts;
805 for (i = 0; i < cycle->listening.nelts; i++) {
806 if (ls[i].fd == -1 || !ls[i].open) {
807 continue;
808 }
809
810 if (ngx_close_socket(ls[i].fd) == -1) {
811 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
812 ngx_close_socket_n " %V failed",
813 &ls[i].addr_text);
814 }
815 }
816
817 ngx_destroy_cycle_pools(&conf);
818
819 return NULL;
820}
821
822
823static void
824ngx_destroy_cycle_pools(ngx_conf_t *conf)
825{
826 ngx_destroy_pool(conf->temp_pool);
827 ngx_destroy_pool(conf->pool);
828}
829
830
831static ngx_int_t
832ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2)
833{
834 struct sockaddr_in *sin1, *sin2;
835#if (NGX_HAVE_INET6)
836 struct sockaddr_in6 *sin61, *sin62;
837#endif
838
839 if (sa1->sa_family != sa2->sa_family) {
840 return NGX_DECLINED;
841 }
842
843 switch (sa1->sa_family) {
844
845#if (NGX_HAVE_INET6)
846 case AF_INET6:
847 sin61 = (struct sockaddr_in6 *) sa1;
848 sin62 = (struct sockaddr_in6 *) sa2;
849
850 if (sin61->sin6_port != sin61->sin6_port) {
851 return NGX_DECLINED;
852 }
853
854 if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) {
855 return NGX_DECLINED;
856 }
857
858 break;
859#endif
860
861 default: /* AF_INET */
862
863 sin1 = (struct sockaddr_in *) sa1;
864 sin2 = (struct sockaddr_in *) sa2;
865
866 if (sin1->sin_port != sin2->sin_port) {
867 return NGX_DECLINED;
868 }
869
870 if (sin1->sin_addr.s_addr != sin2->sin_addr.s_addr) {
871 return NGX_DECLINED;
872 }
873
874 break;
875 }
876
877 return NGX_OK;
878}
879
880
881static ngx_int_t
882ngx_init_zone_pool(ngx_cycle_t *cycle, ngx_shm_zone_t *zn)
883{
884 u_char *file;
885 ngx_slab_pool_t *sp;
886
887 sp = (ngx_slab_pool_t *) zn->shm.addr;
888
889 if (zn->shm.exists) {
890
891 if (sp == sp->addr) {
892 return NGX_OK;
893 }
894
895 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
896 "shared zone \"%V\" has no equal addresses: %p vs %p",
897 &zn->shm.name, sp->addr, sp);
898 return NGX_ERROR;
899 }
900
901 sp->end = zn->shm.addr + zn->shm.size;
902 sp->min_shift = 3;
903 sp->addr = zn->shm.addr;
904
905#if (NGX_HAVE_ATOMIC_OPS)
906
907 file = NULL;
908
909#else
910
911 file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len);
912 if (file == NULL) {
913 return NGX_ERROR;
914 }
915
916 (void) ngx_sprintf(file, "%V%V%Z", &cycle->lock_file, &zn->shm.name);
917
918#endif
919
920 if (ngx_shmtx_create(&sp->mutex, (void *) &sp->lock, file) != NGX_OK) {
921 return NGX_ERROR;
922 }
923
924 ngx_slab_init(sp);
925
926 return NGX_OK;
927}
928
929
930ngx_int_t
931ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log)
932{
933 size_t len;
934 ngx_uint_t create;
935 ngx_file_t file;
936 u_char pid[NGX_INT64_LEN + 2];
937
938 if (ngx_process > NGX_PROCESS_MASTER) {
939 return NGX_OK;
940 }
941
942 ngx_memzero(&file, sizeof(ngx_file_t));
943
944 file.name = *name;
945 file.log = log;
946
947 create = ngx_test_config ? NGX_FILE_CREATE_OR_OPEN : NGX_FILE_TRUNCATE;
948
949 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR,
950 create, NGX_FILE_DEFAULT_ACCESS);
951
952 if (file.fd == NGX_INVALID_FILE) {
953 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
954 ngx_open_file_n " \"%s\" failed", file.name.data);
955 return NGX_ERROR;
956 }
957
958 if (!ngx_test_config) {
959 len = ngx_snprintf(pid, NGX_INT64_LEN + 2, "%P%N", ngx_pid) - pid;
960
961 if (ngx_write_file(&file, pid, len, 0) == NGX_ERROR) {
962 return NGX_ERROR;
963 }
964 }
965
966 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
967 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
968 ngx_close_file_n " \"%s\" failed", file.name.data);
969 }
970
971 return NGX_OK;
972}
973
974
975void
976ngx_delete_pidfile(ngx_cycle_t *cycle)
977{
978 u_char *name;
979 ngx_core_conf_t *ccf;
980
981 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
982
983 name = ngx_new_binary ? ccf->oldpid.data : ccf->pid.data;
984
985 if (ngx_delete_file(name) == NGX_FILE_ERROR) {
986 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
987 ngx_delete_file_n " \"%s\" failed", name);
988 }
989}
990
991
992ngx_int_t
993ngx_signal_process(ngx_cycle_t *cycle, char *sig)
994{
995 ssize_t n;
996 ngx_int_t pid;
997 ngx_file_t file;
998 ngx_core_conf_t *ccf;
999 u_char buf[NGX_INT64_LEN + 2];
1000
1001 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "signal process started");
1002
1003 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
1004
1005 file.name = ccf->pid;
1006 file.log = cycle->log;
1007
1008 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY,
1009 NGX_FILE_OPEN, NGX_FILE_DEFAULT_ACCESS);
1010
1011 if (file.fd == NGX_INVALID_FILE) {
1012 ngx_log_error(NGX_LOG_ERR, cycle->log, ngx_errno,
1013 ngx_open_file_n " \"%s\" failed", file.name.data);
1014 return 1;
1015 }
1016
1017 n = ngx_read_file(&file, buf, NGX_INT64_LEN + 2, 0);
1018
1019 if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
1020 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
1021 ngx_close_file_n " \"%s\" failed", file.name.data);
1022 }
1023
1024 if (n == NGX_ERROR) {
1025 return 1;
1026 }
1027
1028 while (n-- && (buf[n] == CR || buf[n] == LF)) { /* void */ }
1029
1030 pid = ngx_atoi(buf, ++n);
1031
1032 if (pid == NGX_ERROR) {
1033 ngx_log_error(NGX_LOG_ERR, cycle->log, 0,
1034 "invalid PID number \"%*s\" in \"%s\"",
1035 n, buf, file.name.data);
1036 return 1;
1037 }
1038
1039 return ngx_os_signal_process(cycle, sig, pid);
1040
1041}
1042
1043
1044static ngx_int_t
1045ngx_test_lockfile(u_char *file, ngx_log_t *log)
1046{
1047#if !(NGX_HAVE_ATOMIC_OPS)
1048 ngx_fd_t fd;
1049
1050 fd = ngx_open_file(file, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN,
1051 NGX_FILE_DEFAULT_ACCESS);
1052
1053 if (fd == NGX_INVALID_FILE) {
1054 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
1055 ngx_open_file_n " \"%s\" failed", file);
1056 return NGX_ERROR;
1057 }
1058
1059 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
1060 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
1061 ngx_close_file_n " \"%s\" failed", file);
1062 }
1063
1064 if (ngx_delete_file(file) == NGX_FILE_ERROR) {
1065 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
1066 ngx_delete_file_n " \"%s\" failed", file);
1067 }
1068
1069#endif
1070
1071 return NGX_OK;
1072}
1073
1074
1075void
1076ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user)
1077{
1078 ssize_t n, len;
1079 ngx_fd_t fd;
1080 ngx_uint_t i;
1081 ngx_list_part_t *part;
1082 ngx_open_file_t *file;
1083
1084 part = &cycle->open_files.part;
1085 file = part->elts;
1086
1087 for (i = 0; /* void */ ; i++) {
1088
1089 if (i >= part->nelts) {
1090 if (part->next == NULL) {
1091 break;
1092 }
1093 part = part->next;
1094 file = part->elts;
1095 i = 0;
1096 }
1097
1098 if (file[i].name.len == 0) {
1099 continue;
1100 }
1101
1102 len = file[i].pos - file[i].buffer;
1103
1104 if (file[i].buffer && len != 0) {
1105
1106 n = ngx_write_fd(file[i].fd, file[i].buffer, len);
1107
1108 if (n == NGX_FILE_ERROR) {
1109 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
1110 ngx_write_fd_n " to \"%s\" failed",
1111 file[i].name.data);
1112
1113 } else if (n != len) {
1114 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
1115 ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz",
1116 file[i].name.data, n, len);
1117 }
1118
1119 file[i].pos = file[i].buffer;
1120 }
1121
1122 fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND,
1123 NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
1124
1125 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
1126 "reopen file \"%s\", old:%d new:%d",
1127 file[i].name.data, file[i].fd, fd);
1128
1129 if (fd == NGX_INVALID_FILE) {
1130 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1131 ngx_open_file_n " \"%s\" failed", file[i].name.data);
1132 continue;
1133 }
1134
1135#if !(NGX_WIN32)
1136 if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) {
1137 ngx_file_info_t fi;
1138
1139 if (ngx_file_info((const char *) file[i].name.data, &fi)
1140 == NGX_FILE_ERROR)
1141 {
1142 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1143 ngx_file_info_n " \"%s\" failed",
1144 file[i].name.data);
1145
1146 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
1147 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1148 ngx_close_file_n " \"%s\" failed",
1149 file[i].name.data);
1150 }
1151 }
1152
1153 if (fi.st_uid != user) {
1154 if (chown((const char *) file[i].name.data, user, -1) == -1) {
1155 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1156 "chown(\"%s\", %d) failed",
1157 file[i].name.data, user);
1158
1159 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
1160 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1161 ngx_close_file_n " \"%s\" failed",
1162 file[i].name.data);
1163 }
1164 }
1165 }
1166
1167 if ((fi.st_mode & (S_IRUSR|S_IWUSR)) != (S_IRUSR|S_IWUSR)) {
1168
1169 fi.st_mode |= (S_IRUSR|S_IWUSR);
1170
1171 if (chmod((const char *) file[i].name.data, fi.st_mode) == -1) {
1172 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1173 "chmod() \"%s\" failed", file[i].name.data);
1174
1175 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
1176 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1177 ngx_close_file_n " \"%s\" failed",
1178 file[i].name.data);
1179 }
1180 }
1181 }
1182 }
1183
1184 if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
1185 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1186 "fcntl(FD_CLOEXEC) \"%s\" failed",
1187 file[i].name.data);
1188
1189 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
1190 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1191 ngx_close_file_n " \"%s\" failed",
1192 file[i].name.data);
1193 }
1194
1195 continue;
1196 }
1197#endif
1198
1199 if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) {
1200 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1201 ngx_close_file_n " \"%s\" failed",
1202 file[i].name.data);
1203 }
1204
1205 file[i].fd = fd;
1206 }
1207
1208#if !(NGX_WIN32)
1209
1210 if (cycle->log->file->fd != STDERR_FILENO) {
1211 if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
1212 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1213 "dup2(STDERR) failed");
1214 }
1215 }
1216
1217#endif
1218}
1219
1220
1221ngx_shm_zone_t *
1222ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag)
1223{
1224 ngx_uint_t i;
1225 ngx_shm_zone_t *shm_zone;
1226 ngx_list_part_t *part;
1227
1228 part = &cf->cycle->shared_memory.part;
1229 shm_zone = part->elts;
1230
1231 for (i = 0; /* void */ ; i++) {
1232
1233 if (i >= part->nelts) {
1234 if (part->next == NULL) {
1235 break;
1236 }
1237 part = part->next;
1238 shm_zone = part->elts;
1239 i = 0;
1240 }
1241
1242 if (name->len != shm_zone[i].shm.name.len) {
1243 continue;
1244 }
1245
1246 if (ngx_strncmp(name->data, shm_zone[i].shm.name.data, name->len)
1247 != 0)
1248 {
1249 continue;
1250 }
1251
1252 if (size && size != shm_zone[i].shm.size) {
1253 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1254 "the size %uz of shared memory zone \"%V\" "
1255 "conflicts with already declared size %uz",
1256 size, &shm_zone[i].shm.name, shm_zone[i].shm.size);
1257 return NULL;
1258 }
1259
1260 if (tag != shm_zone[i].tag) {
1261 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1262 "the shared memory zone \"%V\" is "
1263 "already declared for a different use",
1264 &shm_zone[i].shm.name);
1265 return NULL;
1266 }
1267
1268 return &shm_zone[i];
1269 }
1270
1271 shm_zone = ngx_list_push(&cf->cycle->shared_memory);
1272
1273 if (shm_zone == NULL) {
1274 return NULL;
1275 }
1276
1277 shm_zone->data = NULL;
1278 shm_zone->shm.log = cf->cycle->log;
1279 shm_zone->shm.size = size;
1280 shm_zone->shm.name = *name;
1281 shm_zone->shm.exists = 0;
1282 shm_zone->init = NULL;
1283 shm_zone->tag = tag;
1284
1285 return shm_zone;
1286}
1287
1288
1289static void
1290ngx_clean_old_cycles(ngx_event_t *ev)
1291{
1292 ngx_uint_t i, n, found, live;
1293 ngx_log_t *log;
1294 ngx_cycle_t **cycle;
1295
1296 log = ngx_cycle->log;
1297 ngx_temp_pool->log = log;
1298
1299 ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycles");
1300
1301 live = 0;
1302
1303 cycle = ngx_old_cycles.elts;
1304 for (i = 0; i < ngx_old_cycles.nelts; i++) {
1305
1306 if (cycle[i] == NULL) {
1307 continue;
1308 }
1309
1310 found = 0;
1311
1312 for (n = 0; n < cycle[i]->connection_n; n++) {
1313 if (cycle[i]->connections[n].fd != (ngx_socket_t) -1) {
1314 found = 1;
1315
1316 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%d", n);
1317
1318 break;
1319 }
1320 }
1321
1322 if (found) {
1323 live = 1;
1324 continue;
1325 }
1326
1327 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "clean old cycle: %d", i);
1328
1329 ngx_destroy_pool(cycle[i]->pool);
1330 cycle[i] = NULL;
1331 }
1332
1333 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "old cycles status: %d", live);
1334
1335 if (live) {
1336 ngx_add_timer(ev, 30000);
1337
1338 } else {
1339 ngx_destroy_pool(ngx_temp_pool);
1340 ngx_temp_pool = NULL;
1341 ngx_old_cycles.nelts = 0;
1342 }
1343}
01344
=== modified file 'CHANGES'
--- CHANGES 2010-03-03 23:50:36 +0000
+++ CHANGES 2010-07-21 11:15:58 +0000
@@ -1,4 +1,125 @@
11
2Changes with nginx 0.7.67 15 Jun 2010
3
4 *) Security: nginx/Windows worker might be terminated abnormally if a
5 requested file name has invalid UTF-8 encoding.
6
7
8Changes with nginx 0.7.66 07 Jun 2010
9
10 *) Security: now nginx/Windows ignores default file stream name.
11 Thanks to Jose Antonio Vazquez Gonzalez.
12
13 *) Change: now the charset filter runs before the SSI filter.
14
15 *) Change: now no message is written in an error log if a variable is
16 not found by $r->variable() method.
17
18 *) Change: now keepalive connections after POST requests are not
19 disabled for MSIE 7.0+.
20 Thanks to Adam Lounds.
21
22 *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives.
23
24 *) Feature: now the "rewrite" directive does a redirect automatically
25 if the $scheme variable is used.
26 Thanks to Piotr Sikora.
27
28 *) Feature: the "chunked_transfer_encoding" directive.
29
30 *) Feature: the $geoip_city_continent_code, $geoip_latitude, and
31 $geoip_longitude variables.
32 Thanks to Arvind Sundararajan.
33
34 *) Feature: now the ngx_http_image_filter_module deletes always EXIF
35 and other application specific data if the data consume more than 5%
36 of a JPEG file.
37
38 *) Feature: now the "msie_padding" directive works for Chrome too.
39
40 *) Workaround: now keepalive connections are disabled for Safari.
41 Thanks to Joshua Sierles.
42
43 *) Bugfix: nginx ignored the "private" and "no-store" values in the
44 "Cache-Control" backend response header line.
45
46 *) Bugfix: an "&" character was not escaped when it was copied in
47 arguments part in a rewrite rule.
48
49 *) Bugfix: nginx might be terminated abnormally while a signal
50 processing or if the directive "timer_resolution" was used on
51 platforms which do not support kqueue or eventport notification
52 methods.
53 Thanks to George Xie and Maxim Dounin.
54
55 *) Bugfix: if temporary files and permanent storage area resided at
56 different file systems, then permanent file modification times were
57 incorrect.
58 Thanks to Maxim Dounin.
59
60 *) Bugfix: ngx_http_memcached_module might issue the error message
61 "memcached sent invalid trailer".
62 Thanks to Maxim Dounin.
63
64 *) Bugfix: nginx could not built zlib-1.2.4 library using the library
65 sources.
66 Thanks to Maxim Dounin.
67
68 *) Bugfix: values of the $query_string, $arg_..., etc. variables cached
69 in main request were used by the SSI module in subrequests.
70
71 *) Bugfix: nginx did not support HTTPS referrers.
72
73 *) Bugfix: nginx/Windows might not find file if path in configuration
74 was given in other character case; the bug had appeared in 0.7.65.
75
76 *) Bugfix: the $date_local variable has an incorrect value, if the "%s"
77 format was used.
78 Thanks to Maxim Dounin.
79
80 *) Bugfix: nginx did not support all ciphers and digests used in client
81 certificates.
82 Thanks to Innocenty Enikeew.
83
84 *) Bugfix: if ssl_session_cache was not set or was set to "none", then
85 during client certificate verify the error "session id context
86 uninitialized" might occur; the bug had appeared in 0.7.1.
87
88 *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux.
89 Thanks to Maxim Dounin.
90
91 *) Bugfix: a geo range returned default value if the range included two
92 or more /16 networks and did not begin at /16 network boundary.
93
94 *) Bugfix: the $uid_got variable might not be used in the SSI and perl
95 modules.
96
97 *) Bugfix: a worker process hung if a FIFO file was requested.
98 Thanks to Vicente Aguilar and Maxim Dounin.
99
100 *) Bugfix: a variable value was repeatedly encoded after each an "echo"
101 SSI-command output; the bug had appeared in 0.6.14.
102
103 *) Bugfix: a "stub" parameter of an "include" SSI directive was not
104 used, if empty response has 200 status code.
105
106 *) Bugfix: a block used in a "stub" parameter of an "include" SSI
107 directive was output with "text/plain" MIME type.
108
109 *) Bugfix: if a proxied or FastCGI request was internally redirected to
110 another proxied or FastCGI location, then a segmentation fault might
111 occur in a worker process; the bug had appeared in 0.7.65.
112 Thanks to Yichun Zhang.
113
114 *) Bugfix: IMAP connections may hang until they timed out while talking
115 to Zimbra server.
116 Thanks to Alan Batie.
117
118 *) Bugfix: nginx did not support chunked transfer encoding for 201
119 responses.
120 Thanks to Julian Reich.
121
122
2Changes with nginx 0.7.65 01 Feb 2010123Changes with nginx 0.7.65 01 Feb 2010
3124
4 *) Security: now nginx/Windows ignores trailing spaces in URI.125 *) Security: now nginx/Windows ignores trailing spaces in URI.
5126
=== modified file 'CHANGES.ru'
--- CHANGES.ru 2010-03-03 23:50:36 +0000
+++ CHANGES.ru 2010-07-21 11:15:58 +0000
@@ -1,4 +1,128 @@
11
2éÚÍÅÎÅÎÉÑ × nginx 0.7.67 15.06.2010
3
4 *) âÅÚÏÐÁÓÎÏÓÔØ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ nginx/Windows ÍÏÇ ÚÁ×ÅÒÛÁÔØÓÑ Á×ÁÒÉÊÎÏ
5 ÐÒÉ ÚÁÐÒÏÓÅ ÆÁÊÌÁ Ó ÎÅ×ÅÒÎÏÊ ËÏÄÉÒÏ×ËÏÊ UTF-8.
6
7
8éÚÍÅÎÅÎÉÑ × nginx 0.7.66 07.06.2010
9
10 *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÉÍÑ ÐÏÔÏËÁ ÆÁÊÌÁ ÐÏ
11 ÕÍÏÌÞÁÎÉÀ.
12 óÐÁÓÉÂÏ Jose Antonio Vazquez Gonzalez.
13
14 *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ charset-ÆÉÌØÔÒ ÒÁÂÏÔÁÅÔ ÄÏ SSI-ÆÉÌØÔÒÁ.
15
16 *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ × ÌÏÇ ÏÛÉÂÏË ÎÅ ÐÉÛÅÔÓÑ ÓÏÏÂÝÅÎÉÅ, ÅÓÌÉ ÐÅÒÅÍÅÎÎÁÑ
17 ÎÅ ÎÁÊÄÅÎÁ Ó ÐÏÍÏÝØÀ ÍÅÔÏÄÁ $r->variable().
18
19 *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ keepalive ÓÏÅÄÉÎÅÎÉÑ ÐÏÓÌÅ ÚÁÐÒÏÓÏ× POST ÎÅ
20 ÚÁÐÒÅÝÁÀÔÓÑ ÄÌÑ MSIE 7.0+.
21 óÐÁÓÉÂÏ Adam Lounds.
22
23 *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù proxy_no_cache É fastcgi_no_cache.
24
25 *) äÏÂÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÐÅÒÅÍÅÎÎÏÊ $scheme × ÄÉÒÅËÔÉ×Å
26 rewrite Á×ÔÏÍÁÔÉÞÅÓËÉ ÄÅÌÁÅÔÓÑ ÒÅÄÉÒÅËÔ.
27 óÐÁÓÉÂÏ Piotr Sikora.
28
29 *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Á chunked_transfer_encoding.
30
31 *) äÏÂÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÙÅ $geoip_city_continent_code, $geoip_latitude É
32 $geoip_longitude.
33 óÐÁÓÉÂÏ Arvind Sundararajan.
34
35 *) äÏÂÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ ngx_http_image_filter_module ÔÅÐÅÒØ ×ÓÅÇÄÁ
36 ÕÄÁÌÑÅÔ EXIF É ÄÒÕÇÉÅ ÄÁÎÎÙÅ, ÅÓÌÉ ÏÎÉ ÚÁÎÉÍÁÀÔ ÂÏÌØÛÅ 5% ×
37 JPEG-ÆÁÊÌÅ.
38
39 *) äÏÂÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÄÉÒÅËÔÉ×Á msie_padding ÒÁÂÏÔÁÅÔ É ÄÌÑ Chrome.
40
41 *) éÚÍÅÎÅÎÉÅ: ÔÅÐÅÒØ keepalive ÓÏÅÄÉÎÅÎÉÑ ÚÁÐÒÅÝÅÎÙ ÄÌÑ Safari.
42 óÐÁÓÉÂÏ Joshua Sierles.
43
44 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÉÇÎÏÒÉÒÏ×ÁÌ ÚÎÁÞÅÎÉÑ "private" É "no-store" ×
45 ÓÔÒÏËÅ "Cache-Control" × ÚÁÇÏÌÏ×ËÅ ÏÔ×ÅÔÁ ÂÜËÅÎÄÁ.
46
47 *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÉÍ×ÏÌ "&" ÐÒÉ ËÏÐÉÒÏ×ÁÎÉÉ × ÁÒÇÕÍÅÎÔÙ × ÐÒÁ×ÉÌÁÈ
48 rewrite ÎÅ ÜËÒÁÎÉÒÏ×ÁÌÓÑ.
49
50 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÍÏÇ ÚÁ×ÅÒÛÁÔØÓÑ Á×ÁÒÉÊÎÏ ×Ï ×ÒÅÍÑ ÏÂÒÁÂÏÔËÉ
51 ÓÉÇÎÁÌÁ ÉÌÉ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÄÉÒÅËÔÉ×Ù timer_resolution ÎÁ
52 ÐÌÁÔÆÏÒÍÁÈ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÍÅÔÏÄÙ kqueue ÉÌÉ eventport.
53 óÐÁÓÉÂÏ George Xie É íÁËÓÉÍÕ äÕÎÉÎÕ.
54
55 *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ×ÒÅÍÅÎÎÙÅ ÆÁÊÌÙ É ÐÏÓÔÏÑÎÎÏÅ ÍÅÓÔÏ ÈÒÁÎÅÎÉÑ
56 ÒÁÓÐÏÌÁÇÁÌÉÓØ ÎÁ ÒÁÚÎÙÈ ÆÁÊÌÏ×ÙÈ ÓÉÓÔÅÍÁÈ, ÔÏ Õ ÐÏÓÔÏÑÎÎÙÈ ÆÁÊÌÏ×
57 ×ÒÅÍÑ ÉÚÍÅÎÅÎÉÑ ÂÙÌÏ ÎÅ×ÅÒÎÙÍ.
58 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
59
60 *) éÓÐÒÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ ngx_http_memcached_module ÍÏÇ ×ÙÄÁ×ÁÔØ ÏÛÉÂËÕ
61 "memcached sent invalid trailer".
62 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
63
64 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÍÏÇ ÓÏÂÒÁÔØ ÂÉÂÌÉÏÔÅËÕ zlib-1.2.4 ÉÚ ÉÓÈÏÄÎÙÈ
65 ÔÅËÓÔÏ×.
66 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
67
68 *) éÓÐÒÁ×ÌÅÎÉÅ: ÍÏÄÕÌØ SSI × ÐÏÄÚÁÐÒÏÓÁÈ ÉÓÐÏÌØÚÏ×ÁÌ ÚÁËÜÛÉÒÏ×ÁÎÎÙÅ ×
69 ÏÓÎÏ×ÎÏÍ ÚÁÐÒÏÓÅ ÚÎÁÞÅÎÉÑ ÐÅÒÅÍÅÎÎÙÈ $query_string, $arg_... É ÉÍ
70 ÐÏÄÏÂÎÙÈ.
71
72 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ HTTPS-ÒÅÆÅÒÅÒÙ.
73
74 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx/Windows ÍÏÇ ÎÅ ÎÁÈÏÄÉÔØ ÆÁÊÌÙ, ÅÓÌÉ ÐÕÔØ ×
75 ËÏÎÆÉÇÕÒÁÃÉÉ ÂÙÌ ÚÁÄÁÎ × ÄÒÕÇÏÍ ÒÅÇÉÓÔÒÅ; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.65.
76
77 *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÁÑ $date_local ×ÙÄÁ×ÁÌÁ ÎÅ×ÅÒÎÏÅ ×ÒÅÍÑ, ÅÓÌÉ
78 ÉÓÐÏÌØÚÏ×ÁÌÓÑ ÆÏÒÍÁÔ "%s".
79 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
80
81 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ ×ÓÅ ÛÉÆÒÙ, ÉÓÐÏÌØÚÕÅÍÙÅ ×
82 ËÌÉÅÎÔÓËÉÈ ÓÅÒÔÉÆÉËÁÔÁÈ.
83 óÐÁÓÉÂÏ éÎÎÏËÅÎÔÉÀ åÎÉËÅÅ×Õ.
84
85 *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ssl_session_cache ÎÅ ÂÙÌ ÕÓÔÁÎÏ×ÌÅÎ ÉÌÉ ÕÓÔÁÎÏ×ÌÅÎ
86 × none, ÔÏ ÐÒÉ ÐÒÏ×ÅÒËÅ ËÌÉÅÎÔÓËÏÇÏ ÓÅÒÔÉÆÉËÁÔÙ ÍÏÇÌÁ ÐÒÏÉÓÈÏÄÉÔØ
87 ÏÛÉÂËÁ "session id context uninitialized"; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.7.1.
88
89 *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÏ×ÍÅÓÔÉÍÏÓÔØ Ó OpenSSL-1.0.0 ÎÁ 64-ÂÉÔÎÏÍ Linux.
90 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
91
92 *) éÓÐÒÁ×ÌÅÎÉÅ: geo-ÄÉÁÐÁÚÏÎ ×ÏÚ×ÒÁÝÁÌ ÚÎÁÞÅÎÉÅ ÐÏ ÕÍÏÌÞÁÎÉÀ, ÅÓÌÉ
93 ÄÉÁÐÁÚÏÎ ×ËÌÀÞÁÌ × ÓÅÂÑ ÏÄÎÕ É ÂÏÌÅÅ ÓÅÔÅÊ ÒÁÚÍÅÒÏÍ /16 É ÎÅ
94 ÎÁÞÉÎÁÌÓÑ ÎÁ ÇÒÁÎÉÃÅ ÓÅÔÉ ÒÁÚÍÅÒÏÍ /16.
95
96 *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÅÒÅÍÅÎÎÕÀ $uid_got ÎÅÌØÚÑ ÂÙÌÏ ÉÓÐÏÌØÚÏ×ÁÔØ × SSI É
97 ÐÅÒÌÏ×ÏÍ ÍÏÄÕÌÑÈ.
98
99 *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÚÁ×ÉÓÁÌ ÐÒÉ ÚÁÐÒÏÓÅ ÆÁÊÌÁ FIFO.
100 óÐÁÓÉÂÏ Vicente Aguilar É íÁËÓÉÍÕ äÕÎÉÎÕ.
101
102 *) éÓÐÒÁ×ÌÅÎÉÅ: ÚÎÁÞÅÎÉÅ ÐÅÒÅÍÅÎÎÏÊ ÐÏ×ÔÏÒÎÏ ÜËÒÁÎÉÒÏ×ÁÌÏÓØ ÐÏÓÌÅ
103 ËÁÖÄÏÇÏ ×Ù×ÏÄÁ SSI-ËÏÍÁÎÄÙ echo; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.6.14.
104
105 *) éÓÐÒÁ×ÌÅÎÉÅ: ÐÁÒÁÍÅÔÒ stub × SSI-ÄÉÒÅËÔÉ×Å include ÎÅ ÉÓÐÏÌØÚÏ×ÁÌÓÑ,
106 ÅÓÌÉ ÐÕÓÔÏÊ ÏÔ×ÅÔ ÉÍÅÌ ËÏÄ 200.
107
108 *) éÓÐÒÁ×ÌÅÎÉÅ: ÂÌÏË, ÉÓÐÏÌØÚÕÅÍÙÊ × ÐÁÒÁÍÅÔÒÅ stub × SSI-ÄÉÒÅËÔÉ×Å
109 include, ×Ù×ÏÄÉÌÓÑ Ó MIME-ÔÉÐÏÍ "text/plain".
110
111 *) éÓÐÒÁ×ÌÅÎÉÅ: ÅÓÌÉ ÐÒÏËÓÉÒÏ×ÁÎÎÙÊ ÉÌÉ FastCGI ÚÁÐÒÏÓ ×ÎÕÔÒÅÎÎÅ
112 ÐÅÒÅÎÁÐÒÁ×ÌÑÌÓÑ × ÄÒÕÇÏÊ ÐÒÏËÓÉÒÏ×ÁÎÎÙÊ ÉÌÉ FastCGI location, ÔÏ ×
113 ÒÁÂÏÞÅÍ ÐÒÏÃÅÓÓÅ ÍÏÇ ÐÒÏÉÚÏÊÔÉ segmentation fault; ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ
114 × 0.7.65.
115 óÐÁÓÉÂÏ Yichun Zhang.
116
117 *) éÓÐÒÁ×ÌÅÎÉÅ: ÓÏÅÄÉÎÅÎÉÑ IMAP Ë ÓÅÒ×ÅÒÕ Zimbra ÍÏÇÌÏ ÚÁ×ÉÓÎÕÔØ ÄÏ
118 ÔÁÊÍÁÕÔÁ.
119 óÐÁÓÉÂÏ Alan Batie.
120
121 *) éÓÐÒÁ×ÌÅÎÉÅ: nginx ÎÅ ÐÏÄÄÅÒÖÉ×ÁÌ ÐÅÒÅÄÁÞÕ chunk'ÁÍÉ ÄÌÑ 201-ÙÈ
122 ÏÔ×ÅÔÏ×.
123 óÐÁÓÉÂÏ Julian Reich.
124
125
2éÚÍÅÎÅÎÉÑ × nginx 0.7.65 01.02.2010126éÚÍÅÎÅÎÉÑ × nginx 0.7.65 01.02.2010
3127
4 *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÐÒÏÂÅÌÙ × ËÏÎÃÅ URI. 128 *) âÅÚÏÐÁÓÎÏÓÔØ: ÔÅÐÅÒØ nginx/Windows ÉÇÎÏÒÉÒÕÅÔ ÐÒÏÂÅÌÙ × ËÏÎÃÅ URI.
@@ -178,7 +302,7 @@
178302
179 *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù limit_req_log_level É limit_conn_log_level.303 *) äÏÂÁ×ÌÅÎÉÅ: ÄÉÒÅËÔÉ×Ù limit_req_log_level É limit_conn_log_level.
180304
181 *) éÓÐÒÁ×ÌÅÎÉÅ: ôÅÐÅÒØ ÄÉÒÅËÔÉ×Á limit_req ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÁÌÇÏÒÉÔÍÕ 305 *) éÓÐÒÁ×ÌÅÎÉÅ: ÔÅÐÅÒØ ÄÉÒÅËÔÉ×Á limit_req ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÁÌÇÏÒÉÔÍÕ
182 leaky bucket.306 leaky bucket.
183 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.307 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
184308
@@ -1648,7 +1772,7 @@
1648 óÐÁÓÉÂÏ áÎÄÒÅÀ îÉÇÍÁÔÕÌÉÎÕ.1772 óÐÁÓÉÂÏ áÎÄÒÅÀ îÉÇÍÁÔÕÌÉÎÕ.
16491773
1650 *) éÓÐÒÁ×ÌÅÎÉÅ: ngx_http_memcached_module ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÌ 1774 *) éÓÐÒÁ×ÌÅÎÉÅ: ngx_http_memcached_module ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÌ
1651 upstream_response_time.1775 $upstream_response_time.
1652 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.1776 óÐÁÓÉÂÏ íÁËÓÉÍÕ äÕÎÉÎÕ.
16531777
1654 *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÍÏÇ ÚÁÃÉËÌÉÔØÓÑ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ 1778 *) éÓÐÒÁ×ÌÅÎÉÅ: ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÍÏÇ ÚÁÃÉËÌÉÔØÓÑ ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ
16551779
=== modified file 'auto/cc/conf'
--- auto/cc/conf 2007-02-19 10:30:07 +0000
+++ auto/cc/conf 2010-07-21 11:15:58 +0000
@@ -104,6 +104,7 @@
104fi104fi
105105
106CFLAGS="$CFLAGS $NGX_CC_OPT"106CFLAGS="$CFLAGS $NGX_CC_OPT"
107NGX_TEST_LD_OPT="$NGX_LD_OPT"
107108
108109
109if [ "$NGX_PLATFORM" != win32 ]; then110if [ "$NGX_PLATFORM" != win32 ]; then
110111
=== modified file 'auto/cc/gcc'
--- auto/cc/gcc 2009-10-19 23:22:06 +0000
+++ auto/cc/gcc 2010-07-21 11:15:58 +0000
@@ -51,8 +51,6 @@
51#NGX_GCC_OPT="-Os"51#NGX_GCC_OPT="-Os"
52NGX_GCC_OPT="-O"52NGX_GCC_OPT="-O"
5353
54CFLAGS="$CFLAGS $NGX_GCC_OPT"
55
56#CFLAGS="$CFLAGS -fomit-frame-pointer"54#CFLAGS="$CFLAGS -fomit-frame-pointer"
5755
58case $CPU in56case $CPU in
5957
=== modified file 'auto/feature'
--- auto/feature 2008-09-02 20:48:58 +0000
+++ auto/feature 2010-07-21 11:15:58 +0000
@@ -39,7 +39,7 @@
3939
4040
41ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \41ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
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"
4343
44ngx_feature_inc_path=44ngx_feature_inc_path=
4545
4646
=== modified file 'auto/lib/openssl/conf'
--- auto/lib/openssl/conf 2010-03-03 23:50:36 +0000
+++ auto/lib/openssl/conf 2010-07-21 11:15:58 +0000
@@ -19,6 +19,8 @@
1919
20 # libeay32.lib requires gdi32.lib20 # libeay32.lib requires gdi32.lib
21 CORE_LIBS="$CORE_LIBS gdi32.lib"21 CORE_LIBS="$CORE_LIBS gdi32.lib"
22 # OpenSSL 1.0.0 requires crypt32.lib
23 CORE_LIBS="$CORE_LIBS crypt32.lib"
22 ;;24 ;;
2325
24 *)26 *)
2527
=== modified file 'auto/lib/openssl/make'
--- auto/lib/openssl/make 2010-03-03 23:50:36 +0000
+++ auto/lib/openssl/make 2010-07-21 11:15:58 +0000
@@ -57,7 +57,7 @@
57 && \$(MAKE) clean \\57 && \$(MAKE) clean \\
58 && ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\58 && ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\
59 && \$(MAKE) \\59 && \$(MAKE) \\
60 && \$(MAKE) install60 && \$(MAKE) install LIBDIR=lib
6161
62END62END
6363
6464
=== modified file 'auto/lib/openssl/makefile.bcc'
--- auto/lib/openssl/makefile.bcc 2009-10-19 23:22:06 +0000
+++ auto/lib/openssl/makefile.bcc 2010-07-21 11:15:58 +0000
@@ -5,8 +5,7 @@
5all:5all:
6 cd $(OPENSSL)6 cd $(OPENSSL)
77
8 perl Configure BC-32 no-shared --prefix=openssl -DNO_SYS_TYPES_H \8 perl Configure BC-32 no-shared --prefix=openssl $(OPENSSL_OPT)
9 $(OPENSSL_OPT)
109
11 ms\do_nasm10 ms\do_nasm
1211
1312
=== modified file 'auto/lib/openssl/makefile.msvc'
--- auto/lib/openssl/makefile.msvc 2009-10-19 23:22:06 +0000
+++ auto/lib/openssl/makefile.msvc 2010-07-21 11:15:58 +0000
@@ -5,8 +5,7 @@
5all:5all:
6 cd $(OPENSSL)6 cd $(OPENSSL)
77
8 perl Configure VC-WIN32 no-shared --prefix=openssl -DNO_SYS_TYPES_H \8 perl Configure VC-WIN32 no-shared --prefix=openssl $(OPENSSL_OPT)
9 $(OPENSSL_OPT)
109
11 ms\do_ms10 ms\do_ms
1211
1312
=== modified file 'auto/lib/zlib/make'
--- auto/lib/zlib/make 2009-10-19 23:22:06 +0000
+++ auto/lib/zlib/make 2010-07-21 11:15:58 +0000
@@ -53,7 +53,7 @@
5353
54$ZLIB/libz.a: $NGX_MAKEFILE54$ZLIB/libz.a: $NGX_MAKEFILE
55 cd $ZLIB \\55 cd $ZLIB \\
56 && \$(MAKE) clean \\56 && \$(MAKE) distclean \\
57 && cp contrib/asm586/match.S . \\57 && cp contrib/asm586/match.S . \\
58 && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\58 && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
59 ./configure \\59 ./configure \\
@@ -70,7 +70,7 @@
7070
71$ZLIB/libz.a: $NGX_MAKEFILE71$ZLIB/libz.a: $NGX_MAKEFILE
72 cd $ZLIB \\72 cd $ZLIB \\
73 && \$(MAKE) clean \\73 && \$(MAKE) distclean \\
74 && cp contrib/asm686/match.S . \\74 && cp contrib/asm686/match.S . \\
75 && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\75 && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
76 ./configure \\76 ./configure \\
@@ -103,7 +103,7 @@
103103
104$ZLIB/libz.a: $NGX_MAKEFILE104$ZLIB/libz.a: $NGX_MAKEFILE
105 cd $ZLIB \\105 cd $ZLIB \\
106 && \$(MAKE) clean \\106 && \$(MAKE) distclean \\
107 && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\107 && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
108 ./configure \\108 ./configure \\
109 && \$(MAKE) libz.a109 && \$(MAKE) libz.a
110110
=== modified file 'auto/modules'
--- auto/modules 2009-11-30 13:34:00 +0000
+++ auto/modules 2010-07-21 11:15:58 +0000
@@ -101,8 +101,8 @@
101# ngx_http_range_header_filter101# ngx_http_range_header_filter
102# ngx_http_gzip_filter102# ngx_http_gzip_filter
103# ngx_http_postpone_filter103# ngx_http_postpone_filter
104# ngx_http_ssi_filter
104# ngx_http_charset_filter105# ngx_http_charset_filter
105# ngx_http_ssi_filter
106# ngx_http_xslt_filter106# ngx_http_xslt_filter
107# ngx_http_image_filter_filter107# ngx_http_image_filter_filter
108# ngx_http_sub_filter108# ngx_http_sub_filter
@@ -130,19 +130,19 @@
130 HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"130 HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
131fi131fi
132132
133if [ $HTTP_SSI = YES ]; then
134 have=NGX_HTTP_SSI . auto/have
135 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
136 HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
137 HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
138fi
139
133if [ $HTTP_CHARSET = YES ]; then140if [ $HTTP_CHARSET = YES ]; then
134 have=NGX_HTTP_CHARSET . auto/have141 have=NGX_HTTP_CHARSET . auto/have
135 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE"142 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE"
136 HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS"143 HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS"
137fi144fi
138145
139if [ $HTTP_SSI = YES ]; then
140 have=NGX_HTTP_SSI . auto/have
141 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
142 HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
143 HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
144fi
145
146if [ $HTTP_XSLT = YES ]; then146if [ $HTTP_XSLT = YES ]; then
147 USE_LIBXSLT=YES147 USE_LIBXSLT=YES
148 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE"148 HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE"
149149
=== modified file 'auto/unix'
--- auto/unix 2009-10-19 23:22:06 +0000
+++ auto/unix 2010-07-21 11:15:58 +0000
@@ -133,6 +133,16 @@
133. auto/feature133. auto/feature
134134
135135
136ngx_feature="sys_errlist[]"
137ngx_feature_name="NGX_HAVE_SYS_ERRLIST"
138ngx_feature_run=yes
139ngx_feature_incs="#include <stdio.h>"
140ngx_feature_path=
141ngx_feature_libs=
142ngx_feature_test="int n = sys_nerr; const char *p = sys_errlist[1];"
143. auto/feature
144
145
136ngx_feature="localtime_r()"146ngx_feature="localtime_r()"
137ngx_feature_name="NGX_HAVE_LOCALTIME_R"147ngx_feature_name="NGX_HAVE_LOCALTIME_R"
138ngx_feature_run=no148ngx_feature_run=no
139149
=== added file 'debian/README.Debian'
--- debian/README.Debian 1970-01-01 00:00:00 +0000
+++ debian/README.Debian 2010-07-21 11:15:58 +0000
@@ -0,0 +1,9 @@
1README for Debian
2-----------------
3
4 Files under /var/www/ are not supported as per Debian Policy.
5 Please see: http://lintian.debian.org/tags/dir-or-file-in-var-www.html and,
6 http://www.pathname.com/fhs/pub/fhs-2.3.html#THEVARHIERARCHY for more
7 details and explanations.
8
9 -- Kartik Mistry <kartik@debian.org> Fri, 05 Mar 2010 13:31:15 +0530
010
=== modified file 'debian/changelog'
--- debian/changelog 2010-03-05 01:36:05 +0000
+++ debian/changelog 2010-07-21 11:15:58 +0000
@@ -1,3 +1,104 @@
1nginx (0.7.67-2ubuntu1) maverick; urgency=low
2
3 * Merge from Debian unstable (LP: #608172) Remaining changes:
4 + debian/rules:
5 with-http_dav_module
6 with-http_geoip_module
7 with-http_gzip_static_module
8 with-http_realip_module
9 with-http_sub_module
10 + .pc/applied-patches
11 fix_reloading_ipv6.diff
12
13 -- Mikhail Turov <groldster@gmail.com> Wed, 21 Jul 2010 11:57:53 +0100
14
15nginx (0.7.67-2) unstable; urgency=low
16
17 * debian/conf/sites-available/default:
18 + Removed reference to SSLv2 protocol (Closes: #589139)
19 * debian/control:
20 + Updated Standards-Version to 3.9.0
21 * debian/copyright:
22 + Don't point to BSD license file, included exact upstream version of
23 license text
24 + Added missing copyright owner for contrib/ scripts
25 + debian/* license is same as upstream now as discussed with co-maintainers
26
27 -- Kartik Mistry <kartik@debian.org> Mon, 19 Jul 2010 10:36:32 +0530
28
29nginx (0.7.67-1) unstable; urgency=low
30
31 * New upstream release
32
33 -- Kartik Mistry <kartik@debian.org> Wed, 16 Jun 2010 01:26:51 +0530
34
35nginx (0.7.65-7) unstable; urgency=low
36
37 [Kartik Mistry]
38 * debian/rules:
39 + Enabled HTTPSubModule module in configure (Closes: #584828)
40 + Arranged configure options in better manner
41
42 -- Kartik Mistry <kartik@debian.org> Mon, 07 Jun 2010 14:33:24 +0530
43
44nginx (0.7.65-6) unstable; urgency=low
45
46 [Kartik Mistry]
47 * debian/README.Debian:
48 + Fixed typo and somewhat better wordings
49 * debian/conf/mime.types:
50 + Added entry to support 7zip files (Closes: #580423)
51 * debian/init.d:
52 + Do not print config testing info until an error found, Thanks to Ubuntu
53 bug 568293
54 * debian/copyright:
55 + Updated as per DEP-5 specification
56
57 -- Kartik Mistry <kartik@debian.org> Sat, 22 May 2010 01:41:33 +0530
58
59nginx (0.7.65-5) unstable; urgency=low
60
61 [Kartik Mistry]
62 * debian/patches/fix_reloading_ipv6.diff:
63 + Added patch to fix reloading with IPv6 addresses, Thanks to
64 Matthias-Christian Ott <ott@mirix.org> for patch (Closes: #577456)
65
66 -- Kartik Mistry <kartik@debian.org> Wed, 14 Apr 2010 11:36:48 +0530
67
68nginx (0.7.65-4) unstable; urgency=low
69
70 [Kartik Mistry]
71 * debian/conf/sites-available/default:
72 + Really listen for both IPv4 and IPv6 addresses. Thanks to Nikolaus
73 Schulz <microschulz@web.de> for notice (Closes: #574983)
74 * debian/control, debian/rules:
75 + Added GeoIP support, Thanks to Caetano Carezzato
76 <caetano@vision.ime.usp.br> (Closes: #575280)
77 * debian/conf/mime.types:
78 + Added svg entry to mime.types, Jeremy Lal <kapouer@melix.org>
79 (Closes: #575155)
80
81 -- Kartik Mistry <kartik@debian.org> Thu, 25 Mar 2010 00:21:50 +0530
82
83nginx (0.7.65-3) unstable; urgency=medium
84
85 [Kartik Mistry]
86 * Urgency set to medium due to Release Goal
87 * debian/conf/sites-available/default:
88 + Listen for both IPv4 and IPv6 addresses by default (Closes: #574983)
89
90 -- Kartik Mistry <kartik@debian.org> Tue, 23 Mar 2010 10:30:18 +0530
91
92nginx (0.7.65-2) unstable; urgency=low
93
94 * debian/README.Debian:
95 + Added explanation about not installing files in /var/www/
96 (Closes: #572513)
97 * debian/rules:
98 + Readded realip module support (Closes: #507419)
99
100 -- Kartik Mistry <kartik@debian.org> Sat, 06 Mar 2010 13:14:48 +0530
101
1nginx (0.7.65-1ubuntu2) lucid; urgency=low102nginx (0.7.65-1ubuntu2) lucid; urgency=low
2103
3 * Re-enable http_realip_module (debian/rules).104 * Re-enable http_realip_module (debian/rules).
4105
=== modified file 'debian/conf/mime.types'
--- debian/conf/mime.types 2007-12-08 11:27:54 +0000
+++ debian/conf/mime.types 2010-07-21 11:15:58 +0000
@@ -20,6 +20,7 @@
20 image/x-icon ico;20 image/x-icon ico;
21 image/x-jng jng;21 image/x-jng jng;
22 image/x-ms-bmp bmp;22 image/x-ms-bmp bmp;
23 image/svg+xml svg svgz;
2324
24 application/java-archive jar war ear;25 application/java-archive jar war ear;
25 application/mac-binhex40 hqx;26 application/mac-binhex40 hqx;
@@ -31,6 +32,7 @@
31 application/vnd.ms-powerpoint ppt;32 application/vnd.ms-powerpoint ppt;
32 application/vnd.wap.wmlc wmlc;33 application/vnd.wap.wmlc wmlc;
33 application/vnd.wap.xhtml+xml xhtml;34 application/vnd.wap.xhtml+xml xhtml;
35 application/x-7z-compressed 7z;
34 application/x-cocoa cco;36 application/x-cocoa cco;
35 application/x-java-archive-diff jardiff;37 application/x-java-archive-diff jardiff;
36 application/x-java-jnlp-file jnlp;38 application/x-java-jnlp-file jnlp;
3739
=== modified file 'debian/conf/sites-available/default'
--- debian/conf/sites-available/default 2010-02-01 23:44:21 +0000
+++ debian/conf/sites-available/default 2010-07-21 11:15:58 +0000
@@ -5,13 +5,16 @@
5# statements for each of your virtual hosts5# statements for each of your virtual hosts
66
7server {7server {
8 listen 80 default;8
9 listen 80; ## listen for ipv4
10 listen [::]:80 default ipv6only=on; ## listen for ipv6
11
9 server_name localhost;12 server_name localhost;
1013
11 access_log /var/log/nginx/localhost.access.log;14 access_log /var/log/nginx/localhost.access.log;
1215
13 location / {16 location / {
14 root /var/www/nginx-default;17 root /var/www;
15 index index.html index.htm;18 index index.html index.htm;
16 }19 }
1720
@@ -86,8 +89,8 @@
8689
87#ssl_session_timeout 5m;90#ssl_session_timeout 5m;
8891
89#ssl_protocols SSLv2 SSLv3 TLSv1;92#ssl_protocols SSLv3 TLSv1;
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;
91#ssl_prefer_server_ciphers on;94#ssl_prefer_server_ciphers on;
9295
93#location / {96#location / {
9497
=== modified file 'debian/control'
--- debian/control 2010-03-03 23:50:36 +0000
+++ debian/control 2010-07-21 11:15:58 +0000
@@ -7,10 +7,11 @@
7 Kartik Mistry <kartik@debian.org>7 Kartik Mistry <kartik@debian.org>
8Build-Depends: debhelper (>= 7),8Build-Depends: debhelper (>= 7),
9 autotools-dev,9 autotools-dev,
10 libgeoip-dev,
10 libssl-dev,11 libssl-dev,
11 libpcre3-dev,12 libpcre3-dev,
12 zlib1g-dev13 zlib1g-dev
13Standards-Version: 3.8.414Standards-Version: 3.9.0
14Homepage: http://nginx.net15Homepage: http://nginx.net
15Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/nginx/trunk16Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/nginx/trunk
16Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/nginx/trunk17Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/nginx/trunk
1718
=== modified file 'debian/copyright'
--- debian/copyright 2010-02-05 11:20:28 +0000
+++ debian/copyright 2010-07-21 11:15:58 +0000
@@ -1,39 +1,40 @@
1This package was debianized by Jose Parrella <joseparrella@cantv.net> on1Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
2Tue, 5 Sep 2006 11:33:34 -0400.2Name: nginx
33Maintainer: Jose Parrella <joseparrella@cantv.net>
4It was downloaded from http://nginx.net/4Source: http://nginx.net/
5
6Upstream Author: Igor Sysoev <igor@sysoev.ru>5Upstream Author: Igor Sysoev <igor@sysoev.ru>
76
8Copyright © 2002-2010 Igor Sysoev <igor@sysoev.ru>7Files: *
98Copyright: © 2002-2010, Igor Sysoev <igor@sysoev.ru>
10License: BSD9License: BSD
1110 Redistribution and use in source and binary forms, with or without
12 Redistribution and use in source and binary forms, with or without11 modification, are permitted provided that the following conditions are met:
13 modification, are permitted provided that the following conditions12 .
14 are met:13 1. Redistributions of source code must retain the above copyright notice, this
15 1. Redistributions of source code must retain the above copyright14 list of conditions and the following disclaimer.
16 notice, this list of conditions and the following disclaimer.15 2. Redistributions in binary form must reproduce the above copyright notice,
17 2. Redistributions in binary form must reproduce the above copyright16 this list of conditions and the following disclaimer in the documentation
18 notice, this list of conditions and the following disclaimer in the17 and/or other materials provided with the distribution.
19 documentation and/or other materials provided with the distribution.18 .
2019 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
21 THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND20 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
24 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE23 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF29
31 SUCH DAMAGE.30Files: contrib/geo2nginx.pl
3231Copyright: © 2005, Andrei Nigmatulin
33On Debian systems, the complete text of the BSD License can be found in32
34`/usr/share/common-licenses/BSD'.33Files: modules/nginx-upstream-fair/ngx_http_upstream_fair_module.c
3534Copyright: © 2007, Igor Sysoev, Grzegorz Nosek
36The Debian packaging is © 2006-2010, Jose Parrella <joseparrella@cantv.net>,35
37Fabio Tranchitella <kobold@debian.org> and © 2009-2010, Kartik Mistry36Files: debian/*
38<kartik@debian.org> and is licensed under the GPL-2 or later, see37Copyright: © 2006-2010, Jose Parrella <joseparrella@cantv.net>,
39`/usr/share/common-licenses/GPL-2' and `/usr/share/common-licenses/GPL-3'.38 Fabio Tranchitella <kobold@debian.org>
39 © 2009-2010, Kartik Mistry <kartik@debian.org>
40License: Same as upstream license.
4041
=== modified file 'debian/init.d'
--- debian/init.d 2010-03-03 23:50:36 +0000
+++ debian/init.d 2010-07-21 11:15:58 +0000
@@ -27,10 +27,11 @@
27. /lib/lsb/init-functions27. /lib/lsb/init-functions
2828
29test_nginx_config() {29test_nginx_config() {
30 if nginx -t $DAEMON_OPTS30 if $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1
31 then31 then
32 return 032 return 0
33 else33 else
34 $DAEMON -t $DAEMON_OPTS
34 return $?35 return $?
35 fi36 fi
36}37}
3738
=== added file 'debian/patches/fix_reloading_ipv6.diff'
--- debian/patches/fix_reloading_ipv6.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/fix_reloading_ipv6.diff 2010-07-21 11:15:58 +0000
@@ -0,0 +1,15 @@
1Description: Patch to fix reloading IPv6 addresses
2Debian Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577456
3Author: Matthias-Christian Ott <ott@mirix.org>
4
5--- nginx-0.7.65.orig/src/core/ngx_cycle.c 2010-04-13 10:07:14.000000000 +0530
6+++ nginx-0.7.65/src/core/ngx_cycle.c 2010-04-13 10:09:59.000000000 +0530
7@@ -847,7 +847,7 @@
8 sin61 = (struct sockaddr_in6 *) sa1;
9 sin62 = (struct sockaddr_in6 *) sa2;
10
11- if (sin61->sin6_port != sin61->sin6_port) {
12+ if (sin61->sin6_port != sin62->sin6_port) {
13 return NGX_DECLINED;
14 }
15
016
=== modified file 'debian/patches/nginx-upstream-fair.diff' (properties changed: +x to -x)
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-02-01 23:44:21 +0000
+++ debian/patches/series 2010-07-21 11:15:58 +0000
@@ -1,2 +1,3 @@
1nginx-upstream-fair.diff1nginx-upstream-fair.diff
2dlopen.diff2dlopen.diff
3fix_reloading_ipv6.diff
34
=== modified file 'debian/rules'
--- debian/rules 2010-03-05 01:36:05 +0000
+++ debian/rules 2010-07-21 11:15:58 +0000
@@ -23,19 +23,24 @@
23endif23endif
24 ./configure --conf-path=/etc/nginx/nginx.conf \24 ./configure --conf-path=/etc/nginx/nginx.conf \
25 --error-log-path=/var/log/nginx/error.log \25 --error-log-path=/var/log/nginx/error.log \
26 --pid-path=/var/run/nginx.pid \26 --http-client-body-temp-path=/var/lib/nginx/body \
27 --lock-path=/var/lock/nginx.lock \27 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
28 --http-log-path=/var/log/nginx/access.log \28 --http-log-path=/var/log/nginx/access.log \
29 --http-client-body-temp-path=/var/lib/nginx/body \
30 --http-proxy-temp-path=/var/lib/nginx/proxy \29 --http-proxy-temp-path=/var/lib/nginx/proxy \
31 --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \30 --lock-path=/var/lock/nginx.lock \
31 --pid-path=/var/run/nginx.pid \
32 --with-debug \32 --with-debug \
33 --with-http_dav_module \
34 --with-http_flv_module \
35 --with-http_geoip_module \
36 --with-http_gzip_static_module \
37 --with-http_realip_module \
33 --with-http_stub_status_module \38 --with-http_stub_status_module \
34 --with-http_flv_module \
35 --with-http_ssl_module \39 --with-http_ssl_module \
36 --with-http_dav_module \40 --with-http_dav_module \
37 --with-http_gzip_static_module \41 --with-http_gzip_static_module \
38 --with-http_realip_module \42 --with-http_realip_module \
43 --with-http_sub_module \
39 --with-mail \44 --with-mail \
40 --with-mail_ssl_module \45 --with-mail_ssl_module \
41 --with-ipv6 \46 --with-ipv6 \
4247
=== modified file 'src/core/nginx.h'
--- src/core/nginx.h 2010-03-03 23:50:36 +0000
+++ src/core/nginx.h 2010-07-21 11:15:58 +0000
@@ -8,8 +8,8 @@
8#define _NGINX_H_INCLUDED_8#define _NGINX_H_INCLUDED_
99
1010
11#define nginx_version 706511#define nginx_version 7067
12#define NGINX_VERSION "0.7.65"12#define NGINX_VERSION "0.7.67"
13#define NGINX_VER "nginx/" NGINX_VERSION13#define NGINX_VER "nginx/" NGINX_VERSION
1414
15#define NGINX_VAR "NGINX"15#define NGINX_VAR "NGINX"
1616
=== modified file 'src/core/ngx_cycle.c'
--- src/core/ngx_cycle.c 2009-11-30 13:34:00 +0000
+++ src/core/ngx_cycle.c 2010-07-21 11:15:58 +0000
@@ -63,7 +63,7 @@
63 tp = ngx_timeofday();63 tp = ngx_timeofday();
64 tp->sec = 0;64 tp->sec = 0;
6565
66 ngx_time_update(0, 0);66 ngx_time_update();
6767
6868
69 log = old_cycle->log;69 log = old_cycle->log;
@@ -847,7 +847,7 @@
847 sin61 = (struct sockaddr_in6 *) sa1;847 sin61 = (struct sockaddr_in6 *) sa1;
848 sin62 = (struct sockaddr_in6 *) sa2;848 sin62 = (struct sockaddr_in6 *) sa2;
849849
850 if (sin61->sin6_port != sin61->sin6_port) {850 if (sin61->sin6_port != sin62->sin6_port) {
851 return NGX_DECLINED;851 return NGX_DECLINED;
852 }852 }
853853
854854
=== modified file 'src/core/ngx_file.c'
--- src/core/ngx_file.c 2010-03-03 23:50:36 +0000
+++ src/core/ngx_file.c 2010-07-21 11:15:58 +0000
@@ -762,10 +762,12 @@
762 size -= n;762 size -= n;
763 }763 }
764764
765 if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {765 if (cf->time != -1) {
766 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,766 if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
767 ngx_set_file_time_n " \"%s\" failed", to);767 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
768 goto failed;768 ngx_set_file_time_n " \"%s\" failed", to);
769 goto failed;
770 }
769 }771 }
770772
771 rc = NGX_OK;773 rc = NGX_OK;
772774
=== modified file 'src/core/ngx_open_file_cache.c'
--- src/core/ngx_open_file_cache.c 2010-03-03 23:50:36 +0000
+++ src/core/ngx_open_file_cache.c 2010-07-21 11:15:58 +0000
@@ -487,7 +487,14 @@
487 }487 }
488488
489 if (!of->log) {489 if (!of->log) {
490 fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);490
491 /*
492 * Use non-blocking open() not to hang on FIFO files, etc.
493 * This flag has no effect on a regular files.
494 */
495
496 fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
497 NGX_FILE_OPEN, 0);
491498
492 } else {499 } else {
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,
494501
=== modified file 'src/core/ngx_string.c'
--- src/core/ngx_string.c 2010-03-03 23:50:36 +0000
+++ src/core/ngx_string.c 2010-07-21 11:15:58 +0000
@@ -1277,13 +1277,13 @@
1277 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */1277 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */
1278 };1278 };
12791279
1280 /* " ", "#", "%", "+", "?", %00-%1F, %7F-%FF */1280 /* " ", "#", "%", "&", "+", "?", %00-%1F, %7F-%FF */
12811281
1282 static uint32_t args[] = {1282 static uint32_t args[] = {
1283 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */1283 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
12841284
1285 /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */1285 /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */
1286 0x80000829, /* 1000 0000 0000 0000 0000 1000 0010 1001 */1286 0x80000869, /* 1000 0000 0000 0000 0000 1000 0110 1001 */
12871287
1288 /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */1288 /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
1289 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */1289 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */
12901290
=== modified file 'src/core/ngx_times.c'
--- src/core/ngx_times.c 2009-10-19 23:22:06 +0000
+++ src/core/ngx_times.c 2010-07-21 11:15:58 +0000
@@ -28,6 +28,17 @@
28volatile ngx_str_t ngx_cached_http_time;28volatile ngx_str_t ngx_cached_http_time;
29volatile ngx_str_t ngx_cached_http_log_time;29volatile ngx_str_t ngx_cached_http_log_time;
3030
31#if !(NGX_WIN32)
32
33/*
34 * locatime() and localtime_r() are not Async-Signal-Safe functions, therefore,
35 * they must not be called by a signal handler, so we use the cached
36 * GMT offset value. Fortunately the value is changed only two times a year.
37 */
38
39static ngx_int_t cached_gmtoff;
40#endif
41
31static ngx_time_t cached_time[NGX_TIME_SLOTS];42static ngx_time_t cached_time[NGX_TIME_SLOTS];
32static u_char cached_err_log_time[NGX_TIME_SLOTS]43static u_char cached_err_log_time[NGX_TIME_SLOTS]
33 [sizeof("1970/09/28 12:00:00")];44 [sizeof("1970/09/28 12:00:00")];
@@ -50,15 +61,17 @@
5061
51 ngx_cached_time = &cached_time[0];62 ngx_cached_time = &cached_time[0];
5263
53 ngx_time_update(0, 0);64 ngx_time_update();
54}65}
5566
5667
57void68void
58ngx_time_update(time_t sec, ngx_uint_t msec)69ngx_time_update(void)
59{70{
60 u_char *p0, *p1, *p2;71 u_char *p0, *p1, *p2;
61 ngx_tm_t tm, gmt;72 ngx_tm_t tm, gmt;
73 time_t sec;
74 ngx_uint_t msec;
62 ngx_time_t *tp;75 ngx_time_t *tp;
63 struct timeval tv;76 struct timeval tv;
6477
@@ -66,12 +79,10 @@
66 return;79 return;
67 }80 }
6881
69 if (sec == 0) {82 ngx_gettimeofday(&tv);
70 ngx_gettimeofday(&tv);
7183
72 sec = tv.tv_sec;84 sec = tv.tv_sec;
73 msec = tv.tv_usec / 1000;85 msec = tv.tv_usec / 1000;
74 }
7586
76 ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;87 ngx_current_msec = (ngx_msec_t) sec * 1000 + msec;
7788
@@ -112,12 +123,14 @@
112#elif (NGX_HAVE_GMTOFF)123#elif (NGX_HAVE_GMTOFF)
113124
114 ngx_localtime(sec, &tm);125 ngx_localtime(sec, &tm);
115 tp->gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60);126 cached_gmtoff = (ngx_int_t) (tm.ngx_tm_gmtoff / 60);
127 tp->gmtoff = cached_gmtoff;
116128
117#else129#else
118130
119 ngx_localtime(sec, &tm);131 ngx_localtime(sec, &tm);
120 tp->gmtoff = ngx_timezone(tm.ngx_tm_isdst);132 cached_gmtoff = ngx_timezone(tm.ngx_tm_isdst);
133 tp->gmtoff = cached_gmtoff;
121134
122#endif135#endif
123136
@@ -151,6 +164,57 @@
151}164}
152165
153166
167#if !(NGX_WIN32)
168
169void
170ngx_time_sigsafe_update(void)
171{
172 u_char *p;
173 ngx_tm_t tm;
174 time_t sec;
175 ngx_time_t *tp;
176 struct timeval tv;
177
178 if (!ngx_trylock(&ngx_time_lock)) {
179 return;
180 }
181
182 ngx_gettimeofday(&tv);
183
184 sec = tv.tv_sec;
185
186 tp = &cached_time[slot];
187
188 if (tp->sec == sec) {
189 ngx_unlock(&ngx_time_lock);
190 return;
191 }
192
193 if (slot == NGX_TIME_SLOTS - 1) {
194 slot = 0;
195 } else {
196 slot++;
197 }
198
199 ngx_gmtime(sec + cached_gmtoff * 60, &tm);
200
201 p = &cached_err_log_time[slot][0];
202
203 (void) ngx_sprintf(p, "%4d/%02d/%02d %02d:%02d:%02d",
204 tm.ngx_tm_year, tm.ngx_tm_mon,
205 tm.ngx_tm_mday, tm.ngx_tm_hour,
206 tm.ngx_tm_min, tm.ngx_tm_sec);
207
208 ngx_memory_barrier();
209
210 ngx_cached_err_log_time.data = p;
211
212 ngx_unlock(&ngx_time_lock);
213}
214
215#endif
216
217
154u_char *218u_char *
155ngx_http_time(u_char *buf, time_t t)219ngx_http_time(u_char *buf, time_t t)
156{220{
157221
=== modified file 'src/core/ngx_times.h'
--- src/core/ngx_times.h 2009-10-19 23:22:06 +0000
+++ src/core/ngx_times.h 2010-07-21 11:15:58 +0000
@@ -20,7 +20,8 @@
2020
2121
22void ngx_time_init(void);22void ngx_time_init(void);
23void ngx_time_update(time_t sec, ngx_uint_t msec);23void ngx_time_update(void);
24void ngx_time_sigsafe_update(void);
24u_char *ngx_http_time(u_char *buf, time_t t);25u_char *ngx_http_time(u_char *buf, time_t t);
25u_char *ngx_http_cookie_time(u_char *buf, time_t t);26u_char *ngx_http_cookie_time(u_char *buf, time_t t);
26void ngx_gmtime(time_t t, ngx_tm_t *tp);27void ngx_gmtime(time_t t, ngx_tm_t *tp);
2728
=== modified file 'src/event/modules/ngx_devpoll_module.c'
--- src/event/modules/ngx_devpoll_module.c 2009-11-08 09:53:46 +0000
+++ src/event/modules/ngx_devpoll_module.c 2010-07-21 11:15:58 +0000
@@ -375,8 +375,8 @@
375 err = 0;375 err = 0;
376 }376 }
377377
378 if (flags & NGX_UPDATE_TIME) {378 if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
379 ngx_time_update(0, 0);379 ngx_time_update();
380 }380 }
381381
382 if (err) {382 if (err) {
383383
=== modified file 'src/event/modules/ngx_epoll_module.c'
--- src/event/modules/ngx_epoll_module.c 2009-11-08 09:53:46 +0000
+++ src/event/modules/ngx_epoll_module.c 2010-07-21 11:15:58 +0000
@@ -407,8 +407,8 @@
407 err = 0;407 err = 0;
408 }408 }
409409
410 if (flags & NGX_UPDATE_TIME) {410 if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
411 ngx_time_update(0, 0);411 ngx_time_update();
412 }412 }
413413
414 if (err) {414 if (err) {
415415
=== modified file 'src/event/modules/ngx_eventport_module.c'
--- src/event/modules/ngx_eventport_module.c 2009-11-08 09:53:46 +0000
+++ src/event/modules/ngx_eventport_module.c 2010-07-21 11:15:58 +0000
@@ -405,7 +405,7 @@
405 err = ngx_errno;405 err = ngx_errno;
406406
407 if (flags & NGX_UPDATE_TIME) {407 if (flags & NGX_UPDATE_TIME) {
408 ngx_time_update(0, 0);408 ngx_time_update();
409 }409 }
410410
411 if (n == -1) {411 if (n == -1) {
@@ -439,7 +439,7 @@
439 for (i = 0; i < events; i++) {439 for (i = 0; i < events; i++) {
440440
441 if (event_list[i].portev_source == PORT_SOURCE_TIMER) {441 if (event_list[i].portev_source == PORT_SOURCE_TIMER) {
442 ngx_time_update(0, 0);442 ngx_time_update();
443 continue;443 continue;
444 }444 }
445445
446446
=== modified file 'src/event/modules/ngx_kqueue_module.c'
--- src/event/modules/ngx_kqueue_module.c 2009-11-30 13:34:00 +0000
+++ src/event/modules/ngx_kqueue_module.c 2010-07-21 11:15:58 +0000
@@ -543,8 +543,8 @@
543 err = 0;543 err = 0;
544 }544 }
545545
546 if (flags & NGX_UPDATE_TIME) {546 if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
547 ngx_time_update(0, 0);547 ngx_time_update();
548 }548 }
549549
550 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,550 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
@@ -595,7 +595,7 @@
595#if (NGX_HAVE_TIMER_EVENT)595#if (NGX_HAVE_TIMER_EVENT)
596596
597 if (event_list[i].filter == EVFILT_TIMER) {597 if (event_list[i].filter == EVFILT_TIMER) {
598 ngx_time_update(0, 0);598 ngx_time_update();
599 continue;599 continue;
600 }600 }
601601
602602
=== modified file 'src/event/modules/ngx_poll_module.c'
--- src/event/modules/ngx_poll_module.c 2007-12-08 11:27:54 +0000
+++ src/event/modules/ngx_poll_module.c 2010-07-21 11:15:58 +0000
@@ -266,8 +266,8 @@
266 err = 0;266 err = 0;
267 }267 }
268268
269 if (flags & NGX_UPDATE_TIME) {269 if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
270 ngx_time_update(0, 0);270 ngx_time_update();
271 }271 }
272272
273 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,273 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
274274
=== modified file 'src/event/modules/ngx_rtsig_module.c'
--- src/event/modules/ngx_rtsig_module.c 2009-11-08 09:53:46 +0000
+++ src/event/modules/ngx_rtsig_module.c 2010-07-21 11:15:58 +0000
@@ -323,7 +323,7 @@
323 "rtsig signo:%d", signo);323 "rtsig signo:%d", signo);
324324
325 if (flags & NGX_UPDATE_TIME) {325 if (flags & NGX_UPDATE_TIME) {
326 ngx_time_update(0, 0);326 ngx_time_update();
327 }327 }
328328
329 if (err == NGX_EAGAIN) {329 if (err == NGX_EAGAIN) {
@@ -349,7 +349,7 @@
349 signo, si.si_fd, si.si_band);349 signo, si.si_fd, si.si_band);
350350
351 if (flags & NGX_UPDATE_TIME) {351 if (flags & NGX_UPDATE_TIME) {
352 ngx_time_update(0, 0);352 ngx_time_update();
353 }353 }
354354
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);
@@ -419,7 +419,7 @@
419419
420 } else if (signo == SIGALRM) {420 } else if (signo == SIGALRM) {
421421
422 ngx_time_update(0, 0);422 ngx_time_update();
423423
424 return NGX_OK;424 return NGX_OK;
425425
@@ -671,7 +671,7 @@
671 }671 }
672672
673 if (flags & NGX_UPDATE_TIME) {673 if (flags & NGX_UPDATE_TIME) {
674 ngx_time_update(0, 0);674 ngx_time_update();
675 }675 }
676676
677 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,677 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
678678
=== modified file 'src/event/modules/ngx_select_module.c'
--- src/event/modules/ngx_select_module.c 2009-10-19 23:22:06 +0000
+++ src/event/modules/ngx_select_module.c 2010-07-21 11:15:58 +0000
@@ -266,8 +266,8 @@
266 err = 0;266 err = 0;
267 }267 }
268268
269 if (flags & NGX_UPDATE_TIME) {269 if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
270 ngx_time_update(0, 0);270 ngx_time_update();
271 }271 }
272272
273 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,273 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
274274
=== modified file 'src/event/modules/ngx_win32_select_module.c'
--- src/event/modules/ngx_win32_select_module.c 2009-10-19 23:22:06 +0000
+++ src/event/modules/ngx_win32_select_module.c 2010-07-21 11:15:58 +0000
@@ -273,7 +273,7 @@
273 }273 }
274274
275 if (flags & NGX_UPDATE_TIME) {275 if (flags & NGX_UPDATE_TIME) {
276 ngx_time_update(0, 0);276 ngx_time_update();
277 }277 }
278278
279 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,279 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
280280
=== modified file 'src/event/ngx_event.c'
--- src/event/ngx_event.c 2009-11-30 13:34:00 +0000
+++ src/event/ngx_event.c 2010-07-21 11:15:58 +0000
@@ -562,8 +562,6 @@
562{562{
563 ngx_event_timer_alarm = 1;563 ngx_event_timer_alarm = 1;
564564
565 ngx_time_update(0, 0);
566
567#if 1565#if 1
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");
569#endif567#endif
570568
=== modified file 'src/event/ngx_event_openssl.c'
--- src/event/ngx_event_openssl.c 2010-03-03 23:50:36 +0000
+++ src/event/ngx_event_openssl.c 2010-07-21 11:15:58 +0000
@@ -106,6 +106,8 @@
106106
107 ENGINE_load_builtin_engines();107 ENGINE_load_builtin_engines();
108108
109 OpenSSL_add_all_algorithms();
110
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);
110112
111 if (ngx_ssl_connection_index == -1) {113 if (ngx_ssl_connection_index == -1) {
@@ -559,6 +561,9 @@
559#if (NGX_DEBUG)561#if (NGX_DEBUG)
560 {562 {
561 char buf[129], *s, *d;563 char buf[129], *s, *d;
564#if OPENSSL_VERSION_NUMBER >= 0x1000000fL
565 const
566#endif
562 SSL_CIPHER *cipher;567 SSL_CIPHER *cipher;
563568
564 cipher = SSL_get_current_cipher(c->ssl->connection);569 cipher = SSL_get_current_cipher(c->ssl->connection);
@@ -1308,10 +1313,14 @@
13081313
1309 /* handshake failures */1314 /* handshake failures */
1310 if (n == SSL_R_DIGEST_CHECK_FAILED /* 149 */1315 if (n == SSL_R_DIGEST_CHECK_FAILED /* 149 */
1316 || n == SSL_R_LENGTH_MISMATCH /* 159 */
1311 || n == SSL_R_NO_CIPHERS_PASSED /* 182 */1317 || n == SSL_R_NO_CIPHERS_PASSED /* 182 */
1318 || n == SSL_R_NO_CIPHERS_SPECIFIED /* 183 */
1312 || n == SSL_R_NO_SHARED_CIPHER /* 193 */1319 || n == SSL_R_NO_SHARED_CIPHER /* 193 */
1320 || n == SSL_R_RECORD_LENGTH_MISMATCH /* 213 */
1313 || n == SSL_R_UNEXPECTED_MESSAGE /* 244 */1321 || n == SSL_R_UNEXPECTED_MESSAGE /* 244 */
1314 || n == SSL_R_UNEXPECTED_RECORD /* 245 */1322 || n == SSL_R_UNEXPECTED_RECORD /* 245 */
1323 || n == SSL_R_UNKNOWN_ALERT_TYPE /* 246 */
1315 || n == SSL_R_UNKNOWN_PROTOCOL /* 252 */1324 || n == SSL_R_UNKNOWN_PROTOCOL /* 252 */
1316 || n == SSL_R_WRONG_VERSION_NUMBER /* 267 */1325 || n == SSL_R_WRONG_VERSION_NUMBER /* 267 */
1317 || n == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC /* 281 */1326 || n == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC /* 281 */
@@ -1424,6 +1433,8 @@
1424 return NGX_OK;1433 return NGX_OK;
1425 }1434 }
14261435
1436 SSL_CTX_set_session_id_context(ssl->ctx, sess_ctx->data, sess_ctx->len);
1437
1427 if (builtin_session_cache == NGX_SSL_NONE_SCACHE) {1438 if (builtin_session_cache == NGX_SSL_NONE_SCACHE) {
14281439
1429 /*1440 /*
@@ -1455,8 +1466,6 @@
14551466
1456 SSL_CTX_set_session_cache_mode(ssl->ctx, cache_mode);1467 SSL_CTX_set_session_cache_mode(ssl->ctx, cache_mode);
14571468
1458 SSL_CTX_set_session_id_context(ssl->ctx, sess_ctx->data, sess_ctx->len);
1459
1460 if (builtin_session_cache != NGX_SSL_NO_BUILTIN_SCACHE) {1469 if (builtin_session_cache != NGX_SSL_NO_BUILTIN_SCACHE) {
14611470
1462 if (builtin_session_cache != NGX_SSL_DFLT_BUILTIN_SCACHE) {1471 if (builtin_session_cache != NGX_SSL_DFLT_BUILTIN_SCACHE) {
@@ -2311,5 +2320,6 @@
2311static void2320static void
2312ngx_openssl_exit(ngx_cycle_t *cycle)2321ngx_openssl_exit(ngx_cycle_t *cycle)
2313{2322{
2323 EVP_cleanup();
2314 ENGINE_cleanup();2324 ENGINE_cleanup();
2315}2325}
23162326
=== modified file 'src/event/ngx_event_openssl.h'
--- src/event/ngx_event_openssl.h 2010-03-03 23:50:36 +0000
+++ src/event/ngx_event_openssl.h 2010-07-21 11:15:58 +0000
@@ -15,6 +15,7 @@
15#include <openssl/err.h>15#include <openssl/err.h>
16#include <openssl/conf.h>16#include <openssl/conf.h>
17#include <openssl/engine.h>17#include <openssl/engine.h>
18#include <openssl/evp.h>
1819
19#define NGX_SSL_NAME "OpenSSL"20#define NGX_SSL_NAME "OpenSSL"
2021
2122
=== modified file 'src/http/modules/ngx_http_autoindex_module.c'
--- src/http/modules/ngx_http_autoindex_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_autoindex_module.c 2010-07-21 11:15:58 +0000
@@ -160,10 +160,6 @@
160 return NGX_DECLINED;160 return NGX_DECLINED;
161 }161 }
162162
163 if (r->zero_in_uri) {
164 return NGX_DECLINED;
165 }
166
167 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {163 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
168 return NGX_DECLINED;164 return NGX_DECLINED;
169 }165 }
170166
=== modified file 'src/http/modules/ngx_http_chunked_filter_module.c'
--- src/http/modules/ngx_http_chunked_filter_module.c 2009-10-19 23:22:06 +0000
+++ src/http/modules/ngx_http_chunked_filter_module.c 2010-07-21 11:15:58 +0000
@@ -50,9 +50,10 @@
50static ngx_int_t50static ngx_int_t
51ngx_http_chunked_header_filter(ngx_http_request_t *r)51ngx_http_chunked_header_filter(ngx_http_request_t *r)
52{52{
53 ngx_http_core_loc_conf_t *clcf;
54
53 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED55 if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
54 || r->headers_out.status == NGX_HTTP_NO_CONTENT56 || r->headers_out.status == NGX_HTTP_NO_CONTENT
55 || r->headers_out.status == NGX_HTTP_CREATED
56 || r != r->main57 || r != r->main
57 || (r->method & NGX_HTTP_HEAD))58 || (r->method & NGX_HTTP_HEAD))
58 {59 {
@@ -64,7 +65,14 @@
64 r->keepalive = 0;65 r->keepalive = 0;
6566
66 } else {67 } else {
67 r->chunked = 1;68 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
69
70 if (clcf->chunked_transfer_encoding) {
71 r->chunked = 1;
72
73 } else {
74 r->keepalive = 0;
75 }
68 }76 }
69 }77 }
7078
7179
=== modified file 'src/http/modules/ngx_http_dav_module.c'
--- src/http/modules/ngx_http_dav_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_dav_module.c 2010-07-21 11:15:58 +0000
@@ -146,10 +146,6 @@
146 ngx_int_t rc;146 ngx_int_t rc;
147 ngx_http_dav_loc_conf_t *dlcf;147 ngx_http_dav_loc_conf_t *dlcf;
148148
149 if (r->zero_in_uri) {
150 return NGX_DECLINED;
151 }
152
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);
154150
155 if (!(r->method & dlcf->methods)) {151 if (!(r->method & dlcf->methods)) {
@@ -325,13 +321,13 @@
325 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,321 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
326 "http delete filename: \"%s\"", path.data);322 "http delete filename: \"%s\"", path.data);
327323
328 if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) {324 if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
329 err = ngx_errno;325 err = ngx_errno;
330326
331 rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND;327 rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND;
332328
333 return ngx_http_dav_error(r->connection->log, err,329 return ngx_http_dav_error(r->connection->log, err,
334 rc, ngx_file_info_n, path.data);330 rc, ngx_link_info_n, path.data);
335 }331 }
336332
337 if (ngx_is_dir(&fi)) {333 if (ngx_is_dir(&fi)) {
@@ -358,7 +354,7 @@
358354
359 /*355 /*
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] == '/')
361 * because ngx_file_info("/file/") returned NGX_ENOTDIR above357 * because ngx_link_info("/file/") returned NGX_ENOTDIR above
362 */358 */
363359
364 depth = ngx_http_dav_depth(r, 0);360 depth = ngx_http_dav_depth(r, 0);
@@ -685,12 +681,12 @@
685 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,681 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
686 "http copy to: \"%s\"", copy.path.data);682 "http copy to: \"%s\"", copy.path.data);
687683
688 if (ngx_file_info(copy.path.data, &fi) == NGX_FILE_ERROR) {684 if (ngx_link_info(copy.path.data, &fi) == NGX_FILE_ERROR) {
689 err = ngx_errno;685 err = ngx_errno;
690686
691 if (err != NGX_ENOENT) {687 if (err != NGX_ENOENT) {
692 return ngx_http_dav_error(r->connection->log, err,688 return ngx_http_dav_error(r->connection->log, err,
693 NGX_HTTP_NOT_FOUND, ngx_file_info_n,689 NGX_HTTP_NOT_FOUND, ngx_link_info_n,
694 copy.path.data);690 copy.path.data);
695 }691 }
696692
@@ -719,9 +715,9 @@
719 dir = ngx_is_dir(&fi);715 dir = ngx_is_dir(&fi);
720 }716 }
721717
722 if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) {718 if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
723 return ngx_http_dav_error(r->connection->log, ngx_errno,719 return ngx_http_dav_error(r->connection->log, ngx_errno,
724 NGX_HTTP_NOT_FOUND, ngx_file_info_n,720 NGX_HTTP_NOT_FOUND, ngx_link_info_n,
725 path.data);721 path.data);
726 }722 }
727723
728724
=== modified file 'src/http/modules/ngx_http_fastcgi_module.c'
--- src/http/modules/ngx_http_fastcgi_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/ngx_http_fastcgi_module.c 2010-07-21 11:15:58 +0000
@@ -333,6 +333,13 @@
333 0,333 0,
334 &ngx_http_fastcgi_module },334 &ngx_http_fastcgi_module },
335335
336 { ngx_string("fastcgi_no_cache"),
337 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
338 ngx_http_no_cache_set_slot,
339 NGX_HTTP_LOC_CONF_OFFSET,
340 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
341 NULL },
342
336 { ngx_string("fastcgi_cache_valid"),343 { ngx_string("fastcgi_cache_valid"),
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,
338 ngx_http_file_cache_valid_set_slot,345 ngx_http_file_cache_valid_set_slot,
@@ -1890,6 +1897,7 @@
1890#if (NGX_HTTP_CACHE)1897#if (NGX_HTTP_CACHE)
1891 conf->upstream.cache = NGX_CONF_UNSET_PTR;1898 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1892 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;1899 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1900 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1893 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;1901 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1894#endif1902#endif
18951903
@@ -2111,6 +2119,9 @@
21112119
2112 conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;2120 conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
21132121
2122 ngx_conf_merge_ptr_value(conf->upstream.no_cache,
2123 prev->upstream.no_cache, NULL);
2124
2114 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,2125 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
2115 prev->upstream.cache_valid, NULL);2126 prev->upstream.cache_valid, NULL);
21162127
21172128
=== modified file 'src/http/modules/ngx_http_flv_module.c'
--- src/http/modules/ngx_http_flv_module.c 2009-10-19 23:22:06 +0000
+++ src/http/modules/ngx_http_flv_module.c 2010-07-21 11:15:58 +0000
@@ -80,10 +80,6 @@
80 return NGX_DECLINED;80 return NGX_DECLINED;
81 }81 }
8282
83 if (r->zero_in_uri) {
84 return NGX_DECLINED;
85 }
86
87 rc = ngx_http_discard_request_body(r);83 rc = ngx_http_discard_request_body(r);
8884
89 if (rc != NGX_OK) {85 if (rc != NGX_OK) {
9086
=== modified file 'src/http/modules/ngx_http_geo_module.c'
--- src/http/modules/ngx_http_geo_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_geo_module.c 2010-07-21 11:15:58 +0000
@@ -589,7 +589,7 @@
589 ngx_array_t *a;589 ngx_array_t *a;
590 ngx_http_geo_range_t *range;590 ngx_http_geo_range_t *range;
591591
592 for (n = start; n <= end; n += 0x10000) {592 for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {
593593
594 h = n >> 16;594 h = n >> 16;
595595
596596
=== modified file 'src/http/modules/ngx_http_geoip_module.c'
--- src/http/modules/ngx_http_geoip_module.c 2009-11-08 09:53:46 +0000
+++ src/http/modules/ngx_http_geoip_module.c 2010-07-21 11:15:58 +0000
@@ -30,6 +30,9 @@
30 ngx_http_variable_value_t *v, uintptr_t data);30 ngx_http_variable_value_t *v, uintptr_t data);
31static ngx_int_t ngx_http_geoip_city_variable(ngx_http_request_t *r,31static ngx_int_t ngx_http_geoip_city_variable(ngx_http_request_t *r,
32 ngx_http_variable_value_t *v, uintptr_t data);32 ngx_http_variable_value_t *v, uintptr_t data);
33static ngx_int_t ngx_http_geoip_city_float_variable(ngx_http_request_t *r,
34 ngx_http_variable_value_t *v, uintptr_t data);
35static GeoIPRecord *ngx_http_geoip_get_city_record(ngx_http_request_t *r);
3336
34static ngx_int_t ngx_http_geoip_add_variables(ngx_conf_t *cf);37static ngx_int_t ngx_http_geoip_add_variables(ngx_conf_t *cf);
35static void *ngx_http_geoip_create_conf(ngx_conf_t *cf);38static void *ngx_http_geoip_create_conf(ngx_conf_t *cf);
@@ -93,23 +96,32 @@
9396
94static ngx_http_variable_t ngx_http_geoip_vars[] = {97static ngx_http_variable_t ngx_http_geoip_vars[] = {
9598
96 { ngx_string("geoip_country_code"), NULL, ngx_http_geoip_country_variable,99 { ngx_string("geoip_country_code"), NULL,
100 ngx_http_geoip_country_variable,
97 (uintptr_t) GeoIP_country_code_by_ipnum, 0, 0 },101 (uintptr_t) GeoIP_country_code_by_ipnum, 0, 0 },
98102
99 { ngx_string("geoip_country_code3"), NULL, ngx_http_geoip_country_variable,103 { ngx_string("geoip_country_code3"), NULL,
104 ngx_http_geoip_country_variable,
100 (uintptr_t) GeoIP_country_code3_by_ipnum, 0, 0 },105 (uintptr_t) GeoIP_country_code3_by_ipnum, 0, 0 },
101106
102 { ngx_string("geoip_country_name"), NULL, ngx_http_geoip_country_variable,107 { ngx_string("geoip_country_name"), NULL,
108 ngx_http_geoip_country_variable,
103 (uintptr_t) GeoIP_country_name_by_ipnum, 0, 0 },109 (uintptr_t) GeoIP_country_name_by_ipnum, 0, 0 },
104110
105 { ngx_string("geoip_city_country_code"), NULL, ngx_http_geoip_city_variable,111 { ngx_string("geoip_city_continent_code"), NULL,
112 ngx_http_geoip_city_variable,
113 offsetof(GeoIPRecord, continent_code), 0, 0 },
114
115 { ngx_string("geoip_city_country_code"), NULL,
116 ngx_http_geoip_city_variable,
106 offsetof(GeoIPRecord, country_code), 0, 0 },117 offsetof(GeoIPRecord, country_code), 0, 0 },
107118
108 { ngx_string("geoip_city_country_code3"), NULL,119 { ngx_string("geoip_city_country_code3"), NULL,
109 ngx_http_geoip_city_variable,120 ngx_http_geoip_city_variable,
110 offsetof(GeoIPRecord, country_code3), 0, 0 },121 offsetof(GeoIPRecord, country_code3), 0, 0 },
111122
112 { ngx_string("geoip_city_country_name"), NULL, ngx_http_geoip_city_variable,123 { ngx_string("geoip_city_country_name"), NULL,
124 ngx_http_geoip_city_variable,
113 offsetof(GeoIPRecord, country_name), 0, 0 },125 offsetof(GeoIPRecord, country_name), 0, 0 },
114126
115 { ngx_string("geoip_region"), NULL,127 { ngx_string("geoip_region"), NULL,
@@ -124,6 +136,14 @@
124 ngx_http_geoip_city_variable,136 ngx_http_geoip_city_variable,
125 offsetof(GeoIPRecord, postal_code), 0, 0 },137 offsetof(GeoIPRecord, postal_code), 0, 0 },
126138
139 { ngx_string("geoip_latitude"), NULL,
140 ngx_http_geoip_city_float_variable,
141 offsetof(GeoIPRecord, latitude), 0, 0 },
142
143 { ngx_string("geoip_longitude"), NULL,
144 ngx_http_geoip_city_float_variable,
145 offsetof(GeoIPRecord, longitude), 0, 0 },
146
127 { ngx_null_string, NULL, NULL, 0, 0, 0 }147 { ngx_null_string, NULL, NULL, 0, 0, 0 }
128};148};
129149
@@ -179,34 +199,16 @@
179ngx_http_geoip_city_variable(ngx_http_request_t *r,199ngx_http_geoip_city_variable(ngx_http_request_t *r,
180 ngx_http_variable_value_t *v, uintptr_t data)200 ngx_http_variable_value_t *v, uintptr_t data)
181{201{
182 u_long addr;202 char *val;
183 char *val;203 size_t len;
184 size_t len;204 GeoIPRecord *gr;
185 GeoIPRecord *gr;205
186 struct sockaddr_in *sin;206 gr = ngx_http_geoip_get_city_record(r);
187 ngx_http_geoip_conf_t *gcf;
188
189 gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
190
191 if (gcf->city == NULL) {
192 goto not_found;
193 }
194
195 if (r->connection->sockaddr->sa_family != AF_INET) {
196 goto not_found;
197 }
198
199 sin = (struct sockaddr_in *) r->connection->sockaddr;
200 addr = ntohl(sin->sin_addr.s_addr);
201
202 gr = GeoIP_record_by_ipnum(gcf->city, addr);
203
204 if (gr == NULL) {207 if (gr == NULL) {
205 goto not_found;208 goto not_found;
206 }209 }
207210
208 val = *(char **) ((char *) gr + data);211 val = *(char **) ((char *) gr + data);
209
210 if (val == NULL) {212 if (val == NULL) {
211 goto no_value;213 goto no_value;
212 }214 }
@@ -243,6 +245,56 @@
243245
244246
245static ngx_int_t247static ngx_int_t
248ngx_http_geoip_city_float_variable(ngx_http_request_t *r,
249 ngx_http_variable_value_t *v, uintptr_t data)
250{
251 float val;
252 GeoIPRecord *gr;
253
254 gr = ngx_http_geoip_get_city_record(r);
255 if (gr == NULL) {
256 v->not_found = 1;
257 return NGX_OK;
258 }
259
260 v->data = ngx_pnalloc(r->pool, NGX_INT64_LEN + 5);
261 if (v->data == NULL) {
262 GeoIPRecord_delete(gr);
263 return NGX_ERROR;
264 }
265
266 val = *(float *) ((char *) gr + data);
267
268 v->len = ngx_sprintf(v->data, "%.4f", val) - v->data;
269
270 GeoIPRecord_delete(gr);
271
272 return NGX_OK;
273}
274
275
276static GeoIPRecord *
277ngx_http_geoip_get_city_record(ngx_http_request_t *r)
278{
279 u_long addr;
280 struct sockaddr_in *sin;
281 ngx_http_geoip_conf_t *gcf;
282
283 gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
284
285 if (gcf->city && r->connection->sockaddr->sa_family == AF_INET) {
286
287 sin = (struct sockaddr_in *) r->connection->sockaddr;
288 addr = ntohl(sin->sin_addr.s_addr);
289
290 return GeoIP_record_by_ipnum(gcf->city, addr);
291 }
292
293 return NULL;
294}
295
296
297static ngx_int_t
246ngx_http_geoip_add_variables(ngx_conf_t *cf)298ngx_http_geoip_add_variables(ngx_conf_t *cf)
247{299{
248 ngx_http_variable_t *var, *v;300 ngx_http_variable_t *var, *v;
249301
=== modified file 'src/http/modules/ngx_http_gzip_static_module.c'
--- src/http/modules/ngx_http_gzip_static_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/ngx_http_gzip_static_module.c 2010-07-21 11:15:58 +0000
@@ -89,10 +89,6 @@
89 return NGX_DECLINED;89 return NGX_DECLINED;
90 }90 }
9191
92 if (r->zero_in_uri) {
93 return NGX_DECLINED;
94 }
95
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);
9793
98 if (!gzcf->enable) {94 if (!gzcf->enable) {
@@ -179,7 +175,7 @@
179#if !(NGX_WIN32) /* the not regular files are probably Unix specific */175#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
180176
181 if (!of.is_file) {177 if (!of.is_file) {
182 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno,178 ngx_log_error(NGX_LOG_CRIT, log, 0,
183 "\"%s\" is not a regular file", path.data);179 "\"%s\" is not a regular file", path.data);
184180
185 return NGX_HTTP_NOT_FOUND;181 return NGX_HTTP_NOT_FOUND;
186182
=== modified file 'src/http/modules/ngx_http_image_filter_module.c'
--- src/http/modules/ngx_http_image_filter_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_image_filter_module.c 2010-07-21 11:15:58 +0000
@@ -63,6 +63,7 @@
6363
64 ngx_uint_t phase;64 ngx_uint_t phase;
65 ngx_uint_t type;65 ngx_uint_t type;
66 ngx_uint_t force;
66} ngx_http_image_filter_ctx_t;67} ngx_http_image_filter_ctx_t;
6768
6869
@@ -501,7 +502,8 @@
501502
502 if (rc == NGX_OK503 if (rc == NGX_OK
503 && ctx->width <= ctx->max_width504 && ctx->width <= ctx->max_width
504 && ctx->height <= ctx->max_height)505 && ctx->height <= ctx->max_height
506 && !ctx->force)
505 {507 {
506 return ngx_http_image_asis(r, ctx);508 return ngx_http_image_asis(r, ctx);
507 }509 }
@@ -601,6 +603,7 @@
601ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)603ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
602{604{
603 u_char *p, *last;605 u_char *p, *last;
606 size_t len, app;
604 ngx_uint_t width, height;607 ngx_uint_t width, height;
605608
606 p = ctx->image;609 p = ctx->image;
@@ -611,26 +614,38 @@
611614
612 p += 2;615 p += 2;
613 last = ctx->image + ctx->length - 10;616 last = ctx->image + ctx->length - 10;
617 width = 0;
618 height = 0;
619 app = 0;
614620
615 while (p < last) {621 while (p < last) {
616622
617 if (p[0] == 0xff && p[1] != 0xff) {623 if (p[0] == 0xff && p[1] != 0xff) {
618624
619 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,625 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
620 "JPEG: %02xd %02xd", *p, *(p + 1));626 "JPEG: %02xd %02xd", p[0], p[1]);
621627
622 p++;628 p++;
623629
624 if (*p == 0xc0 || *p == 0xc1 || *p == 0xc2 || *p == 0xc3630 if ((*p == 0xc0 || *p == 0xc1 || *p == 0xc2 || *p == 0xc3
625 || *p == 0xc9 || *p == 0xca || *p == 0xcb)631 || *p == 0xc9 || *p == 0xca || *p == 0xcb)
632 && (width == 0 || height == 0))
626 {633 {
627 goto found;634 width = p[6] * 256 + p[7];
635 height = p[4] * 256 + p[5];
628 }636 }
629637
630 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,638 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
631 "JPEG: %02xd %02xd", p[1], p[2]);639 "JPEG: %02xd %02xd", p[1], p[2]);
632640
633 p += p[1] * 256 + p[2];641 len = p[1] * 256 + p[2];
642
643 if (*p >= 0xe1 && *p <= 0xef) {
644 /* application data, e.g., EXIF, Adobe XMP, etc. */
645 app += len;
646 }
647
648 p += len;
634649
635 continue;650 continue;
636 }651 }
@@ -638,12 +653,16 @@
638 p++;653 p++;
639 }654 }
640655
641 return NGX_DECLINED;656 if (width == 0 || height == 0) {
642657 return NGX_DECLINED;
643 found:658 }
644659
645 width = p[6] * 256 + p[7];660 if (ctx->length / 20 < app) {
646 height = p[4] * 256 + p[5];661 /* force conversion if application data consume more than 5% */
662 ctx->force = 1;
663 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
664 "app data size: %uz", app);
665 }
647666
648 break;667 break;
649668
@@ -708,7 +727,8 @@
708727
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);
710729
711 if ((ngx_uint_t) sx <= ctx->max_width730 if (!ctx->force
731 && (ngx_uint_t) sx <= ctx->max_width
712 && (ngx_uint_t) sy <= ctx->max_height)732 && (ngx_uint_t) sy <= ctx->max_height)
713 {733 {
714 gdImageDestroy(src);734 gdImageDestroy(src);
715735
=== modified file 'src/http/modules/ngx_http_index_module.c'
--- src/http/modules/ngx_http_index_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/ngx_http_index_module.c 2010-07-21 11:15:58 +0000
@@ -116,10 +116,6 @@
116 return NGX_DECLINED;116 return NGX_DECLINED;
117 }117 }
118118
119 if (r->zero_in_uri) {
120 return NGX_DECLINED;
121 }
122
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);
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);
125121
126122
=== modified file 'src/http/modules/ngx_http_memcached_module.c'
--- src/http/modules/ngx_http_memcached_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_memcached_module.c 2010-07-21 11:15:58 +0000
@@ -423,15 +423,20 @@
423423
424 if (ngx_strncmp(b->last,424 if (ngx_strncmp(b->last,
425 ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,425 ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
426 ctx->rest)426 bytes)
427 != 0)427 != 0)
428 {428 {
429 ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,429 ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
430 "memcached sent invalid trailer");430 "memcached sent invalid trailer");
431
432 u->length = 0;
433 ctx->rest = 0;
434
435 return NGX_OK;
431 }436 }
432437
433 u->length = 0;438 u->length -= bytes;
434 ctx->rest = 0;439 ctx->rest -= bytes;
435440
436 return NGX_OK;441 return NGX_OK;
437 }442 }
438443
=== modified file 'src/http/modules/ngx_http_proxy_module.c'
--- src/http/modules/ngx_http_proxy_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/ngx_http_proxy_module.c 2010-07-21 11:15:58 +0000
@@ -357,6 +357,13 @@
357 0,357 0,
358 &ngx_http_proxy_module },358 &ngx_http_proxy_module },
359359
360 { ngx_string("proxy_no_cache"),
361 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
362 ngx_http_no_cache_set_slot,
363 NGX_HTTP_LOC_CONF_OFFSET,
364 offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
365 NULL },
366
360 { ngx_string("proxy_cache_valid"),367 { ngx_string("proxy_cache_valid"),
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,
362 ngx_http_file_cache_valid_set_slot,369 ngx_http_file_cache_valid_set_slot,
@@ -630,6 +637,7 @@
630 u->process_header = ngx_http_proxy_process_status_line;637 u->process_header = ngx_http_proxy_process_status_line;
631 u->abort_request = ngx_http_proxy_abort_request;638 u->abort_request = ngx_http_proxy_abort_request;
632 u->finalize_request = ngx_http_proxy_finalize_request;639 u->finalize_request = ngx_http_proxy_finalize_request;
640 r->state = 0;
633641
634 if (plcf->redirects) {642 if (plcf->redirects) {
635 u->rewrite_redirect = ngx_http_proxy_rewrite_redirect;643 u->rewrite_redirect = ngx_http_proxy_rewrite_redirect;
@@ -1191,6 +1199,7 @@
1191 ctx->status_end = NULL;1199 ctx->status_end = NULL;
11921200
1193 r->upstream->process_header = ngx_http_proxy_process_status_line;1201 r->upstream->process_header = ngx_http_proxy_process_status_line;
1202 r->state = 0;
11941203
1195 return NGX_OK;1204 return NGX_OK;
1196}1205}
@@ -1906,7 +1915,7 @@
1906 * conf->body_set_len = NULL;1915 * conf->body_set_len = NULL;
1907 * conf->body_set = NULL;1916 * conf->body_set = NULL;
1908 * conf->body_source = { 0, NULL };1917 * conf->body_source = { 0, NULL };
1909 * conf->rewrite_locations = NULL;1918 * conf->redirects = NULL;
1910 */1919 */
19111920
1912 conf->upstream.store = NGX_CONF_UNSET;1921 conf->upstream.store = NGX_CONF_UNSET;
@@ -1931,6 +1940,7 @@
1931#if (NGX_HTTP_CACHE)1940#if (NGX_HTTP_CACHE)
1932 conf->upstream.cache = NGX_CONF_UNSET_PTR;1941 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1933 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;1942 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1943 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1934 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;1944 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1935#endif1945#endif
19361946
@@ -2155,6 +2165,9 @@
2155 |NGX_HTTP_UPSTREAM_FT_OFF;2165 |NGX_HTTP_UPSTREAM_FT_OFF;
2156 }2166 }
21572167
2168 ngx_conf_merge_ptr_value(conf->upstream.no_cache,
2169 prev->upstream.no_cache, NULL);
2170
2158 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,2171 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
2159 prev->upstream.cache_valid, NULL);2172 prev->upstream.cache_valid, NULL);
21602173
@@ -2747,9 +2760,16 @@
2747 }2760 }
27482761
2749 if (ngx_strcmp(value[1].data, "default") == 0) {2762 if (ngx_strcmp(value[1].data, "default") == 0) {
2763 if (plcf->proxy_lengths) {
2764 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2765 "\"proxy_redirect default\" may not be used "
2766 "with \"proxy_pass\" directive with variables");
2767 return NGX_CONF_ERROR;
2768 }
2769
2750 if (plcf->url.data == NULL) {2770 if (plcf->url.data == NULL) {
2751 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,2771 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2752 "\"proxy_rewrite_location default\" must go "2772 "\"proxy_redirect default\" must go "
2753 "after the \"proxy_pass\" directive");2773 "after the \"proxy_pass\" directive");
2754 return NGX_CONF_ERROR;2774 return NGX_CONF_ERROR;
2755 }2775 }
27562776
=== modified file 'src/http/modules/ngx_http_random_index_module.c'
--- src/http/modules/ngx_http_random_index_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/ngx_http_random_index_module.c 2010-07-21 11:15:58 +0000
@@ -86,10 +86,6 @@
86 return NGX_DECLINED;86 return NGX_DECLINED;
87 }87 }
8888
89 if (r->zero_in_uri) {
90 return NGX_DECLINED;
91 }
92
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))) {
94 return NGX_DECLINED;90 return NGX_DECLINED;
95 }91 }
9692
=== modified file 'src/http/modules/ngx_http_referer_module.c'
--- src/http/modules/ngx_http_referer_module.c 2009-11-27 11:10:18 +0000
+++ src/http/modules/ngx_http_referer_module.c 2010-07-21 11:15:58 +0000
@@ -124,18 +124,27 @@
124 len = r->headers_in.referer->value.len;124 len = r->headers_in.referer->value.len;
125 ref = r->headers_in.referer->value.data;125 ref = r->headers_in.referer->value.data;
126126
127 if (len < sizeof("http://i.ru") - 1127 if (len >= sizeof("http://i.ru") - 1) {
128 || (ngx_strncasecmp(ref, (u_char *) "http://", 7) != 0))128 last = ref + len;
129 {129
130 if (rlcf->blocked_referer) {130 if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
131 goto valid;131 ref += 7;
132 goto valid_scheme;
133
134 } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
135 ref += 8;
136 goto valid_scheme;
132 }137 }
133138 }
134 goto invalid;139
135 }140 if (rlcf->blocked_referer) {
136141 goto valid;
137 last = ref + len;142 }
138 ref += 7;143
144 goto invalid;
145
146valid_scheme:
147
139 i = 0;148 i = 0;
140 key = 0;149 key = 0;
141150
142151
=== modified file 'src/http/modules/ngx_http_rewrite_module.c'
--- src/http/modules/ngx_http_rewrite_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_rewrite_module.c 2010-07-21 11:15:58 +0000
@@ -340,13 +340,10 @@
340340
341 last = 0;341 last = 0;
342342
343 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0) {343 if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0
344 regex->status = NGX_HTTP_MOVED_TEMPORARILY;344 || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0
345 regex->redirect = 1;345 || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0)
346 last = 1;346 {
347 }
348
349 if (ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0) {
350 regex->status = NGX_HTTP_MOVED_TEMPORARILY;347 regex->status = NGX_HTTP_MOVED_TEMPORARILY;
351 regex->redirect = 1;348 regex->redirect = 1;
352 last = 1;349 last = 1;
353350
=== modified file 'src/http/modules/ngx_http_ssi_filter_module.c'
--- src/http/modules/ngx_http_ssi_filter_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_ssi_filter_module.c 2010-07-21 11:15:58 +0000
@@ -14,7 +14,6 @@
1414
15#define NGX_HTTP_SSI_ADD_PREFIX 115#define NGX_HTTP_SSI_ADD_PREFIX 1
16#define NGX_HTTP_SSI_ADD_ZERO 216#define NGX_HTTP_SSI_ADD_ZERO 2
17#define NGX_HTTP_SSI_EXPR_TEST 4
1817
1918
20typedef struct {19typedef struct {
@@ -1701,8 +1700,7 @@
1701 val = ngx_http_ssi_get_variable(r, &var, key);1700 val = ngx_http_ssi_get_variable(r, &var, key);
17021701
1703 if (val == NULL) {1702 if (val == NULL) {
1704 vv = ngx_http_get_variable(r, &var, key,1703 vv = ngx_http_get_variable(r, &var, key);
1705 flags & NGX_HTTP_SSI_EXPR_TEST);
1706 if (vv == NULL) {1704 if (vv == NULL) {
1707 return NGX_ERROR;1705 return NGX_ERROR;
1708 }1706 }
@@ -2061,9 +2059,9 @@
2061 out = data;2059 out = data;
20622060
2063 if (!r->header_sent) {2061 if (!r->header_sent) {
2064 if (ngx_http_set_content_type(r) != NGX_OK) {2062 r->headers_out.content_type_len =
2065 return NGX_ERROR;2063 r->parent->headers_out.content_type_len;
2066 }2064 r->headers_out.content_type = r->parent->headers_out.content_type;
20672065
2068 if (ngx_http_send_header(r) == NGX_ERROR) {2066 if (ngx_http_send_header(r) == NGX_ERROR) {
2069 return NGX_ERROR;2067 return NGX_ERROR;
@@ -2110,7 +2108,7 @@
2110 value = ngx_http_ssi_get_variable(r, var, key);2108 value = ngx_http_ssi_get_variable(r, var, key);
21112109
2112 if (value == NULL) {2110 if (value == NULL) {
2113 vv = ngx_http_get_variable(r, var, key, 1);2111 vv = ngx_http_get_variable(r, var, key);
21142112
2115 if (vv == NULL) {2113 if (vv == NULL) {
2116 return NGX_HTTP_SSI_ERROR;2114 return NGX_HTTP_SSI_ERROR;
@@ -2161,11 +2159,10 @@
2161 }2159 }
2162 }2160 }
21632161
2162 p = value->data;
2163
2164 switch (ctx->encoding) {2164 switch (ctx->encoding) {
21652165
2166 case NGX_HTTP_SSI_NO_ENCODING:
2167 break;
2168
2169 case NGX_HTTP_SSI_URL_ENCODING:2166 case NGX_HTTP_SSI_URL_ENCODING:
2170 len = 2 * ngx_escape_uri(NULL, value->data, value->len,2167 len = 2 * ngx_escape_uri(NULL, value->data, value->len,
2171 NGX_ESCAPE_HTML);2168 NGX_ESCAPE_HTML);
@@ -2177,11 +2174,9 @@
2177 }2174 }
21782175
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);
2180
2181 value->len += len;
2182 value->data = p;
2183 }2177 }
21842178
2179 len += value->len;
2185 break;2180 break;
21862181
2187 case NGX_HTTP_SSI_ENTITY_ENCODING:2182 case NGX_HTTP_SSI_ENTITY_ENCODING:
@@ -2194,11 +2189,13 @@
2194 }2189 }
21952190
2196 (void) ngx_escape_html(p, value->data, value->len);2191 (void) ngx_escape_html(p, value->data, value->len);
2197
2198 value->len += len;
2199 value->data = p;
2200 }2192 }
22012193
2194 len += value->len;
2195 break;
2196
2197 default: /* NGX_HTTP_SSI_NO_ENCODING */
2198 len = value->len;
2202 break;2199 break;
2203 }2200 }
22042201
@@ -2213,8 +2210,8 @@
2213 }2210 }
22142211
2215 b->memory = 1;2212 b->memory = 1;
2216 b->pos = value->data;2213 b->pos = p;
2217 b->last = value->data + value->len;2214 b->last = p + len;
22182215
2219 cl->buf = b;2216 cl->buf = b;
2220 cl->next = NULL;2217 cl->next = NULL;
@@ -2362,7 +2359,7 @@
2362 p++;2359 p++;
2363 }2360 }
23642361
2365 flags = (p == last) ? NGX_HTTP_SSI_EXPR_TEST : 0;2362 flags = 0;
23662363
2367 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,2364 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
2368 "left: \"%V\"", &left);2365 "left: \"%V\"", &left);
@@ -2614,8 +2611,7 @@
2614 return NGX_ERROR;2611 return NGX_ERROR;
2615 }2612 }
26162613
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;
2618 - v->data;
26192615
2620 return NGX_OK;2616 return NGX_OK;
2621 }2617 }
26222618
=== modified file 'src/http/modules/ngx_http_static_module.c'
--- src/http/modules/ngx_http_static_module.c 2009-10-19 23:22:06 +0000
+++ src/http/modules/ngx_http_static_module.c 2010-07-21 11:15:58 +0000
@@ -66,10 +66,6 @@
66 return NGX_DECLINED;66 return NGX_DECLINED;
67 }67 }
6868
69 if (r->zero_in_uri) {
70 return NGX_DECLINED;
71 }
72
73 log = r->connection->log;69 log = r->connection->log;
7470
75 /*71 /*
@@ -188,7 +184,7 @@
188#if !(NGX_WIN32) /* the not regular files are probably Unix specific */184#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
189185
190 if (!of.is_file) {186 if (!of.is_file) {
191 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno,187 ngx_log_error(NGX_LOG_CRIT, log, 0,
192 "\"%s\" is not a regular file", path.data);188 "\"%s\" is not a regular file", path.data);
193189
194 return NGX_HTTP_NOT_FOUND;190 return NGX_HTTP_NOT_FOUND;
195191
=== modified file 'src/http/modules/ngx_http_userid_filter_module.c'
--- src/http/modules/ngx_http_userid_filter_module.c 2009-11-30 13:34:00 +0000
+++ src/http/modules/ngx_http_userid_filter_module.c 2010-07-21 11:15:58 +0000
@@ -545,7 +545,7 @@
545{545{
546 ngx_http_variable_t *var;546 ngx_http_variable_t *var;
547547
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);
549 if (var == NULL) {549 if (var == NULL) {
550 return NGX_ERROR;550 return NGX_ERROR;
551 }551 }
552552
=== modified file 'src/http/modules/perl/nginx.pm'
--- src/http/modules/perl/nginx.pm 2010-03-03 23:50:36 +0000
+++ src/http/modules/perl/nginx.pm 2010-07-21 11:15:58 +0000
@@ -47,7 +47,7 @@
47 HTTP_INSUFFICIENT_STORAGE47 HTTP_INSUFFICIENT_STORAGE
48);48);
4949
50our $VERSION = '0.7.65';50our $VERSION = '0.7.67';
5151
52require XSLoader;52require XSLoader;
53XSLoader::load('nginx', $VERSION);53XSLoader::load('nginx', $VERSION);
5454
=== modified file 'src/http/modules/perl/nginx.xs'
--- src/http/modules/perl/nginx.xs 2009-10-19 23:22:06 +0000
+++ src/http/modules/perl/nginx.xs 2010-07-21 11:15:58 +0000
@@ -847,7 +847,7 @@
847847
848 #endif848 #endif
849849
850 vv = ngx_http_get_variable(r, &var, hash, 1);850 vv = ngx_http_get_variable(r, &var, hash);
851 if (vv == NULL) {851 if (vv == NULL) {
852 XSRETURN_UNDEF;852 XSRETURN_UNDEF;
853 }853 }
@@ -901,9 +901,6 @@
901 XSRETURN_UNDEF;901 XSRETURN_UNDEF;
902 }902 }
903903
904 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
905 "variable \"%V\" not found", &var);
906
907 XSRETURN_UNDEF;904 XSRETURN_UNDEF;
908 }905 }
909906
910907
=== modified file 'src/http/modules/perl/ngx_http_perl_module.c'
--- src/http/modules/perl/ngx_http_perl_module.c 2010-03-03 23:50:36 +0000
+++ src/http/modules/perl/ngx_http_perl_module.c 2010-07-21 11:15:58 +0000
@@ -30,12 +30,6 @@
30} ngx_http_perl_variable_t;30} ngx_http_perl_variable_t;
3131
3232
33typedef struct {
34 SV *sv;
35 PerlInterpreter *perl;
36} ngx_http_perl_cleanup_t;
37
38
39#if (NGX_HTTP_SSI)33#if (NGX_HTTP_SSI)
40static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r,34static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r,
41 ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params);35 ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params);
@@ -174,10 +168,6 @@
174static ngx_int_t168static ngx_int_t
175ngx_http_perl_handler(ngx_http_request_t *r)169ngx_http_perl_handler(ngx_http_request_t *r)
176{170{
177 if (r->zero_in_uri) {
178 return NGX_HTTP_NOT_FOUND;
179 }
180
181 ngx_http_perl_handle_request(r);171 ngx_http_perl_handle_request(r);
182172
183 return NGX_DONE;173 return NGX_DONE;
184174
=== modified file 'src/http/ngx_http_cache.h'
--- src/http/ngx_http_cache.h 2009-11-30 13:34:00 +0000
+++ src/http/ngx_http_cache.h 2010-07-21 11:15:58 +0000
@@ -133,6 +133,11 @@
133char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,133char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
134 void *conf);134 void *conf);
135135
136ngx_int_t ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache);
137char *ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
138 void *conf);
139
140
136extern ngx_str_t ngx_http_cache_status[];141extern ngx_str_t ngx_http_cache_status[];
137142
138143
139144
=== modified file 'src/http/ngx_http_copy_filter_module.c'
--- src/http/ngx_http_copy_filter_module.c 2009-10-19 23:22:06 +0000
+++ src/http/ngx_http_copy_filter_module.c 2010-07-21 11:15:58 +0000
@@ -104,7 +104,9 @@
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;
105 ctx->filter_ctx = r;105 ctx->filter_ctx = r;
106106
107 r->request_output = 1;107 if (in && in->buf && ngx_buf_size(in->buf)) {
108 r->request_output = 1;
109 }
108 }110 }
109111
110 rc = ngx_output_chain(ctx, in);112 rc = ngx_output_chain(ctx, in);
111113
=== modified file 'src/http/ngx_http_core_module.c'
--- src/http/ngx_http_core_module.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_core_module.c 2010-07-21 11:15:58 +0000
@@ -560,6 +560,13 @@
560 offsetof(ngx_http_core_loc_conf_t, if_modified_since),560 offsetof(ngx_http_core_loc_conf_t, if_modified_since),
561 &ngx_http_core_if_modified_since },561 &ngx_http_core_if_modified_since },
562562
563 { ngx_string("chunked_transfer_encoding"),
564 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
565 ngx_conf_set_flag_slot,
566 NGX_HTTP_LOC_CONF_OFFSET,
567 offsetof(ngx_http_core_loc_conf_t, chunked_transfer_encoding),
568 NULL },
569
563 { ngx_string("error_page"),570 { ngx_string("error_page"),
564 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF571 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
565 |NGX_CONF_2MORE,572 |NGX_CONF_2MORE,
@@ -744,14 +751,24 @@
744 break;751 break;
745 }752 }
746753
747 if (r->keepalive && r->headers_in.msie && r->method == NGX_HTTP_POST) {754 if (r->keepalive) {
748755
749 /*756 if (r->headers_in.msie6) {
750 * MSIE may wait for some time if an response for757 if (r->method == NGX_HTTP_POST) {
751 * a POST request was sent over a keepalive connection758 /*
752 */759 * MSIE may wait for some time if an response for
753760 * a POST request was sent over a keepalive connection
754 r->keepalive = 0;761 */
762 r->keepalive = 0;
763 }
764
765 } else if (r->headers_in.safari) {
766 /*
767 * Safari may send a POST request to a closed keepalive
768 * connection and stalls for some time
769 */
770 r->keepalive = 0;
771 }
755 }772 }
756773
757 if (r->headers_in.content_length_n > 0) {774 if (r->headers_in.content_length_n > 0) {
@@ -1288,7 +1305,7 @@
12881305
1289 /* no content handler was found */1306 /* no content handler was found */
12901307
1291 if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {1308 if (r->uri.data[r->uri.len - 1] == '/') {
12921309
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) {
1294 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,1311 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
@@ -2076,7 +2093,6 @@
2076 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,2093 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
2077 "http subrequest \"%V?%V\"", uri, &sr->args);2094 "http subrequest \"%V?%V\"", uri, &sr->args);
20782095
2079 sr->zero_in_uri = (flags & NGX_HTTP_ZERO_IN_URI) != 0;
2080 sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;2096 sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;
2081 sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0;2097 sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0;
20822098
@@ -2944,6 +2960,7 @@
2944 lcf->log_subrequest = NGX_CONF_UNSET;2960 lcf->log_subrequest = NGX_CONF_UNSET;
2945 lcf->recursive_error_pages = NGX_CONF_UNSET;2961 lcf->recursive_error_pages = NGX_CONF_UNSET;
2946 lcf->server_tokens = NGX_CONF_UNSET;2962 lcf->server_tokens = NGX_CONF_UNSET;
2963 lcf->chunked_transfer_encoding = NGX_CONF_UNSET;
2947 lcf->types_hash_max_size = NGX_CONF_UNSET_UINT;2964 lcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
2948 lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;2965 lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
29492966
@@ -3181,6 +3198,8 @@
3181 ngx_conf_merge_value(conf->recursive_error_pages,3198 ngx_conf_merge_value(conf->recursive_error_pages,
3182 prev->recursive_error_pages, 0);3199 prev->recursive_error_pages, 0);
3183 ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);3200 ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);
3201 ngx_conf_merge_value(conf->chunked_transfer_encoding,
3202 prev->chunked_transfer_encoding, 1);
31843203
3185 ngx_conf_merge_ptr_value(conf->open_file_cache,3204 ngx_conf_merge_ptr_value(conf->open_file_cache,
3186 prev->open_file_cache, NULL);3205 prev->open_file_cache, NULL);
31873206
=== modified file 'src/http/ngx_http_core_module.h'
--- src/http/ngx_http_core_module.h 2009-11-30 13:34:00 +0000
+++ src/http/ngx_http_core_module.h 2010-07-21 11:15:58 +0000
@@ -358,6 +358,7 @@
358 ngx_flag_t log_subrequest; /* log_subrequest */358 ngx_flag_t log_subrequest; /* log_subrequest */
359 ngx_flag_t recursive_error_pages; /* recursive_error_pages */359 ngx_flag_t recursive_error_pages; /* recursive_error_pages */
360 ngx_flag_t server_tokens; /* server_tokens */360 ngx_flag_t server_tokens; /* server_tokens */
361 ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */
361362
362#if (NGX_HTTP_GZIP)363#if (NGX_HTTP_GZIP)
363 ngx_flag_t gzip_vary; /* gzip_vary */364 ngx_flag_t gzip_vary; /* gzip_vary */
364365
=== modified file 'src/http/ngx_http_file_cache.c'
--- src/http/ngx_http_file_cache.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_file_cache.c 2010-07-21 11:15:58 +0000
@@ -1128,7 +1128,7 @@
11281128
1129 if (cache->files++ > 100) {1129 if (cache->files++ > 100) {
11301130
1131 ngx_time_update(0, 0);1131 ngx_time_update();
11321132
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));
11341134
@@ -1145,7 +1145,7 @@
11451145
1146 ngx_msleep(200);1146 ngx_msleep(200);
11471147
1148 ngx_time_update(0, 0);1148 ngx_time_update();
1149 }1149 }
11501150
1151 cache->last = ngx_current_msec;1151 cache->last = ngx_current_msec;
@@ -1604,3 +1604,69 @@
16041604
1605 return NGX_CONF_OK;1605 return NGX_CONF_OK;
1606}1606}
1607
1608
1609ngx_int_t
1610ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache)
1611{
1612 ngx_str_t val;
1613 ngx_uint_t i;
1614 ngx_http_complex_value_t *cv;
1615
1616 cv = no_cache->elts;
1617
1618 for (i = 0; i < no_cache->nelts; i++) {
1619 if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
1620 return NGX_ERROR;
1621 }
1622
1623 if (val.len && val.data[0] != '0') {
1624 return NGX_DECLINED;
1625 }
1626 }
1627
1628 return NGX_OK;
1629}
1630
1631
1632char *
1633ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1634{
1635 char *p = conf;
1636
1637 ngx_str_t *value;
1638 ngx_uint_t i;
1639 ngx_array_t **a;
1640 ngx_http_complex_value_t *cv;
1641 ngx_http_compile_complex_value_t ccv;
1642
1643 a = (ngx_array_t **) (p + cmd->offset);
1644
1645 if (*a == NGX_CONF_UNSET_PTR) {
1646 *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t));
1647 if (*a == NULL) {
1648 return NGX_CONF_ERROR;
1649 }
1650 }
1651
1652 value = cf->args->elts;
1653
1654 for (i = 1; i < cf->args->nelts; i++) {
1655 cv = ngx_array_push(*a);
1656 if (cv == NULL) {
1657 return NGX_CONF_ERROR;
1658 }
1659
1660 ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
1661
1662 ccv.cf = cf;
1663 ccv.value = &value[i];
1664 ccv.complex_value = cv;
1665
1666 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
1667 return NGX_CONF_ERROR;
1668 }
1669 }
1670
1671 return NGX_CONF_OK;
1672}
16071673
=== modified file 'src/http/ngx_http_header_filter_module.c'
--- src/http/ngx_http_header_filter_module.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_header_filter_module.c 2010-07-21 11:15:58 +0000
@@ -538,8 +538,8 @@
538538
539 r->headers_out.location->value.len = b->last - p;539 r->headers_out.location->value.len = b->last - p;
540 r->headers_out.location->value.data = p;540 r->headers_out.location->value.data = p;
541 r->headers_out.location->key.len = sizeof("Location: ") - 1;541 r->headers_out.location->key.len = sizeof("Location") - 1;
542 r->headers_out.location->key.data = (u_char *) "Location: ";542 r->headers_out.location->key.data = (u_char *) "Location";
543543
544 *b->last++ = CR; *b->last++ = LF;544 *b->last++ = CR; *b->last++ = LF;
545 }545 }
546546
=== modified file 'src/http/ngx_http_parse.c'
--- src/http/ngx_http_parse.c 2009-11-30 13:34:00 +0000
+++ src/http/ngx_http_parse.c 2010-07-21 11:15:58 +0000
@@ -438,8 +438,7 @@
438 r->plus_in_uri = 1;438 r->plus_in_uri = 1;
439 break;439 break;
440 case '\0':440 case '\0':
441 r->zero_in_uri = 1;441 return NGX_HTTP_PARSE_INVALID_REQUEST;
442 break;
443 default:442 default:
444 state = sw_check_uri;443 state = sw_check_uri;
445 break;444 break;
@@ -496,8 +495,7 @@
496 r->plus_in_uri = 1;495 r->plus_in_uri = 1;
497 break;496 break;
498 case '\0':497 case '\0':
499 r->zero_in_uri = 1;498 return NGX_HTTP_PARSE_INVALID_REQUEST;
500 break;
501 }499 }
502 break;500 break;
503501
@@ -526,8 +524,7 @@
526 r->complex_uri = 1;524 r->complex_uri = 1;
527 break;525 break;
528 case '\0':526 case '\0':
529 r->zero_in_uri = 1;527 return NGX_HTTP_PARSE_INVALID_REQUEST;
530 break;
531 }528 }
532 break;529 break;
533530
@@ -1202,7 +1199,7 @@
1202 ch = *p++;1199 ch = *p++;
12031200
1204 } else if (ch == '\0') {1201 } else if (ch == '\0') {
1205 r->zero_in_uri = 1;1202 return NGX_HTTP_PARSE_INVALID_REQUEST;
1206 }1203 }
12071204
1208 state = quoted_state;1205 state = quoted_state;
@@ -1304,8 +1301,7 @@
1304 }1301 }
13051302
1306 if (ch == '\0') {1303 if (ch == '\0') {
1307 *flags |= NGX_HTTP_ZERO_IN_URI;1304 goto unsafe;
1308 continue;
1309 }1305 }
13101306
1311 if (ngx_path_separator(ch) && len > 2) {1307 if (ngx_path_separator(ch) && len > 2) {
@@ -1449,34 +1445,19 @@
1449void1445void
1450ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)1446ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)
1451{1447{
1452 u_char ch, *p, *last;1448 u_char *p, *last;
14531449
1454 p = uri->data;1450 last = uri->data + uri->len;
14551451
1456 last = p + uri->len;1452 p = ngx_strlchr(uri->data, last, '?');
14571453
1458 args->len = 0;1454 if (p) {
14591455 uri->len = p - uri->data;
1460 while (p < last) {1456 p++;
14611457 args->len = last - p;
1462 ch = *p++;1458 args->data = p;
14631459
1464 if (ch == '?') {1460 } else {
1465 args->len = last - p;1461 args->len = 0;
1466 args->data = p;
1467
1468 uri->len = p - 1 - uri->data;
1469
1470 if (ngx_strlchr(p, last, '\0') != NULL) {
1471 r->zero_in_uri = 1;
1472 }
1473
1474 return;
1475 }
1476
1477 if (ch == '\0') {
1478 r->zero_in_uri = 1;
1479 continue;
1480 }
1481 }1462 }
1482}1463}
14831464
=== modified file 'src/http/ngx_http_request.c'
--- src/http/ngx_http_request.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_request.c 2010-07-21 11:15:58 +0000
@@ -784,16 +784,31 @@
784784
785 p = r->uri.data + r->uri.len - 1;785 p = r->uri.data + r->uri.len - 1;
786786
787 if (*p == '.' || *p == ' ') {787 while (p > r->uri.data) {
788788
789 while (--p > r->uri.data && (*p == '.' || *p == ' ')) {789 if (*p == ' ') {
790 /* void */790 p--;
791 }791 continue;
792792 }
793
794 if (*p == '.') {
795 p--;
796 continue;
797 }
798
799 if (ngx_strncasecmp(p - 6, (u_char *) "::$data", 7) == 0) {
800 p -= 7;
801 continue;
802 }
803
804 break;
805 }
806
807 if (p != r->uri.data + r->uri.len - 1) {
793 r->uri.len = p + 1 - r->uri.data;808 r->uri.len = p + 1 - r->uri.data;
794
795 ngx_http_set_exten(r);809 ngx_http_set_exten(r);
796 }810 }
811
797 }812 }
798#endif813#endif
799814
@@ -1443,6 +1458,12 @@
1443 if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) {1458 if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) {
1444 r->headers_in.gecko = 1;1459 r->headers_in.gecko = 1;
14451460
1461 } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) {
1462 r->headers_in.chrome = 1;
1463
1464 } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)) {
1465 r->headers_in.safari = 1;
1466
1446 } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {1467 } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
1447 r->headers_in.konqueror = 1;1468 r->headers_in.konqueror = 1;
1448 }1469 }
14491470
=== modified file 'src/http/ngx_http_request.h'
--- src/http/ngx_http_request.h 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_request.h 2010-07-21 11:15:58 +0000
@@ -57,7 +57,7 @@
57#define NGX_HTTP_PARSE_INVALID_HEADER 1357#define NGX_HTTP_PARSE_INVALID_HEADER 13
5858
5959
60#define NGX_HTTP_ZERO_IN_URI 160/* unused 1 */
61#define NGX_HTTP_SUBREQUEST_IN_MEMORY 261#define NGX_HTTP_SUBREQUEST_IN_MEMORY 2
62#define NGX_HTTP_SUBREQUEST_WAITED 462#define NGX_HTTP_SUBREQUEST_WAITED 4
63#define NGX_HTTP_LOG_UNSAFE 863#define NGX_HTTP_LOG_UNSAFE 8
@@ -220,6 +220,8 @@
220 unsigned msie6:1;220 unsigned msie6:1;
221 unsigned opera:1;221 unsigned opera:1;
222 unsigned gecko:1;222 unsigned gecko:1;
223 unsigned chrome:1;
224 unsigned safari:1;
223 unsigned konqueror:1;225 unsigned konqueror:1;
224} ngx_http_headers_in_t;226} ngx_http_headers_in_t;
225227
@@ -428,9 +430,6 @@
428 /* URI with "+" */430 /* URI with "+" */
429 unsigned plus_in_uri:1;431 unsigned plus_in_uri:1;
430432
431 /* URI with "\0" or "%00" */
432 unsigned zero_in_uri:1;
433
434 unsigned invalid_header:1;433 unsigned invalid_header:1;
435434
436 unsigned valid_location:1;435 unsigned valid_location:1;
437436
=== modified file 'src/http/ngx_http_special_response.c'
--- src/http/ngx_http_special_response.c 2009-10-19 23:22:06 +0000
+++ src/http/ngx_http_special_response.c 2010-07-21 11:15:58 +0000
@@ -31,13 +31,13 @@
31;31;
3232
3333
34static u_char ngx_http_msie_stub[] =34static u_char ngx_http_msie_padding[] =
35"<!-- The padding to disable MSIE's friendly error page -->" CRLF35"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
36"<!-- The padding to disable MSIE's friendly error page -->" CRLF36"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
37"<!-- The padding to disable MSIE's friendly error page -->" CRLF37"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
38"<!-- The padding to disable MSIE's friendly error page -->" CRLF38"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
39"<!-- The padding to disable MSIE's friendly error page -->" CRLF39"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
40"<!-- The padding to disable MSIE's friendly error page -->" CRLF40"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
41;41;
4242
4343
@@ -517,8 +517,6 @@
517517
518 r->err_status = overwrite;518 r->err_status = overwrite;
519519
520 r->zero_in_uri = 0;
521
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) {
523 return NGX_ERROR;521 return NGX_ERROR;
524 }522 }
@@ -598,12 +596,12 @@
598 r->headers_out.content_length_n = ngx_http_error_pages[err].len596 r->headers_out.content_length_n = ngx_http_error_pages[err].len
599 + len;597 + len;
600 if (clcf->msie_padding598 if (clcf->msie_padding
601 && r->headers_in.msie599 && (r->headers_in.msie || r->headers_in.chrome)
602 && r->http_version >= NGX_HTTP_VERSION_10600 && r->http_version >= NGX_HTTP_VERSION_10
603 && err >= NGX_HTTP_LEVEL_300)601 && err >= NGX_HTTP_LEVEL_300)
604 {602 {
605 r->headers_out.content_length_n +=603 r->headers_out.content_length_n +=
606 sizeof(ngx_http_msie_stub) - 1;604 sizeof(ngx_http_msie_padding) - 1;
607 msie_padding = 1;605 msie_padding = 1;
608 }606 }
609607
@@ -671,8 +669,8 @@
671 }669 }
672670
673 b->memory = 1;671 b->memory = 1;
674 b->pos = ngx_http_msie_stub;672 b->pos = ngx_http_msie_padding;
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;
676674
677 out[1].next = &out[2];675 out[1].next = &out[2];
678 out[2].buf = b;676 out[2].buf = b;
679677
=== modified file 'src/http/ngx_http_upstream.c'
--- src/http/ngx_http_upstream.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_upstream.c 2010-07-21 11:15:58 +0000
@@ -363,8 +363,6 @@
363363
364 if (u && u->cleanup) {364 if (u && u->cleanup) {
365 ngx_http_upstream_cleanup(r);365 ngx_http_upstream_cleanup(r);
366 *u->cleanup = NULL;
367 u->cleanup = NULL;
368 }366 }
369367
370 u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t));368 u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t));
@@ -587,6 +585,13 @@
587 ngx_int_t rc;585 ngx_int_t rc;
588 ngx_http_cache_t *c;586 ngx_http_cache_t *c;
589587
588 if (u->conf->no_cache) {
589 rc = ngx_http_cache(r, u->conf->no_cache);
590 if (rc != NGX_OK) {
591 return rc;
592 }
593 }
594
590 if (!(r->method & u->conf->cache_methods)) {595 if (!(r->method & u->conf->cache_methods)) {
591 return NGX_DECLINED;596 return NGX_DECLINED;
592 }597 }
@@ -1775,10 +1780,6 @@
1775 return NGX_DONE;1780 return NGX_DONE;
1776 }1781 }
17771782
1778 if (flags & NGX_HTTP_ZERO_IN_URI) {
1779 r->zero_in_uri = 1;
1780 }
1781
1782 if (r->method != NGX_HTTP_HEAD) {1783 if (r->method != NGX_HTTP_HEAD) {
1783 r->method = NGX_HTTP_GET;1784 r->method = NGX_HTTP_GET;
1784 }1785 }
@@ -3004,16 +3005,18 @@
3004 return NGX_OK;3005 return NGX_OK;
3005 }3006 }
30063007
3007 last = h->value.data + h->value.len;3008 p = h->value.data;
3009 last = p + h->value.len;
30083010
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
3010 != NULL)3012 || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL
3013 || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL)
3011 {3014 {
3012 u->cacheable = 0;3015 u->cacheable = 0;
3013 return NGX_OK;3016 return NGX_OK;
3014 }3017 }
30153018
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);
30173020
3018 if (p == NULL) {3021 if (p == NULL) {
3019 return NGX_OK;3022 return NGX_OK;
30203023
=== modified file 'src/http/ngx_http_upstream.h'
--- src/http/ngx_http_upstream.h 2009-11-30 13:34:00 +0000
+++ src/http/ngx_http_upstream.h 2010-07-21 11:15:58 +0000
@@ -160,6 +160,7 @@
160 ngx_uint_t cache_methods;160 ngx_uint_t cache_methods;
161161
162 ngx_array_t *cache_valid;162 ngx_array_t *cache_valid;
163 ngx_array_t *no_cache; /* ngx_http_complex_value_t */
163#endif164#endif
164165
165 ngx_array_t *store_lengths;166 ngx_array_t *store_lengths;
166167
=== modified file 'src/http/ngx_http_variables.c'
--- src/http/ngx_http_variables.c 2010-03-03 23:50:36 +0000
+++ src/http/ngx_http_variables.c 2010-07-21 11:15:58 +0000
@@ -196,7 +196,8 @@
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 },
197197
198 { ngx_string("request_method"), NULL,198 { ngx_string("request_method"), NULL,
199 ngx_http_variable_request_method, 0, 0, 0 },199 ngx_http_variable_request_method, 0,
200 NGX_HTTP_VAR_NOCACHEABLE, 0 },
200201
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 },
202203
@@ -440,8 +441,7 @@
440441
441442
442ngx_http_variable_value_t *443ngx_http_variable_value_t *
443ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key,444ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key)
444 ngx_uint_t nowarn)
445{445{
446 ngx_http_variable_t *v;446 ngx_http_variable_t *v;
447 ngx_http_variable_value_t *vv;447 ngx_http_variable_value_t *vv;
@@ -453,7 +453,7 @@
453453
454 if (v) {454 if (v) {
455 if (v->flags & NGX_HTTP_VAR_INDEXED) {455 if (v->flags & NGX_HTTP_VAR_INDEXED) {
456 return ngx_http_get_indexed_variable(r, v->index);456 return ngx_http_get_flushed_variable(r, v->index);
457457
458 } else {458 } else {
459459
@@ -494,7 +494,7 @@
494 return NULL;494 return NULL;
495 }495 }
496496
497 if (ngx_strncmp(name->data, "upstream_http_", 10) == 0) {497 if (ngx_strncmp(name->data, "upstream_http_", 14) == 0) {
498498
499 if (ngx_http_upstream_header_variable(r, vv, (uintptr_t) name)499 if (ngx_http_upstream_header_variable(r, vv, (uintptr_t) name)
500 == NGX_OK)500 == NGX_OK)
@@ -525,11 +525,6 @@
525525
526 vv->not_found = 1;526 vv->not_found = 1;
527527
528 if (nowarn == 0) {
529 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
530 "unknown \"%V\" variable", name);
531 }
532
533 return vv;528 return vv;
534}529}
535530
@@ -1781,6 +1776,7 @@
1781 if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) {1776 if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) {
1782 v[i].get_handler = ngx_http_variable_argument;1777 v[i].get_handler = ngx_http_variable_argument;
1783 v[i].data = (uintptr_t) &v[i].name;1778 v[i].data = (uintptr_t) &v[i].name;
1779 v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
17841780
1785 continue;1781 continue;
1786 }1782 }
17871783
=== modified file 'src/http/ngx_http_variables.h'
--- src/http/ngx_http_variables.h 2009-10-19 23:22:06 +0000
+++ src/http/ngx_http_variables.h 2010-07-21 11:15:58 +0000
@@ -50,7 +50,7 @@
50 ngx_uint_t index);50 ngx_uint_t index);
5151
52ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,52ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,
53 ngx_str_t *name, ngx_uint_t key, ngx_uint_t nowarn);53 ngx_str_t *name, ngx_uint_t key);
5454
55ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v,55ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v,
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);
5757
=== modified file 'src/mail/ngx_mail_pop3_handler.c'
--- src/mail/ngx_mail_pop3_handler.c 2009-10-19 23:22:06 +0000
+++ src/mail/ngx_mail_pop3_handler.c 2010-07-21 11:15:58 +0000
@@ -188,7 +188,6 @@
188188
189 default:189 default:
190 rc = NGX_MAIL_PARSE_INVALID_COMMAND;190 rc = NGX_MAIL_PARSE_INVALID_COMMAND;
191 s->mail_state = ngx_pop3_start;
192 break;191 break;
193 }192 }
194193
@@ -215,7 +214,6 @@
215214
216 default:215 default:
217 rc = NGX_MAIL_PARSE_INVALID_COMMAND;216 rc = NGX_MAIL_PARSE_INVALID_COMMAND;
218 s->mail_state = ngx_pop3_start;
219 break;217 break;
220 }218 }
221219
222220
=== modified file 'src/mail/ngx_mail_proxy_module.c'
--- src/mail/ngx_mail_proxy_module.c 2009-11-30 13:34:00 +0000
+++ src/mail/ngx_mail_proxy_module.c 2010-07-21 11:15:58 +0000
@@ -726,7 +726,7 @@
726726
727 b->last += n;727 b->last += n;
728728
729 if (b->last - b->pos < 5) {729 if (b->last - b->pos < 4) {
730 return NGX_AGAIN;730 return NGX_AGAIN;
731 }731 }
732732
733733
=== modified file 'src/os/unix/ngx_errno.h'
--- src/os/unix/ngx_errno.h 2009-11-30 13:34:00 +0000
+++ src/os/unix/ngx_errno.h 2010-07-21 11:15:58 +0000
@@ -64,10 +64,22 @@
6464
65/* Solaris and Tru64 UNIX have thread-safe strerror() */65/* Solaris and Tru64 UNIX have thread-safe strerror() */
6666
67#define ngx_strerror_r(err, errstr, size) \67#define ngx_strerror_r(err, errstr, size) \
68 ngx_cpystrn(errstr, (u_char *) strerror(err), size)68 ngx_cpystrn(errstr, (u_char *) strerror(err), size)
6969
70#endif70#endif
7171
7272
73#if (NGX_HAVE_SYS_ERRLIST)
74
75#define ngx_sigsafe_strerror(err) \
76 (err > 0 && err < sys_nerr) ? sys_errlist[err] : "Unknown error"
77
78#else
79
80#define ngx_sigsafe_strerror(err) ""
81
82#endif
83
84
73#endif /* _NGX_ERRNO_H_INCLUDED_ */85#endif /* _NGX_ERRNO_H_INCLUDED_ */
7486
=== modified file 'src/os/unix/ngx_files.h'
--- src/os/unix/ngx_files.h 2010-03-03 23:50:36 +0000
+++ src/os/unix/ngx_files.h 2010-07-21 11:15:58 +0000
@@ -64,6 +64,7 @@
64#define NGX_FILE_OPEN 064#define NGX_FILE_OPEN 0
65#define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC65#define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
66#define NGX_FILE_APPEND O_WRONLY|O_APPEND66#define NGX_FILE_APPEND O_WRONLY|O_APPEND
67#define NGX_FILE_NONBLOCK O_NONBLOCK
6768
68#define NGX_FILE_DEFAULT_ACCESS 064469#define NGX_FILE_DEFAULT_ACCESS 0644
69#define NGX_FILE_OWNER_ACCESS 060070#define NGX_FILE_OWNER_ACCESS 0600
@@ -138,6 +139,9 @@
138#define ngx_fd_info(fd, sb) fstat(fd, sb)139#define ngx_fd_info(fd, sb) fstat(fd, sb)
139#define ngx_fd_info_n "fstat()"140#define ngx_fd_info_n "fstat()"
140141
142#define ngx_link_info(file, sb) lstat((const char *) file, sb)
143#define ngx_link_info_n "lstat()"
144
141#define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode))145#define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode))
142#define ngx_is_file(sb) (S_ISREG((sb)->st_mode))146#define ngx_is_file(sb) (S_ISREG((sb)->st_mode))
143#define ngx_is_link(sb) (S_ISLNK((sb)->st_mode))147#define ngx_is_link(sb) (S_ISLNK((sb)->st_mode))
144148
=== modified file 'src/os/unix/ngx_process.c'
--- src/os/unix/ngx_process.c 2009-11-30 13:34:00 +0000
+++ src/os/unix/ngx_process.c 2010-07-21 11:15:58 +0000
@@ -315,7 +315,7 @@
315 }315 }
316 }316 }
317317
318 ngx_time_update(0, 0);318 ngx_time_sigsafe_update();
319319
320 action = "";320 action = "";
321321
@@ -476,16 +476,17 @@
476 */476 */
477477
478 if (err == NGX_ECHILD) {478 if (err == NGX_ECHILD) {
479 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, errno,479 ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, 0,
480 "waitpid() failed");480 "waitpid() failed (%d: %s)",
481 err, ngx_sigsafe_strerror(err));
481 return;482 return;
482 }483 }
483484
484#endif485#endif
485486
486 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, errno,487 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
487 "waitpid() failed");488 "waitpid() failed (%d: %s)",
488489 err, ngx_sigsafe_strerror(err));
489 return;490 return;
490 }491 }
491492
492493
=== modified file 'src/os/unix/ngx_process_cycle.c'
--- src/os/unix/ngx_process_cycle.c 2010-03-03 23:50:36 +0000
+++ src/os/unix/ngx_process_cycle.c 2010-07-21 11:15:58 +0000
@@ -168,7 +168,7 @@
168168
169 sigsuspend(&set);169 sigsuspend(&set);
170170
171 ngx_time_update(0, 0);171 ngx_time_update();
172172
173 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,173 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
174 "wake up, sigio %i", sigio);174 "wake up, sigio %i", sigio);
@@ -1337,7 +1337,7 @@
13371337
1338 next = (n <= next) ? n : next;1338 next = (n <= next) ? n : next;
13391339
1340 ngx_time_update(0, 0);1340 ngx_time_update();
1341 }1341 }
1342 }1342 }
13431343
@@ -1367,7 +1367,7 @@
13671367
1368 if (path[i]->loader) {1368 if (path[i]->loader) {
1369 path[i]->loader(path[i]->data);1369 path[i]->loader(path[i]->data);
1370 ngx_time_update(0, 0);1370 ngx_time_update();
1371 }1371 }
1372 }1372 }
13731373

Subscribers

People subscribed via source and target branches