changeset 660:d0f7a625f27c NGINX_1_1_14

nginx 1.1.14 *) Feature: multiple "limit_req" limits may be used simultaneously. *) Bugfix: in error handling while connecting to a backend. Thanks to Piotr Sikora. *) Bugfix: in AIO error handling on FreeBSD. *) Bugfix: in the OpenSSL library initialization. *) Bugfix: the "proxy_redirect" directives might not be correctly inherited. *) Bugfix: memory leak during reconfiguration if the "pcre_jit" directive was used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Jan 2012 00:00:00 +0400
parents d48f991d7bd0
children b49c1751031c
files CHANGES CHANGES.ru LICENSE auto/cc/acc auto/cc/bcc auto/cc/ccc auto/cc/conf auto/cc/gcc auto/cc/icc auto/cc/msvc auto/cc/name auto/cc/owc auto/cc/sunc auto/define auto/endianess auto/feature auto/have auto/have_headers auto/headers auto/include auto/init auto/install auto/lib/conf auto/lib/geoip/conf auto/lib/google-perftools/conf auto/lib/libatomic/conf auto/lib/libatomic/make auto/lib/libgd/conf auto/lib/libxslt/conf auto/lib/make auto/lib/md5/conf auto/lib/md5/make auto/lib/md5/makefile.bcc auto/lib/md5/makefile.msvc auto/lib/md5/makefile.owc auto/lib/openssl/conf auto/lib/openssl/make auto/lib/openssl/makefile.bcc auto/lib/openssl/makefile.msvc auto/lib/pcre/conf auto/lib/pcre/make auto/lib/pcre/makefile.bcc auto/lib/pcre/makefile.msvc auto/lib/pcre/makefile.owc auto/lib/perl/conf auto/lib/perl/make auto/lib/sha1/conf auto/lib/sha1/make auto/lib/sha1/makefile.bcc auto/lib/sha1/makefile.msvc auto/lib/sha1/makefile.owc auto/lib/test auto/lib/zlib/conf auto/lib/zlib/make auto/lib/zlib/makefile.bcc auto/lib/zlib/makefile.msvc auto/lib/zlib/makefile.owc auto/make auto/modules auto/nohave auto/options auto/os/conf auto/os/darwin auto/os/freebsd auto/os/linux auto/os/solaris auto/os/win32 auto/sources auto/stubs auto/summary auto/types/sizeof auto/types/typedef auto/types/uintptr_t auto/types/value auto/unix configure man/nginx.8 src/core/nginx.c src/core/nginx.h src/core/ngx_array.c src/core/ngx_array.h src/core/ngx_buf.c src/core/ngx_buf.h src/core/ngx_conf_file.c src/core/ngx_conf_file.h src/core/ngx_config.h src/core/ngx_connection.c src/core/ngx_connection.h src/core/ngx_core.h src/core/ngx_cpuinfo.c src/core/ngx_crc.h src/core/ngx_crc32.c src/core/ngx_crc32.h src/core/ngx_crypt.h src/core/ngx_cycle.c src/core/ngx_cycle.h src/core/ngx_file.c src/core/ngx_file.h src/core/ngx_hash.c src/core/ngx_hash.h src/core/ngx_inet.c src/core/ngx_inet.h src/core/ngx_list.c src/core/ngx_list.h src/core/ngx_log.c src/core/ngx_log.h src/core/ngx_md5.h src/core/ngx_murmurhash.h src/core/ngx_open_file_cache.c src/core/ngx_open_file_cache.h src/core/ngx_output_chain.c src/core/ngx_palloc.c src/core/ngx_palloc.h src/core/ngx_parse.c src/core/ngx_parse.h src/core/ngx_queue.c src/core/ngx_queue.h src/core/ngx_radix_tree.c src/core/ngx_radix_tree.h src/core/ngx_rbtree.c src/core/ngx_rbtree.h src/core/ngx_regex.c src/core/ngx_regex.h src/core/ngx_resolver.c src/core/ngx_resolver.h src/core/ngx_sha1.h src/core/ngx_shmtx.c src/core/ngx_shmtx.h src/core/ngx_slab.c src/core/ngx_slab.h src/core/ngx_spinlock.c src/core/ngx_string.c src/core/ngx_string.h src/core/ngx_times.c src/core/ngx_times.h src/event/modules/ngx_aio_module.c src/event/modules/ngx_devpoll_module.c src/event/modules/ngx_epoll_module.c src/event/modules/ngx_eventport_module.c src/event/modules/ngx_kqueue_module.c src/event/modules/ngx_poll_module.c src/event/modules/ngx_rtsig_module.c src/event/modules/ngx_select_module.c src/event/modules/ngx_win32_select_module.c src/event/ngx_event.c src/event/ngx_event.h src/event/ngx_event_accept.c src/event/ngx_event_busy_lock.c src/event/ngx_event_busy_lock.h src/event/ngx_event_connect.c src/event/ngx_event_connect.h src/event/ngx_event_mutex.c src/event/ngx_event_openssl.c src/event/ngx_event_openssl.h src/event/ngx_event_pipe.c src/event/ngx_event_pipe.h src/event/ngx_event_posted.c src/event/ngx_event_posted.h src/event/ngx_event_timer.c src/event/ngx_event_timer.h src/http/modules/ngx_http_access_module.c src/http/modules/ngx_http_addition_filter_module.c src/http/modules/ngx_http_auth_basic_module.c src/http/modules/ngx_http_autoindex_module.c src/http/modules/ngx_http_browser_module.c src/http/modules/ngx_http_charset_filter_module.c src/http/modules/ngx_http_chunked_filter_module.c src/http/modules/ngx_http_dav_module.c src/http/modules/ngx_http_degradation_module.c src/http/modules/ngx_http_empty_gif_module.c src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_flv_module.c src/http/modules/ngx_http_geo_module.c src/http/modules/ngx_http_geoip_module.c src/http/modules/ngx_http_gzip_filter_module.c src/http/modules/ngx_http_gzip_static_module.c src/http/modules/ngx_http_headers_filter_module.c src/http/modules/ngx_http_image_filter_module.c src/http/modules/ngx_http_index_module.c src/http/modules/ngx_http_limit_conn_module.c src/http/modules/ngx_http_limit_req_module.c src/http/modules/ngx_http_log_module.c src/http/modules/ngx_http_map_module.c src/http/modules/ngx_http_memcached_module.c src/http/modules/ngx_http_mp4_module.c src/http/modules/ngx_http_not_modified_filter_module.c src/http/modules/ngx_http_proxy_module.c src/http/modules/ngx_http_random_index_module.c src/http/modules/ngx_http_range_filter_module.c src/http/modules/ngx_http_realip_module.c src/http/modules/ngx_http_referer_module.c src/http/modules/ngx_http_rewrite_module.c src/http/modules/ngx_http_scgi_module.c src/http/modules/ngx_http_secure_link_module.c src/http/modules/ngx_http_split_clients_module.c src/http/modules/ngx_http_ssi_filter_module.c src/http/modules/ngx_http_ssi_filter_module.h src/http/modules/ngx_http_ssl_module.c src/http/modules/ngx_http_ssl_module.h src/http/modules/ngx_http_static_module.c src/http/modules/ngx_http_stub_status_module.c src/http/modules/ngx_http_sub_filter_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_keepalive_module.c src/http/modules/ngx_http_userid_filter_module.c src/http/modules/ngx_http_uwsgi_module.c src/http/modules/ngx_http_xslt_filter_module.c src/http/modules/perl/Makefile.PL src/http/modules/perl/nginx.pm src/http/modules/perl/nginx.xs src/http/modules/perl/ngx_http_perl_module.c src/http/modules/perl/ngx_http_perl_module.h src/http/ngx_http.c src/http/ngx_http.h src/http/ngx_http_busy_lock.c src/http/ngx_http_busy_lock.h src/http/ngx_http_cache.h src/http/ngx_http_config.h src/http/ngx_http_copy_filter_module.c src/http/ngx_http_core_module.c src/http/ngx_http_core_module.h src/http/ngx_http_file_cache.c src/http/ngx_http_header_filter_module.c src/http/ngx_http_parse.c src/http/ngx_http_parse_time.c src/http/ngx_http_postpone_filter_module.c src/http/ngx_http_request.c src/http/ngx_http_request.h src/http/ngx_http_request_body.c src/http/ngx_http_script.c src/http/ngx_http_script.h src/http/ngx_http_special_response.c src/http/ngx_http_upstream.c src/http/ngx_http_upstream.h src/http/ngx_http_upstream_round_robin.c src/http/ngx_http_upstream_round_robin.h src/http/ngx_http_variables.c src/http/ngx_http_variables.h src/http/ngx_http_write_filter_module.c src/mail/ngx_mail.c src/mail/ngx_mail.h src/mail/ngx_mail_auth_http_module.c src/mail/ngx_mail_core_module.c src/mail/ngx_mail_handler.c src/mail/ngx_mail_imap_handler.c src/mail/ngx_mail_imap_module.c src/mail/ngx_mail_imap_module.h src/mail/ngx_mail_parse.c src/mail/ngx_mail_pop3_handler.c src/mail/ngx_mail_pop3_module.c src/mail/ngx_mail_pop3_module.h src/mail/ngx_mail_proxy_module.c src/mail/ngx_mail_smtp_handler.c src/mail/ngx_mail_smtp_module.c src/mail/ngx_mail_smtp_module.h src/mail/ngx_mail_ssl_module.c src/mail/ngx_mail_ssl_module.h src/misc/ngx_google_perftools_module.c src/os/unix/ngx_aio_read.c src/os/unix/ngx_aio_read_chain.c src/os/unix/ngx_aio_write.c src/os/unix/ngx_aio_write_chain.c src/os/unix/ngx_alloc.c src/os/unix/ngx_alloc.h src/os/unix/ngx_atomic.h src/os/unix/ngx_channel.c src/os/unix/ngx_channel.h src/os/unix/ngx_daemon.c src/os/unix/ngx_darwin.h src/os/unix/ngx_darwin_config.h src/os/unix/ngx_darwin_init.c src/os/unix/ngx_darwin_sendfile_chain.c src/os/unix/ngx_errno.c src/os/unix/ngx_errno.h src/os/unix/ngx_file_aio_read.c src/os/unix/ngx_files.c src/os/unix/ngx_files.h src/os/unix/ngx_freebsd.h src/os/unix/ngx_freebsd_config.h src/os/unix/ngx_freebsd_init.c src/os/unix/ngx_freebsd_rfork_thread.c src/os/unix/ngx_freebsd_rfork_thread.h src/os/unix/ngx_freebsd_sendfile_chain.c src/os/unix/ngx_gcc_atomic_amd64.h src/os/unix/ngx_gcc_atomic_ppc.h src/os/unix/ngx_gcc_atomic_sparc64.h src/os/unix/ngx_gcc_atomic_x86.h src/os/unix/ngx_linux.h src/os/unix/ngx_linux_aio_read.c src/os/unix/ngx_linux_config.h src/os/unix/ngx_linux_init.c src/os/unix/ngx_linux_sendfile_chain.c src/os/unix/ngx_os.h src/os/unix/ngx_posix_config.h src/os/unix/ngx_posix_init.c src/os/unix/ngx_process.c src/os/unix/ngx_process.h src/os/unix/ngx_process_cycle.c src/os/unix/ngx_process_cycle.h src/os/unix/ngx_pthread_thread.c src/os/unix/ngx_readv_chain.c src/os/unix/ngx_recv.c src/os/unix/ngx_send.c src/os/unix/ngx_setproctitle.c src/os/unix/ngx_setproctitle.h src/os/unix/ngx_shmem.c src/os/unix/ngx_shmem.h src/os/unix/ngx_socket.c src/os/unix/ngx_socket.h src/os/unix/ngx_solaris.h src/os/unix/ngx_solaris_config.h src/os/unix/ngx_solaris_init.c src/os/unix/ngx_solaris_sendfilev_chain.c src/os/unix/ngx_sunpro_amd64.il src/os/unix/ngx_sunpro_atomic_sparc64.h src/os/unix/ngx_sunpro_sparc64.il src/os/unix/ngx_sunpro_x86.il src/os/unix/ngx_thread.h src/os/unix/ngx_time.c src/os/unix/ngx_time.h src/os/unix/ngx_udp_recv.c src/os/unix/ngx_user.c src/os/unix/ngx_user.h src/os/unix/ngx_writev_chain.c src/os/unix/rfork_thread.S
diffstat 325 files changed, 743 insertions(+), 184 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Jan 16 00:00:00 2012 +0400
+++ b/CHANGES	Mon Jan 30 00:00:00 2012 +0400
@@ -1,4 +1,22 @@
 
