nginx-0.1.25-RELEASE import

    *) Bugfix: nginx did run on Linux parisc.

    *) Feature: nginx now does not start under FreeBSD if the sysctl
       kern.ipc.somaxconn value is too big.

    *) Bugfix: if a request was internally redirected by the
       ngx_http_index_module module to the ngx_http_proxy_module or
       ngx_http_fastcgi_module modules, then the index file was not closed
       after request completion.

    *) Feature: the "proxy_pass" can be used in location with regular
       expression.

    *) Feature: the ngx_http_rewrite_filter_module module supports the
       condition like "if ($HTTP_USER_AGENT ~ MSIE)".

    *) Bugfix: nginx started too slow if the large number of addresses and
       text values were used in the "geo" directive.

    *) Change: a variable name must be declared as "$name" in the "geo"
       directive. The previous variant without "$" is still supported, but
       will be removed soon.

    *) Feature: the "%{VARIABLE}v" logging parameter.

    *) Feature: the "set $name value" directive.

    *) Bugfix: gcc 4.0 compatibility.

    *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
diff --git a/auto/cc/gcc b/auto/cc/gcc
index c5b4e74..46b0aab 100644
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -2,8 +2,15 @@
 # Copyright (C) Igor Sysoev
 
 
-# gcc 2.7.2.3, 2.8.1, 2.95.4,
+# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
 #     3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
+#     4.0.0
+
+
+NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
+                         | sed -e 's/^.* version \(.*\)/\1/'`
+
+echo " + gcc version: $NGX_GCC_VER"
 
 
 # Solaris 7's /usr/ccs/bin/as does not support "-pipe"
@@ -24,7 +31,6 @@
     PIPE="-pipe"
 fi
 
-
 # optimizations
 
 #NGX_GCC_OPT="-O2"
@@ -61,8 +67,12 @@
 esac
 
 
-# STUB for batch builds
-if [ $CC = gcc27 ]; then CPU_OPT=; fi
+case "$NGX_GCC_VER" in
+    2.7*)
+        # batch build
+        CPU_OPT=
+    ;;
+esac
 
 
 CFLAGS="$CFLAGS $PIPE $CPU_OPT"
@@ -95,8 +105,21 @@
 #CFLAGS="$CFLAGS -Wconversion" 
 #CFLAGS="$CFLAGS -Winline"
 
-# we have a lot of the unused function arguments
-CFLAGS="$CFLAGS -Wno-unused"
+
+case "$NGX_GCC_VER" in
+    3.* | 4.* )
+        # we have a lot of the unused function arguments
+        CFLAGS="$CFLAGS -Wno-unused-parameter"
+        CFLAGS="$CFLAGS -Wno-unused-function"
+        #CFLAGS="$CFLAGS -Wunreachable-code"
+    ;;
+
+    *)
+        # we have a lot of the unused function arguments
+        CFLAGS="$CFLAGS -Wno-unused"
+    ;;
+esac
+
 
 # stop on warning
 CFLAGS="$CFLAGS -Werror"
diff --git a/auto/cc/icc b/auto/cc/icc
index 47b91d7..b6ae759 100644
--- a/auto/cc/icc
+++ b/auto/cc/icc
@@ -7,7 +7,7 @@
 # optimizations
 
 CFLAGS="$CFLAGS -O"
-# inline functions declared with __inline
+# inline the functions declared with __inline
 #CFLAGS="$CFLAGS -Ob1"
 # inline any function, at the compiler's discretion
 CFLAGS="$CFLAGS -Ob2"
@@ -54,14 +54,34 @@
 
 # warnings
 
-CFLAGS="$CFLAGS -w1"
-#CFLAGS="$CFLAGS -w2"
+CFLAGS="$CFLAGS -w2"
 
-# disable the ICC 8.1 errors:
-#    error #181: argument is incompatible with corresponding format
-#                string conversion
-#    error #269: invalid format string conversion
-CFLAGS="$CFLAGS -wd181 -wd269"
+# disable some warnings
+
+# invalid type conversion: "int" to "char *"
+CFLAGS="$CFLAGS -wd171"
+# argument is incompatible with corresponding format string conversion
+CFLAGS="$CFLAGS -wd181"
+# zero used for undefined preprocessing identifier
+CFLAGS="$CFLAGS -wd193"
+# invalid format string conversion
+CFLAGS="$CFLAGS -wd269"
+# conversion from "long long" to "size_t" may lose significant bits
+CFLAGS="$CFLAGS -wd810"
+# parameter was never referenced
+CFLAGS="$CFLAGS -wd869"
+
+# STUB
+# enumerated type mixed with another type
+CFLAGS="$CFLAGS -wd188"
+# controlling expression is constant
+CFLAGS="$CFLAGS -wd279"
+# operands are evaluated in unspecified order
+CFLAGS="$CFLAGS -wd981"
+# external definition with no prior declaration
+CFLAGS="$CFLAGS -wd1418"
+# external declaration in primary source file
+CFLAGS="$CFLAGS -wd1419"
 
 # stop on warning
 CFLAGS="$CFLAGS -Werror"
diff --git a/auto/lib/openssl/make b/auto/lib/openssl/make
index c1aec88..ff05a38 100644
--- a/auto/lib/openssl/make
+++ b/auto/lib/openssl/make
@@ -1,17 +1,28 @@
 
 # Copyright (C) Igor Sysoev
 
+if test -n "$OPENSSL_OPT"; then
+    NGX_OPENSSL_CONFIG="./Configure \"$OPENSSL_OPT\""
+else
+    NGX_OPENSSL_CONFIG="./config"
+fi
+
+if test -n "$USE_THREADS"; then
+    NGX_OPENSSL_CONFIG="$NGX_OPENSSL_CONFIG threads"
+fi
 
 case "$NGX_PLATFORM" in
     *)
-        echo "$OPENSSL/libssl.a:"                                 >> $MAKEFILE
-        echo "	cd $OPENSSL \\"                                   >> $MAKEFILE
-        echo "	&& \$(MAKE) clean \\"                             >> $MAKEFILE
-        echo "	&& CC=\"\$(CC)\" \\"                              >> $MAKEFILE
-        echo "	./config threads no-shared \\"                    >> $MAKEFILE
-        echo "	&& \$(MAKE)"                                      >> $MAKEFILE
+        cat << END                                            >> $NGX_MAKEFILE
+
+$OPENSSL/libssl.a:
+	cd $OPENSSL \\
+	&& \$(MAKE) clean \\
+	&& $NGX_OPENSSL_CONFIG no-shared \\
+	&& \$(MAKE)
+
+END
+
     ;;
 
 esac
-
-echo                                                              >> $MAKEFILE
diff --git a/auto/options b/auto/options
index 8b94113..a8146d9 100644
--- a/auto/options
+++ b/auto/options
@@ -153,6 +153,7 @@
         --with-pcre-opt=*)               PCRE_OPT="$value"          ;;
 
         --with-openssl=*)                OPENSSL="$value"           ;;
+        --with-openssl-opt=*)            OPENSSL_OPT="$value"       ;;
 
         --with-md5=*)                    MD5="$value"               ;;
         --with-md5-opt=*)                MD5_OPT="$value"           ;;
@@ -203,6 +204,7 @@
   --with-http_ssl_module             enable ngx_http_ssl_module
   --without-http_charset_module      disable ngx_http_charset_module
   --without-http_gzip_module         disable ngx_http_gzip_module
+  --without-http_ssi_module          disable ngx_http_ssi_module
   --without-http_userid_module       disable ngx_http_userid_module
   --without-http_access_module       disable ngx_http_access_module
   --without-http_autoindex_module    disable ngx_http_autoindex_module
@@ -241,6 +243,7 @@
                                      pentium, pentiumpro
 
   --with-openssl=DIR                 set path to OpenSSL library sources
+  --with-openssl-opt=OPTIONS         set additional options for OpenSSL building
 
   --with-debug                       enable the debugging logging
 
diff --git a/auto/sources b/auto/sources
index 57915de..288495f 100644
--- a/auto/sources
+++ b/auto/sources
@@ -241,27 +241,27 @@
            src/http/ngx_http_variables.h \
            src/http/ngx_http_upstream.h \
            src/http/ngx_http_busy_lock.h \
-           src/http/ngx_http_log_handler.h"
+           src/http/ngx_http_log_module.h"
 
 HTTP_SRCS="src/http/ngx_http.c \
            src/http/ngx_http_core_module.c \
            src/http/ngx_http_special_response.c \
            src/http/ngx_http_request.c \
            src/http/ngx_http_parse.c \
-           src/http/ngx_http_header_filter.c \
-           src/http/ngx_http_write_filter.c \
-           src/http/ngx_http_copy_filter.c \
-           src/http/ngx_http_log_handler.c \
+           src/http/ngx_http_header_filter_module.c \
+           src/http/ngx_http_write_filter_module.c \
+           src/http/ngx_http_copy_filter_module.c \
+           src/http/ngx_http_log_module.c \
            src/http/ngx_http_request_body.c \
            src/http/ngx_http_variables.c \
            src/http/ngx_http_upstream.c \
            src/http/ngx_http_parse_time.c \
-           src/http/modules/ngx_http_static_handler.c \
-           src/http/modules/ngx_http_index_handler.c \
-           src/http/modules/ngx_http_chunked_filter.c \
-           src/http/modules/ngx_http_range_filter.c \
-           src/http/modules/ngx_http_headers_filter.c \
-           src/http/modules/ngx_http_not_modified_filter.c"
+           src/http/modules/ngx_http_static_module.c \
+           src/http/modules/ngx_http_index_module.c \
+           src/http/modules/ngx_http_chunked_filter_module.c \
+           src/http/modules/ngx_http_range_filter_module.c \
+           src/http/modules/ngx_http_headers_filter_module.c \
+           src/http/modules/ngx_http_not_modified_filter_module.c"
 
 # STUB
 HTTP_SRCS="$HTTP_SRCS src/http/ngx_http_busy_lock.c"
@@ -271,31 +271,31 @@
 
 
 HTTP_CHARSET_FILTER_MODULE=ngx_http_charset_filter_module
-HTTP_CHARSET_SRCS=src/http/modules/ngx_http_charset_filter.c
+HTTP_CHARSET_SRCS=src/http/modules/ngx_http_charset_filter_module.c
 
 
 HTTP_GZIP_FILTER_MODULE=ngx_http_gzip_filter_module
-HTTP_GZIP_SRCS=src/http/modules/ngx_http_gzip_filter.c
+HTTP_GZIP_SRCS=src/http/modules/ngx_http_gzip_filter_module.c
 
 
 HTTP_SSI_FILTER_MODULE=ngx_http_ssi_filter_module
-HTTP_SSI_SRCS=src/http/modules/ngx_http_ssi_filter.c
+HTTP_SSI_SRCS=src/http/modules/ngx_http_ssi_filter_module.c
 
 
 HTTP_USERID_FILTER_MODULE=ngx_http_userid_filter_module
-HTTP_USERID_SRCS=src/http/modules/ngx_http_userid_filter.c
+HTTP_USERID_SRCS=src/http/modules/ngx_http_userid_filter_module.c
 
 
 HTTP_ACCESS_MODULE=ngx_http_access_module
-HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_handler.c
+HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_module.c
 
 
 HTTP_AUTOINDEX_MODULE=ngx_http_autoindex_module
-HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_handler.c
+HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_module.c
 
 
 HTTP_STATUS_MODULE=ngx_http_status_module
-HTTP_STATUS_SRCS=src/http/modules/ngx_http_status_handler.c
+HTTP_STATUS_SRCS=src/http/modules/ngx_http_status_module.c
 
 
 HTTP_GEO_MODULE=ngx_http_geo_module
@@ -303,7 +303,7 @@
 
 
 HTTP_REWRITE_MODULE=ngx_http_rewrite_module
-HTTP_REWRITE_SRCS=src/http/modules/ngx_http_rewrite_handler.c
+HTTP_REWRITE_SRCS=src/http/modules/ngx_http_rewrite_module.c
 
 
 HTTP_SSL_MODULE=ngx_http_ssl_module
@@ -324,7 +324,7 @@
 
 
 HTTP_FASTCGI_MODULE=ngx_http_fastcgi_module
-HTTP_FASTCGI_SRCS=src/http/modules/ngx_http_fastcgi_handler.c
+HTTP_FASTCGI_SRCS=src/http/modules/ngx_http_fastcgi_module.c
 
 
 IMAP_INCS="src/imap"
diff --git a/auto/summary b/auto/summary
index 4848c22..7ef6ede 100644
--- a/auto/summary
+++ b/auto/summary
@@ -17,7 +17,7 @@
 esac
 
 if [ $USE_PCRE = DISABLED ]; then
-    echo " + PCRE library is disabled"
+    echo "  + PCRE library is disabled"
 
 else
     case $PCRE in