+Changes with nginx 1.1.14                                        30 Jan 2012
+
+    *) Feature: multiple "limit_req" limits may be used simultaneously.
+
+    *) Bugfix: in error handling while connecting to a backend.
+       Thanks to Piotr Sikora.
+
+    *) Bugfix: in AIO error handling on FreeBSD.
+
+    *) Bugfix: in the OpenSSL library initialization.
+
+    *) Bugfix: the "proxy_redirect" directives might not be correctly
+       inherited.
+
+    *) Bugfix: memory leak during reconfiguration if the "pcre_jit"
+       directive was used.
+
+
 Changes with nginx 1.1.13                                        16 Jan 2012
 
     *) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
--- a/CHANGES.ru	Mon Jan 16 00:00:00 2012 +0400
+++ b/CHANGES.ru	Mon Jan 30 00:00:00 2012 +0400
@@ -1,4 +1,23 @@
 
+Изменения в nginx 1.1.14                                          30.01.2012
+
+    *) Добавление: теперь можно указать несколько ограничений limit_req
+       одновременно.
+
+    *) Исправление: в обработке ошибок при соединении с бэкендом.
+       Спасибо Piotr Sikora.
+
+    *) Исправление: в обработке ошибок при использовании AIO на FreeBSD.
+
+    *) Исправление: в инициализации библиотеки OpenSSL.
+
+    *) Исправление: директивы proxy_redirect могли наследоваться
+       некорректно.
+
+    *) Исправление: утечки памяти при переконфигурации, если использовалась
+       директива pcre_jit.
+
+
 Изменения в nginx 1.1.13                                          16.01.2012
 
     *) Добавление: параметры TLSv1.1 и TLSv1.2 в директиве ssl_protocols.
@@ -7,10 +26,10 @@
        ошибка появилась в 1.1.12.
 
     *) Исправление: директива proxy_redirect некорректно обрабатывала
-       заголовк Refresh при использовании регулярных выражений.
+       заголовок Refresh при использовании регулярных выражений.
 
     *) Исправление: директива proxy_cache_use_stale с параметром error не
-       возвращала ответ из кэша, если все бекенды были признаны
+       возвращала ответ из кэша, если все бэкенды были признаны
        неработающими.
 
     *) Исправление: директива worker_cpu_affinity могла не работать.
--- a/LICENSE	Mon Jan 16 00:00:00 2012 +0400
+++ b/LICENSE	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 /* 
  * Copyright (C) 2002-2012 Igor Sysoev
+ * Copyright (C) 2011,2012 Nginx, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
--- a/auto/cc/acc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/acc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # aCC: HP ANSI C++ B3910B A.03.55.02
--- a/auto/cc/bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # Borland C++ 5.5
--- a/auto/cc/ccc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/ccc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # Compaq C V6.5-207
--- a/auto/cc/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 LINK="\$(CC)"
--- a/auto/cc/gcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/gcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
--- a/auto/cc/icc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/icc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
--- a/auto/cc/msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # MSVC 6.0 SP2
--- a/auto/cc/name	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/name	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ "$NGX_PLATFORM" != win32 ]; then
--- a/auto/cc/owc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/owc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # Open Watcom C 1.0, 1.2, 1.3
--- a/auto/cc/sunc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/cc/sunc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 # Sun C 5.7 Patch 117837-04 2005/05/11    Sun Studio 10
--- a/auto/define	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/define	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END >> $NGX_AUTO_CONFIG_H
--- a/auto/endianess	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/endianess	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for system endianess ...$ngx_c"
--- a/auto/feature	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/feature	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for $ngx_feature ...$ngx_c"
--- a/auto/have	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/have	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END >> $NGX_AUTO_CONFIG_H
--- a/auto/have_headers	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/have_headers	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END >> $NGX_AUTO_HEADERS_H
--- a/auto/headers	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/headers	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 ngx_include="unistd.h";      . auto/include
--- a/auto/include	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/include	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for $ngx_include ...$ngx_c"
--- a/auto/init	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/init	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 NGX_MAKEFILE=$NGX_OBJS/Makefile
--- a/auto/install	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/install	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $USE_PERL = YES ]; then
--- a/auto/lib/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $USE_PCRE = YES -o $PCRE != NONE ]; then
--- a/auto/lib/geoip/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/geoip/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
     ngx_feature="GeoIP library"
--- a/auto/lib/google-perftools/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/google-perftools/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
     ngx_feature="Google perftools"
--- a/auto/lib/libatomic/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/libatomic/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $NGX_LIBATOMIC != YES ]; then
--- a/auto/lib/libatomic/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/libatomic/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
     cat << END                                            >> $NGX_MAKEFILE
--- a/auto/lib/libgd/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/libgd/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
     ngx_feature="GD library"
--- a/auto/lib/libxslt/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/libxslt/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
     ngx_feature="libxslt"
--- a/auto/lib/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then
--- a/auto/lib/md5/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/md5/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $MD5 != NONE ]; then
--- a/auto/lib/md5/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/md5/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 case "$NGX_CC_NAME" in
--- a/auto/lib/md5/makefile.bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/md5/makefile.bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
--- a/auto/lib/md5/makefile.msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/md5/makefile.msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
--- a/auto/lib/md5/makefile.owc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/md5/makefile.owc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
--- a/auto/lib/openssl/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/openssl/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $OPENSSL != NONE ]; then
--- a/auto/lib/openssl/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/openssl/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 case "$CC" in
--- a/auto/lib/openssl/makefile.bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/openssl/makefile.bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 all:
--- a/auto/lib/openssl/makefile.msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/openssl/makefile.msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 all:
--- a/auto/lib/pcre/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/pcre/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $PCRE != NONE ]; then
--- a/auto/lib/pcre/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/pcre/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 case "$NGX_CC_NAME" in
--- a/auto/lib/pcre/makefile.bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/pcre/makefile.bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS =	-q -O2 -tWM -w-8004 $(CPU_OPT)
--- a/auto/lib/pcre/makefile.msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/pcre/makefile.msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS =	-O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
--- a/auto/lib/pcre/makefile.owc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/pcre/makefile.owc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS =	-c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
--- a/auto/lib/perl/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/perl/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo "checking for perl"
--- a/auto/lib/perl/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/perl/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END                                                    >> $NGX_MAKEFILE
--- a/auto/lib/sha1/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/sha1/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $SHA1 != NONE ]; then
--- a/auto/lib/sha1/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/sha1/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 case "$NGX_CC_NAME" in
--- a/auto/lib/sha1/makefile.bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/sha1/makefile.bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
--- a/auto/lib/sha1/makefile.msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/sha1/makefile.msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
--- a/auto/lib/sha1/makefile.owc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/sha1/makefile.owc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
--- a/auto/lib/test	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/test	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for $ngx_lib ...$ngx_c"
--- a/auto/lib/zlib/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/zlib/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $ZLIB != NONE ]; then
--- a/auto/lib/zlib/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/zlib/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 case "$NGX_CC_NAME" in
--- a/auto/lib/zlib/makefile.bcc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/zlib/makefile.bcc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -q -O2 -tWM -w-8004 -w-8012 $(CPU_OPT)
--- a/auto/lib/zlib/makefile.msvc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/zlib/makefile.msvc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
--- a/auto/lib/zlib/makefile.owc	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/lib/zlib/makefile.owc	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CFLAGS = -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
--- a/auto/make	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/make	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo "creating $NGX_MAKEFILE"
--- a/auto/modules	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/modules	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
--- a/auto/nohave	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/nohave	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END >> $NGX_AUTO_CONFIG_H
--- a/auto/options	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/options	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 help=no
--- a/auto/os/conf	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/conf	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo "checking for $NGX_SYSTEM specific features"
--- a/auto/os/darwin	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/darwin	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_DARWIN . auto/have_headers
--- a/auto/os/freebsd	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/freebsd	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_FREEBSD . auto/have_headers
--- a/auto/os/linux	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/linux	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_LINUX . auto/have_headers
--- a/auto/os/solaris	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/solaris	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_SOLARIS . auto/have_headers
--- a/auto/os/win32	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/os/win32	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_WIN32 . auto/have_headers
--- a/auto/sources	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/sources	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module"
--- a/auto/stubs	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/stubs	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 have=NGX_SUPPRESS_WARN . auto/have
--- a/auto/summary	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/summary	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 ### STUB
--- a/auto/types/sizeof	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/types/sizeof	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for $ngx_type size ...$ngx_c"
--- a/auto/types/typedef	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/types/typedef	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for $ngx_type ...$ngx_c"
--- a/auto/types/uintptr_t	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/types/uintptr_t	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 echo $ngx_n "checking for uintptr_t ...$ngx_c"
--- a/auto/types/value	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/types/value	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 cat << END >> $NGX_AUTO_CONFIG_H
--- a/auto/unix	Mon Jan 16 00:00:00 2012 +0400
+++ b/auto/unix	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 NGX_USER=${NGX_USER:-nobody}
--- a/configure	Mon Jan 16 00:00:00 2012 +0400
+++ b/configure	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 
 . auto/options
--- a/man/nginx.8	Mon Jan 16 00:00:00 2012 +0400
+++ b/man/nginx.8	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 .\"
 .\" Copyright (c) 2010 Sergey A. Osokin
+.\" Copyright (c) 2011,2012 Nginx, Inc.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
--- a/src/core/nginx.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/nginx.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/nginx.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/nginx.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -8,8 +9,8 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define nginx_version      1001013
-#define NGINX_VERSION      "1.1.13"
+#define nginx_version      1001014
+#define NGINX_VERSION      "1.1.14"
 #define NGINX_VER          "nginx/" NGINX_VERSION
 
 #define NGINX_VAR          "NGINX"
--- a/src/core/ngx_array.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_array.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_array.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_array.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_buf.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_buf.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_buf.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_buf.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_conf_file.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_conf_file.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_conf_file.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_conf_file.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_connection.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_connection.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_connection.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_connection.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_core.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_core.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_cpuinfo.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_cpuinfo.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_crc.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_crc.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_crc32.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_crc32.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_crc32.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_crc32.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_crypt.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_crypt.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_cycle.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_cycle.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_cycle.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_cycle.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_file.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_file.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_file.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_file.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_hash.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_hash.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_hash.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_hash.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_inet.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_inet.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_inet.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_inet.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_list.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_list.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_list.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_list.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_log.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_log.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_log.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_log.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_md5.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_md5.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_murmurhash.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_murmurhash.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_open_file_cache.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_open_file_cache.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_open_file_cache.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_open_file_cache.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_output_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_output_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_palloc.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_palloc.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_palloc.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_palloc.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_parse.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_parse.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_parse.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_parse.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_queue.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_queue.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_queue.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_queue.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_radix_tree.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_radix_tree.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_radix_tree.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_radix_tree.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_rbtree.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_rbtree.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_rbtree.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_rbtree.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_regex.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_regex.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -15,6 +16,9 @@
 
 static void * ngx_libc_cdecl ngx_regex_malloc(size_t size);
 static void ngx_libc_cdecl ngx_regex_free(void *p);
+#if (NGX_HAVE_PCRE_JIT)
+static void ngx_pcre_free_studies(void *data);
+#endif
 
 static ngx_int_t ngx_regex_module_init(ngx_cycle_t *cycle);
 
@@ -273,6 +277,41 @@
 }
 
 
+#if (NGX_HAVE_PCRE_JIT)
+
+static void
+ngx_pcre_free_studies(void *data)
+{
+    ngx_list_t *studies = data;
+
+    ngx_uint_t        i;
+    ngx_list_part_t  *part;
+    ngx_regex_elt_t  *elts;
+
+    part = &studies->part;
+    elts = part->elts;
+
+    for (i = 0 ; /* void */ ; i++) {
+
+        if (i >= part->nelts) {
+            if (part->next == NULL) {
+                break;
+            }
+
+            part = part->next;
+            elts = part->elts;
+            i = 0;
+        }
+
+        if (elts[i].regex->extra != NULL) {
+            pcre_free_study(elts[i].regex->extra);
+        }
+    }
+}
+
+#endif
+
+
 static ngx_int_t
 ngx_regex_module_init(ngx_cycle_t *cycle)
 {
@@ -286,12 +325,27 @@
 
 #if (NGX_HAVE_PCRE_JIT)
     {
-    ngx_regex_conf_t  *rcf;
+    ngx_regex_conf_t    *rcf;
+    ngx_pool_cleanup_t  *cln;
 
     rcf = (ngx_regex_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_regex_module);
 
     if (rcf->pcre_jit) {
         opt = PCRE_STUDY_JIT_COMPILE;
+
+        /*
+         * The PCRE JIT compiler uses mmap for its executable codes, so we
+         * have to explicitly call the pcre_free_study() function to free
+         * this memory.
+         */
+
+        cln = ngx_pool_cleanup_add(cycle->pool, 0);
+        if (cln == NULL) {
+            return NGX_ERROR;
+        }
+
+        cln->handler = ngx_pcre_free_studies;
+        cln->data = ngx_pcre_studies;
     }
     }
 #endif
@@ -402,7 +456,7 @@
     }
 #else
     ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
-                       "nginx was build without PCRE JIT support");
+                       "nginx was built without PCRE JIT support");
     *fp = 0;
 #endif
 
--- a/src/core/ngx_regex.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_regex.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_resolver.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_resolver.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_resolver.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_resolver.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_sha1.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_sha1.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_shmtx.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_shmtx.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_shmtx.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_shmtx.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_slab.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_slab.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 #include <ngx_config.h>
--- a/src/core/ngx_slab.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_slab.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_spinlock.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_spinlock.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_string.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_string.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_string.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_string.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_times.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_times.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/core/ngx_times.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/core/ngx_times.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_aio_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_aio_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_devpoll_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_devpoll_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_epoll_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_epoll_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_eventport_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_eventport_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_kqueue_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_kqueue_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_poll_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_poll_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_rtsig_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_rtsig_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_select_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_select_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/modules/ngx_win32_select_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/modules/ngx_win32_select_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_accept.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_accept.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_busy_lock.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_busy_lock.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_busy_lock.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_busy_lock.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_connect.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_connect.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -159,6 +160,9 @@
             ngx_log_error(level, c->log, err, "connect() to %V failed",
                           pc->name);
 
+            ngx_close_connection(c);
+            pc->connection = NULL;
+
             return NGX_DECLINED;
         }
     }
@@ -240,12 +244,8 @@
 
 failed:
 
-    ngx_free_connection(c);
-
-    if (ngx_close_socket(s) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
-                      ngx_close_socket_n " failed");
-    }
+    ngx_close_connection(c);
+    pc->connection = NULL;
 
     return NGX_ERROR;
 }
--- a/src/event/ngx_event_connect.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_connect.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_mutex.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_mutex.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_openssl.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_openssl.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -91,8 +92,6 @@
     SSL_library_init();
     SSL_load_error_strings();
 
-    ENGINE_load_builtin_engines();
-
     OpenSSL_add_all_algorithms();
 
     ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
--- a/src/event/ngx_event_openssl.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_openssl.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_pipe.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_pipe.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_pipe.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_pipe.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_posted.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_posted.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_posted.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_posted.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_timer.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_timer.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/event/ngx_event_timer.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/event/ngx_event_timer.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_access_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_access_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_addition_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_addition_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_auth_basic_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_auth_basic_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_autoindex_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_autoindex_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_browser_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_browser_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_charset_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_charset_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_chunked_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_chunked_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_dav_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_dav_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_degradation_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_degradation_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_empty_gif_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_empty_gif_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 #include <ngx_config.h>
--- a/src/http/modules/ngx_http_fastcgi_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_fastcgi_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_flv_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_flv_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 #include <ngx_config.h>
--- a/src/http/modules/ngx_http_geo_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_geo_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_geoip_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_geoip_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_gzip_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_gzip_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_gzip_static_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_gzip_static_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_headers_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_headers_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_image_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_image_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_index_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_index_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_limit_conn_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_limit_conn_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_limit_req_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_limit_req_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -17,6 +18,7 @@
     ngx_msec_t                   last;
     /* integer value, 1 corresponds to 0.001 r/s */
     ngx_uint_t                   excess;
+    ngx_uint_t                   count;
     u_char                       data[1];
 } ngx_http_limit_req_node_t;
 
@@ -35,6 +37,7 @@
     ngx_uint_t                   rate;
     ngx_int_t                    index;
     ngx_str_t                    var;
+    ngx_http_limit_req_node_t   *node;
 } ngx_http_limit_req_ctx_t;
 
 
@@ -42,16 +45,23 @@
     ngx_shm_zone_t              *shm_zone;
     /* integer value, 1 corresponds to 0.001 r/s */
     ngx_uint_t                   burst;
+    ngx_uint_t                   nodelay; /* unsigned  nodelay:1 */
+} ngx_http_limit_req_limit_t;
+
+
+typedef struct {
+    ngx_array_t                  limits;
     ngx_uint_t                   limit_log_level;
     ngx_uint_t                   delay_log_level;
-
-    ngx_uint_t                   nodelay; /* unsigned  nodelay:1 */
 } ngx_http_limit_req_conf_t;
 
 
 static void ngx_http_limit_req_delay(ngx_http_request_t *r);
-static ngx_int_t ngx_http_limit_req_lookup(ngx_http_limit_req_conf_t *lrcf,
-    ngx_uint_t hash, u_char *data, size_t len, ngx_uint_t *ep);
+static ngx_int_t ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit,
+    ngx_uint_t hash, u_char *data, size_t len, ngx_uint_t *ep,
+    ngx_uint_t account);
+static ngx_msec_t ngx_http_limit_req_account(ngx_http_limit_req_limit_t *limits,
+    ngx_uint_t n, ngx_uint_t *ep, ngx_http_limit_req_limit_t **limit);
 static void ngx_http_limit_req_expire(ngx_http_limit_req_ctx_t *ctx,
     ngx_uint_t n);
 
@@ -135,123 +145,124 @@
 static ngx_int_t
 ngx_http_limit_req_handler(ngx_http_request_t *r)
 {
-    size_t                      len, n;
-    uint32_t                    hash;
-    ngx_int_t                   rc;
-    ngx_uint_t                  excess;
-    ngx_time_t                 *tp;
-    ngx_rbtree_node_t          *node;
-    ngx_http_variable_value_t  *vv;
-    ngx_http_limit_req_ctx_t   *ctx;
-    ngx_http_limit_req_node_t  *lr;
-    ngx_http_limit_req_conf_t  *lrcf;
+    size_t                       len;
+    uint32_t                     hash;
+    ngx_int_t                    rc;
+    ngx_uint_t                   n, excess;
+    ngx_msec_t                   delay;
+    ngx_http_variable_value_t   *vv;
+    ngx_http_limit_req_ctx_t    *ctx;
+    ngx_http_limit_req_conf_t   *lrcf;
+    ngx_http_limit_req_limit_t  *limit, *limits;
 
     if (r->main->limit_req_set) {
         return NGX_DECLINED;
     }
 
     lrcf = ngx_http_get_module_loc_conf(r, ngx_http_limit_req_module);
+    limits = lrcf->limits.elts;
 
-    if (lrcf->shm_zone == NULL) {
-        return NGX_DECLINED;
+    excess = 0;
+
+    rc = NGX_DECLINED;
+
+#if (NGX_SUPPRESS_WARN)
+    limit = NULL;
+#endif
+
+    for (n = 0; n < lrcf->limits.nelts; n++) {
+
+        limit = &limits[n];
+
+        ctx = limit->shm_zone->data;
+
+        vv = ngx_http_get_indexed_variable(r, ctx->index);
+
+        if (vv == NULL || vv->not_found) {
+            continue;
+        }
+
+        len = vv->len;
+
+        if (len == 0) {
+            continue;
+        }
+
+        if (len > 65535) {
+            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                          "the value of the \"%V\" variable "
+                          "is more than 65535 bytes: \"%v\"",
+                          &ctx->var, vv);
+            continue;
+        }
+
+        hash = ngx_crc32_short(vv->data, len);
+
+        ngx_shmtx_lock(&ctx->shpool->mutex);
+
+        rc = ngx_http_limit_req_lookup(limit, hash, vv->data, len, &excess,
+                                       (n == lrcf->limits.nelts - 1));
+
+        ngx_shmtx_unlock(&ctx->shpool->mutex);
+
+        ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "limit_req[%ui]: %i %ui.%03ui",
+                       n, rc, excess / 1000, excess % 1000);
+
+        if (rc != NGX_AGAIN) {
+            break;
+        }
     }
 
-    ctx = lrcf->shm_zone->data;
-
-    vv = ngx_http_get_indexed_variable(r, ctx->index);
-
-    if (vv == NULL || vv->not_found) {
-        return NGX_DECLINED;
-    }
-
-    len = vv->len;
-
-    if (len == 0) {
-        return NGX_DECLINED;
-    }
-
-    if (len > 65535) {
-        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
-                      "the value of the \"%V\" variable "
-                      "is more than 65535 bytes: \"%v\"",
-                      &ctx->var, vv);
+    if (rc == NGX_DECLINED) {
         return NGX_DECLINED;
     }
 
     r->main->limit_req_set = 1;
 
-    hash = ngx_crc32_short(vv->data, len);
-
-    ngx_shmtx_lock(&ctx->shpool->mutex);
-
-    ngx_http_limit_req_expire(ctx, 1);
-
-    rc = ngx_http_limit_req_lookup(lrcf, hash, vv->data, len, &excess);
-
-    ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-                   "limit_req: %i %ui.%03ui", rc, excess / 1000, excess % 1000);
-
-    if (rc == NGX_DECLINED) {
+    if (rc == NGX_BUSY || rc == NGX_ERROR) {
 
-        n = offsetof(ngx_rbtree_node_t, color)
-            + offsetof(ngx_http_limit_req_node_t, data)
-            + len;
-
-        node = ngx_slab_alloc_locked(ctx->shpool, n);
-        if (node == NULL) {
-
-            ngx_http_limit_req_expire(ctx, 0);
-
-            node = ngx_slab_alloc_locked(ctx->shpool, n);
-            if (node == NULL) {
-                ngx_shmtx_unlock(&ctx->shpool->mutex);
-                return NGX_HTTP_SERVICE_UNAVAILABLE;
-            }
+        if (rc == NGX_BUSY) {
+            ngx_log_error(lrcf->limit_log_level, r->connection->log, 0,
+                          "limiting requests, excess: %ui.%03ui by zone \"%V\"",
+                          excess / 1000, excess % 1000,
+                          &limit->shm_zone->shm.name);
         }
 
-        lr = (ngx_http_limit_req_node_t *) &node->color;
-
-        node->key = hash;
-        lr->len = (u_char) len;
+        while (n--) {
+            ctx = limits[n].shm_zone->data;
 
-        tp = ngx_timeofday();
-        lr->last = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
-
-        lr->excess = 0;
-        ngx_memcpy(lr->data, vv->data, len);
-
-        ngx_rbtree_insert(&ctx->sh->rbtree, node);
-
-        ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
+            if (ctx->node == NULL) {
+                continue;
+            }
 
-        ngx_shmtx_unlock(&ctx->shpool->mutex);
+            ngx_shmtx_lock(&ctx->shpool->mutex);
 
-        return NGX_DECLINED;
-    }
-
-    ngx_shmtx_unlock(&ctx->shpool->mutex);
+            ctx->node->count--;
 
-    if (rc == NGX_OK) {
-        return NGX_DECLINED;
-    }
+            ngx_shmtx_unlock(&ctx->shpool->mutex);
 
-    if (rc == NGX_BUSY) {
-        ngx_log_error(lrcf->limit_log_level, r->connection->log, 0,
-                      "limiting requests, excess: %ui.%03ui by zone \"%V\"",
-                      excess / 1000, excess % 1000, &lrcf->shm_zone->shm.name);
+            ctx->node = NULL;
+        }
 
         return NGX_HTTP_SERVICE_UNAVAILABLE;
     }
 
-    /* rc == NGX_AGAIN */
+    /* rc == NGX_AGAIN || rc == NGX_OK */
 
-    if (lrcf->nodelay) {
+    if (rc == NGX_AGAIN) {
+        excess = 0;
+    }
+
+    delay = ngx_http_limit_req_account(limits, n, &excess, &limit);
+
+    if (!delay) {
         return NGX_DECLINED;
     }
 
     ngx_log_error(lrcf->delay_log_level, r->connection->log, 0,
                   "delaying request, excess: %ui.%03ui, by zone \"%V\"",
-                  excess / 1000, excess % 1000, &lrcf->shm_zone->shm.name);
+                  excess / 1000, excess % 1000, &limit->shm_zone->shm.name);
 
     if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
         return NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -259,8 +270,7 @@
 
     r->read_event_handler = ngx_http_test_reading;
     r->write_event_handler = ngx_http_limit_req_delay;
-    ngx_add_timer(r->connection->write,
-                  (ngx_msec_t) excess * 1000 / ctx->rate);
+    ngx_add_timer(r->connection->write, delay);
 
     return NGX_AGAIN;
 }
@@ -341,9 +351,10 @@
 
 
 static ngx_int_t
-ngx_http_limit_req_lookup(ngx_http_limit_req_conf_t *lrcf, ngx_uint_t hash,
-    u_char *data, size_t len, ngx_uint_t *ep)
+ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
+    u_char *data, size_t len, ngx_uint_t *ep, ngx_uint_t account)
 {
+    size_t                      size;
     ngx_int_t                   rc, excess;
     ngx_time_t                 *tp;
     ngx_msec_t                  now;
@@ -352,7 +363,10 @@
     ngx_http_limit_req_ctx_t   *ctx;
     ngx_http_limit_req_node_t  *lr;
 
-    ctx = lrcf->shm_zone->data;
+    tp = ngx_timeofday();
+    now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
+
+    ctx = limit->shm_zone->data;
 
     node = ctx->sh->rbtree.root;
     sentinel = ctx->sh->rbtree.sentinel;
@@ -380,9 +394,6 @@
                 ngx_queue_remove(&lr->queue);
                 ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
 
-                tp = ngx_timeofday();
-
-                now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
                 ms = (ngx_msec_int_t) (now - lr->last);
 
                 excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
@@ -393,18 +404,21 @@
 
                 *ep = excess;
 
-                if ((ngx_uint_t) excess > lrcf->burst) {
+                if ((ngx_uint_t) excess > limit->burst) {
                     return NGX_BUSY;
                 }
 
-                lr->excess = excess;
-                lr->last = now;
-
-                if (excess) {
-                    return NGX_AGAIN;
+                if (account) {
+                    lr->excess = excess;
+                    lr->last = now;
+                    return NGX_OK;
                 }
 
-                return NGX_OK;
+                lr->count++;
+
+                ctx->node = lr;
+
+                return NGX_AGAIN;
             }
 
             node = (rc < 0) ? node->left : node->right;
@@ -416,7 +430,115 @@
 
     *ep = 0;
 
-    return NGX_DECLINED;
+    size = offsetof(ngx_rbtree_node_t, color)
+           + offsetof(ngx_http_limit_req_node_t, data)
+           + len;
+
+    ngx_http_limit_req_expire(ctx, 1);
+
+    node = ngx_slab_alloc_locked(ctx->shpool, size);
+
+    if (node == NULL) {
+        ngx_http_limit_req_expire(ctx, 0);
+
+        node = ngx_slab_alloc_locked(ctx->shpool, size);
+        if (node == NULL) {
+            return NGX_ERROR;
+        }
+    }
+
+    node->key = hash;
+
+    ngx_rbtree_insert(&ctx->sh->rbtree, node);
+
+    lr = (ngx_http_limit_req_node_t *) &node->color;
+
+    ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
+
+    lr->len = (u_char) len;
+    lr->excess = 0;
+
+    ngx_memcpy(lr->data, data, len);
+
+    if (account) {
+        lr->last = now;
+        lr->count = 0;
+        return NGX_OK;
+    }
+
+    lr->last = 0;
+    lr->count = 1;
+
+    ctx->node = lr;
+
+    return NGX_AGAIN;
+}
+
+
+static ngx_msec_t
+ngx_http_limit_req_account(ngx_http_limit_req_limit_t *limits, ngx_uint_t n,
+    ngx_uint_t *ep, ngx_http_limit_req_limit_t **limit)
+{
+    ngx_int_t                   excess;
+    ngx_time_t                 *tp;
+    ngx_msec_t                  now, delay, max_delay;
+    ngx_msec_int_t              ms;
+    ngx_http_limit_req_ctx_t   *ctx;
+    ngx_http_limit_req_node_t  *lr;
+
+    excess = *ep;
+
+    if (excess == 0 || (*limit)->nodelay) {
+        max_delay = 0;
+
+    } else {
+        ctx = (*limit)->shm_zone->data;
+        max_delay = excess * 1000 / ctx->rate;
+    }
+
+    while (n--) {
+        ctx = limits[n].shm_zone->data;
+        lr = ctx->node;
+
+        if (lr == NULL) {
+            continue;
+        }
+
+        ngx_shmtx_lock(&ctx->shpool->mutex);
+
+        tp = ngx_timeofday();
+
+        now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
+        ms = (ngx_msec_int_t) (now - lr->last);
+
+        excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
+
+        if (excess < 0) {
+            excess = 0;
+        }
+
+        lr->last = now;
+        lr->excess = excess;
+        lr->count--;
+
+        ngx_shmtx_unlock(&ctx->shpool->mutex);
+
+        ctx->node = NULL;
+
+        if (limits[n].nodelay) {
+            continue;
+        }
+
+        delay = excess * 1000 / ctx->rate;
+
+        if (delay > max_delay) {
+            max_delay = delay;
+            *ep = excess;
+            *limit = &limits[n];
+        }
+    }
+
+    return max_delay;
 }
 
 
@@ -451,6 +573,16 @@
 
         lr = ngx_queue_data(q, ngx_http_limit_req_node_t, queue);
 
+        if (lr->count) {
+
+            /*
+             * There is not much sense in looking further,
+             * because we bump nodes on the lookup stage.
+             */
+
+            return;
+        }
+
         if (n++ != 0) {
 
             ms = (ngx_msec_int_t) (now - lr->last);
@@ -551,9 +683,7 @@
     /*
      * set by ngx_pcalloc():
      *
-     *     conf->shm_zone = NULL;
-     *     conf->burst = 0;
-     *     conf->nodelay = 0;
+     *     conf->limits.elts = NULL;
      */
 
     conf->limit_log_level = NGX_CONF_UNSET_UINT;
@@ -568,10 +698,8 @@
     ngx_http_limit_req_conf_t *prev = parent;
     ngx_http_limit_req_conf_t *conf = child;
 
-    if (conf->shm_zone == NULL) {
-        conf->shm_zone = prev->shm_zone;
-        conf->burst = prev->burst;
-        conf->nodelay = prev->nodelay;
+    if (conf->limits.elts == NULL) {
+        conf->limits = prev->limits;
     }
 
     ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level,
@@ -588,7 +716,8 @@
 ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     u_char                    *p;
-    size_t                     size, len;
+    size_t                     len;
+    ssize_t                    size;
     ngx_str_t                 *value, name, s;
     ngx_int_t                  rate, scale;
     ngx_uint_t                 i;
@@ -611,25 +740,32 @@
 
             p = (u_char *) ngx_strchr(name.data, ':');
 
-            if (p) {
-                *p = '\0';
-
-                name.len = p - name.data;
-
-                p++;
-
-                s.len = value[i].data + value[i].len - p;
-                s.data = p;
-
-                size = ngx_parse_size(&s);
-                if (size > 8191) {
-                    continue;
-                }
+            if (p == NULL) {
+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                                   "invalid zone size \"%V\"", &value[i]);
+                return NGX_CONF_ERROR;
             }
 
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "invalid zone size \"%V\"", &value[i]);
-            return NGX_CONF_ERROR;
+            name.len = p - name.data;
+
+            s.data = p + 1;
+            s.len = value[i].data + value[i].len - s.data;
+
+            size = ngx_parse_size(&s);
+
+            if (size == NGX_ERROR) {
+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                                   "invalid zone size \"%V\"", &value[i]);
+                return NGX_CONF_ERROR;
+            }
+
+            if (size < (ssize_t) (8 * ngx_pagesize)) {
+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                                   "zone \"%V\" is too small", &value[i]);
+                return NGX_CONF_ERROR;
+            }
+
+            continue;
         }
 
         if (ngx_strncmp(value[i].data, "rate=", 5) == 0) {
@@ -681,7 +817,7 @@
         return NGX_CONF_ERROR;
     }
 
-    if (name.len == 0 || size == 0) {
+    if (name.len == 0) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "\"%V\" must have \"zone\" parameter",
                            &cmd->name);
@@ -690,8 +826,8 @@
 
     if (ctx == NULL) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                           "no variable is defined for limit_req_zone \"%V\"",
-                           &cmd->name);
+                           "no variable is defined for %V \"%V\"",
+                           &cmd->name, &name);
         return NGX_CONF_ERROR;
     }
 
@@ -707,8 +843,8 @@
         ctx = shm_zone->data;
 
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                   "limit_req_zone \"%V\" is already bound to variable \"%V\"",
-                   &value[1], &ctx->var);
+                           "%V \"%V\" is already bound to variable \"%V\"",
+                           &cmd->name, &name, &ctx->var);
         return NGX_CONF_ERROR;
     }
 
@@ -724,17 +860,17 @@
 {
     ngx_http_limit_req_conf_t  *lrcf = conf;
 
-    ngx_int_t    burst;
-    ngx_str_t   *value, s;
-    ngx_uint_t   i;
-
-    if (lrcf->shm_zone) {
-        return "is duplicate";
-    }
+    ngx_int_t                    burst;
+    ngx_str_t                   *value, s;
+    ngx_uint_t                   i, nodelay;
+    ngx_shm_zone_t              *shm_zone;
+    ngx_http_limit_req_limit_t  *limit, *limits;
 
     value = cf->args->elts;
 
+    shm_zone = NULL;
     burst = 0;
+    nodelay = 0;
 
     for (i = 1; i < cf->args->nelts; i++) {
 
@@ -743,9 +879,9 @@
             s.len = value[i].len - 5;
             s.data = value[i].data + 5;
 
-            lrcf->shm_zone = ngx_shared_memory_add(cf, &s, 0,
-                                                   &ngx_http_limit_req_module);
-            if (lrcf->shm_zone == NULL) {
+            shm_zone = ngx_shared_memory_add(cf, &s, 0,
+                                             &ngx_http_limit_req_module);
+            if (shm_zone == NULL) {
                 return NGX_CONF_ERROR;
             }
 
@@ -765,7 +901,7 @@
         }
 
         if (ngx_strncmp(value[i].data, "nodelay", 7) == 0) {
-            lrcf->nodelay = 1;
+            nodelay = 1;
             continue;
         }
 
@@ -774,21 +910,42 @@
         return NGX_CONF_ERROR;
     }
 
-    if (lrcf->shm_zone == NULL) {
+    if (shm_zone == NULL) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "\"%V\" must have \"zone\" parameter",
                            &cmd->name);
         return NGX_CONF_ERROR;
     }
 
-    if (lrcf->shm_zone->data == NULL) {
+    if (shm_zone->data == NULL) {
         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                            "unknown limit_req_zone \"%V\"",
-                           &lrcf->shm_zone->shm.name);
+                           &shm_zone->shm.name);
         return NGX_CONF_ERROR;
     }
 
-    lrcf->burst = burst * 1000;
+    limits = lrcf->limits.elts;
+
+    if (limits == NULL) {
+        if (ngx_array_init(&lrcf->limits, cf->pool, 1,
+                           sizeof(ngx_http_limit_req_limit_t))
+            != NGX_OK)
+        {
+            return NGX_CONF_ERROR;
+        }
+    }
+
+    for (i = 0; i < lrcf->limits.nelts; i++) {
+        if (shm_zone == limits[i].shm_zone) {
+            return "is duplicate";
+        }
+    }
+
+    limit = ngx_array_push(&lrcf->limits);
+
+    limit->shm_zone = shm_zone;
+    limit->burst = burst * 1000;
+    limit->nodelay = nodelay;
 
     return NGX_CONF_OK;
 }
--- a/src/http/modules/ngx_http_log_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_log_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_map_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_map_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_memcached_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_memcached_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_mp4_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_mp4_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 #include <ngx_config.h>
--- a/src/http/modules/ngx_http_not_modified_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_not_modified_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_proxy_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_proxy_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -3291,6 +3292,8 @@
         return NGX_CONF_OK;
     }
 
+    plcf->redirect = 1;
+
     value = cf->args->elts;
 
     if (cf->args->nelts == 2) {
--- a/src/http/modules/ngx_http_random_index_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_random_index_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_range_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_range_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_realip_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_realip_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_referer_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_referer_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_rewrite_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_rewrite_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_scgi_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_scgi_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  * Copyright (C) Manlio Perillo (manlio.perillo@gmail.com)
  */
 
--- a/src/http/modules/ngx_http_secure_link_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_secure_link_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_split_clients_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_split_clients_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_ssi_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_ssi_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_ssi_filter_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_ssi_filter_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_ssl_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_ssl_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_ssl_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_ssl_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_static_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_static_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_stub_status_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_stub_status_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_sub_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_sub_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Maxim Dounin
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_userid_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_userid_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_uwsgi_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_uwsgi_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -3,6 +3,7 @@
  * Copyright (C) Unbit S.a.s. 2009-2010
  * Copyright (C) 2008 Manlio Perillo (manlio.perillo@gmail.com)
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/ngx_http_xslt_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/ngx_http_xslt_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/perl/Makefile.PL	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/perl/Makefile.PL	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 
 # Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
 
 use 5.006001;
 use ExtUtils::MakeMaker;
--- a/src/http/modules/perl/nginx.pm	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/perl/nginx.pm	Mon Jan 30 00:00:00 2012 +0400
@@ -48,7 +48,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '1.1.13';
+our $VERSION = '1.1.14';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
@@ -128,6 +128,7 @@
 =head1 COPYRIGHT AND LICENSE
 
 Copyright (C) Igor Sysoev
+Copyright (C) Nginx, Inc.
 
 
 =cut
--- a/src/http/modules/perl/nginx.xs	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/perl/nginx.xs	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/perl/ngx_http_perl_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/perl/ngx_http_perl_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/modules/perl/ngx_http_perl_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/modules/perl/ngx_http_perl_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_busy_lock.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_busy_lock.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_busy_lock.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_busy_lock.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_cache.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_cache.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_copy_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_copy_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -189,7 +190,7 @@
 
             rc = n;
 
-            if (file->aio) {
+            if (rc == NGX_AGAIN) {
                 file->aio->data = r;
                 file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
 
--- a/src/http/ngx_http_core_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_core_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_core_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_core_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_file_cache.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_file_cache.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_header_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_header_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_parse.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_parse.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_parse_time.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_parse_time.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_postpone_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_postpone_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_request.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_request.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_request.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_request.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_request_body.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_request_body.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_script.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_script.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_script.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_script.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_special_response.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_special_response.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_upstream.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_upstream.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_upstream.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_upstream.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_upstream_round_robin.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_upstream_round_robin.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_upstream_round_robin.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_upstream_round_robin.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_variables.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_variables.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_variables.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_variables.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/http/ngx_http_write_filter_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/http/ngx_http_write_filter_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_auth_http_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_auth_http_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_core_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_core_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_handler.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_handler.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_imap_handler.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_imap_handler.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_imap_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_imap_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_imap_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_imap_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_parse.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_parse.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_pop3_handler.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_pop3_handler.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_pop3_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_pop3_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_pop3_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_pop3_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_proxy_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_proxy_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_smtp_handler.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_smtp_handler.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_smtp_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_smtp_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_smtp_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_smtp_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_ssl_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_ssl_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/mail/ngx_mail_ssl_module.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/mail/ngx_mail_ssl_module.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/misc/ngx_google_perftools_module.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/misc/ngx_google_perftools_module.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_aio_read.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_aio_read.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_aio_read_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_aio_read_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_aio_write.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_aio_write.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_aio_write_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_aio_write_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_alloc.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_alloc.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_alloc.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_alloc.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_atomic.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_atomic.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_channel.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_channel.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_channel.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_channel.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_daemon.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_daemon.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_darwin.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_darwin.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_darwin_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_darwin_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_darwin_init.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_darwin_init.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_darwin_sendfile_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_darwin_sendfile_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_errno.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_errno.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_errno.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_errno.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_file_aio_read.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_file_aio_read.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
@@ -156,24 +157,15 @@
         return NGX_ERROR;
     }
 
-    if (n != 0) {
-        if (n == NGX_EINPROGRESS) {
-            if (ev->ready) {
-                ev->ready = 0;
-                ngx_log_error(NGX_LOG_ALERT, file->log, n,
-                              "aio_read(\"%V\") still in progress",
-                              &file->name);
-            }
-
-            return NGX_AGAIN;
+    if (n == NGX_EINPROGRESS) {
+        if (ev->ready) {
+            ev->ready = 0;
+            ngx_log_error(NGX_LOG_ALERT, file->log, n,
+                          "aio_read(\"%V\") still in progress",
+                          &file->name);
         }
 
-        aio->err = n;
-        ev->ready = 0;
-
-        ngx_log_error(NGX_LOG_CRIT, file->log, n,
-                      "aio_read(\"%V\") failed", &file->name);
-        return NGX_ERROR;
+        return NGX_AGAIN;
     }
 
     n = aio_return(&aio->aiocb);
@@ -181,9 +173,9 @@
     if (n == -1) {
         err = ngx_errno;
         aio->err = err;
-        ev->ready = 0;
+        ev->ready = 1;
 
-        ngx_log_error(NGX_LOG_ALERT, file->log, err,
+        ngx_log_error(NGX_LOG_CRIT, file->log, err,
                       "aio_return(\"%V\") failed", &file->name);
         return NGX_ERROR;
     }
--- a/src/os/unix/ngx_files.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_files.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_files.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_files.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd_init.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd_init.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd_rfork_thread.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd_rfork_thread.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd_rfork_thread.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd_rfork_thread.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_gcc_atomic_amd64.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_gcc_atomic_amd64.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_gcc_atomic_ppc.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_gcc_atomic_ppc.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_gcc_atomic_sparc64.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_gcc_atomic_sparc64.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_gcc_atomic_x86.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_gcc_atomic_x86.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_linux.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_linux.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_linux_aio_read.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_linux_aio_read.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_linux_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_linux_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_linux_init.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_linux_init.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_linux_sendfile_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_linux_sendfile_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_os.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_os.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_posix_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_posix_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_posix_init.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_posix_init.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_process.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_process.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_process.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_process.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_process_cycle.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_process_cycle.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_process_cycle.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_process_cycle.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_pthread_thread.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_pthread_thread.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_readv_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_readv_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_recv.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_recv.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_send.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_send.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_setproctitle.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_setproctitle.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_setproctitle.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_setproctitle.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_shmem.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_shmem.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_shmem.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_shmem.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_socket.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_socket.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_socket.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_socket.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_solaris.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_solaris.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_solaris_config.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_solaris_config.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_solaris_init.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_solaris_init.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_solaris_sendfilev_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_solaris_sendfilev_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_sunpro_amd64.il	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_sunpro_amd64.il	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 /
 / Copyright (C) Igor Sysoev
+/ Copyright (C) Nginx, Inc.
 /
 
 / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
--- a/src/os/unix/ngx_sunpro_atomic_sparc64.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_sunpro_atomic_sparc64.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_sunpro_sparc64.il	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_sunpro_sparc64.il	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 /
 / Copyright (C) Igor Sysoev
+/ Copyright (C) Nginx, Inc.
 /
 
 
--- a/src/os/unix/ngx_sunpro_x86.il	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_sunpro_x86.il	Mon Jan 30 00:00:00 2012 +0400
@@ -1,5 +1,6 @@
 /
 / Copyright (C) Igor Sysoev
+/ Copyright (C) Nginx, Inc.
 /
 
 / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
--- a/src/os/unix/ngx_thread.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_thread.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_time.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_time.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_time.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_time.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_udp_recv.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_udp_recv.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_user.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_user.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_user.h	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_user.h	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/ngx_writev_chain.c	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/ngx_writev_chain.c	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */
 
 
--- a/src/os/unix/rfork_thread.S	Mon Jan 16 00:00:00 2012 +0400
+++ b/src/os/unix/rfork_thread.S	Mon Jan 30 00:00:00 2012 +0400
@@ -1,6 +1,7 @@
 
 /*
  * Copyright (C) Igor Sysoev
+ * Copyright (C) Nginx, Inc.
  */