nginx-0.1.13-RELEASE import

    *) Feature: the server_names_hash and server_names_hash_threshold
       directives.

    *) Bugfix: the *.domain.tld names in the "server_name" directive did
       not work.

    *) Bugfix: the %request_length log parameter logged the incorrect
       length.
diff --git a/auto/lib/conf b/auto/lib/conf
index 275bea9..6e00592 100644
--- a/auto/lib/conf
+++ b/auto/lib/conf
@@ -6,14 +6,23 @@
     . auto/lib/pcre/conf
 fi
 
-if [ $USE_MD5 = YES ]; then
-    . auto/lib/md5/conf
-fi
-
 if [ $USE_OPENSSL = YES ]; then
     . auto/lib/openssl/conf
 fi
 
+if [ $USE_MD5 = YES ]; then
+
+    if [ $OPENSSL != NONE -a $OPENSSL != NO ]; then
+        have=NGX_HAVE_OPENSSL_MD5_H . auto/have
+        have=NGX_OPENSSL_MD5 . auto/have
+        MD5=YES
+
+    else
+        . auto/lib/md5/conf
+    fi
+
+fi
+
 if [ $USE_ZLIB = YES ]; then
     . auto/lib/zlib/conf
 fi
diff --git a/auto/lib/md5/conf b/auto/lib/md5/conf
index 8122423..1ca6b43 100644
--- a/auto/lib/md5/conf
+++ b/auto/lib/md5/conf
@@ -8,6 +8,7 @@
         # OpenSSL md5
         OPENSSL_MD5=YES
         have=NGX_HAVE_OPENSSL_MD5 . auto/have
+        have=NGX_OPENSSL_MD5 . auto/have
     else
         # rsaref md5
         OPENSSL_MD5=NO
diff --git a/auto/modules b/auto/modules
index b793b34..6052c4d 100644
--- a/auto/modules
+++ b/auto/modules
@@ -141,6 +141,8 @@
 fi
 
 # STUB
+#USE_MD5=YES
+#HTTP_SRCS="$HTTP_SRCS $HTPP_CACHE_SRCS"
 #HTTP_SRCS="$HTTP_SRCS $HTPP_FILE_CACHE_SRCS"
 
 if [ -r $NGX_OBJS/auto ]; then
diff --git a/auto/options b/auto/options
index 834ca01..30ec352 100644
--- a/auto/options
+++ b/auto/options
@@ -209,9 +209,7 @@
 fi
 
 
-if test -z "$NGX_PREFIX"; then
-    NGX_PREFIX=/usr/local/nginx
-fi
+NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
 
 
 case ".$NGX_SBIN_PATH" in
diff --git a/auto/os/conf b/auto/os/conf
index f64483b..dcbda88 100644
--- a/auto/os/conf
+++ b/auto/os/conf
@@ -45,9 +45,7 @@
 
 if [ $NGX_PLATFORM != win32 ]; then
 
-    if test -z "$NGX_USER"; then
-        NGX_USER=nobody
-    fi
+     NGX_USER=${NGX_USER:-nobody}
 
     if [ -z "$NGX_GROUP" -a $NGX_USER = nobody ] ; then
        if grep nobody /etc/group 2>&1 >/dev/null; then
diff --git a/auto/os/linux b/auto/os/linux
index f3c6722..8c140b3 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -26,6 +26,8 @@
 version=`grep "#define LINUX_VERSION_CODE" /usr/include/linux/version.h \
          | sed -e 's/^.* \(.*\)$/\1/'`
 
+version=${version:-0}
+
 
 # enable the rt signals on Linux 2.2.19 and onward
 
diff --git a/auto/sources b/auto/sources
index 2729f1b..2264e76 100644
--- a/auto/sources
+++ b/auto/sources
@@ -207,7 +207,7 @@
               ngx_http_core_module \
               ngx_http_log_module"
 
-HTTP_FILE_CACHE_MODULE=ngx_http_cache_module
+HTTP_CACHE_MODULE=ngx_http_cache_module
 
 HTTP_WRITE_FILTER_MODULE="ngx_http_write_filter_module"
 HTTP_HEADER_FILTER_MODULE="ngx_http_header_filter_module"
diff --git a/auto/summary b/auto/summary
index 39a1599..53455cd 100644
--- a/auto/summary
+++ b/auto/summary
@@ -28,13 +28,6 @@
     esac
 fi
 
-case $MD5 in
-    YES)   echo "  + md5: using system $MD5_LIB library" ;;
-    NONE)  echo "  + md5 library is not used" ;;
-    NO)    echo "  + md5 library is not found" ;;
-    *)     echo "  + using md5 library: $MD5" ;;
-esac
-
 case $OPENSSL in
     YES)   echo "  + using system OpenSSL library" ;;
     NONE)  echo "  + OpenSSL library is not used" ;;
@@ -42,6 +35,19 @@
     *)     echo "  + using OpenSSL library: $OPENSSL" ;;
 esac
 
+case $MD5 in
+    YES)
+        case $OPENSSL in
+            NONE|NO)  echo "  + md5: using system $MD5_LIB library" ;;
+            *)        echo "  + md5: using OpenSSL library" ;;
+        esac
+        ;;
+
+    NONE)  echo "  + md5 library is not used" ;;
+    NO)    echo "  + md5 library is not found" ;;
+    *)     echo "  + using md5 library: $MD5" ;;
+esac
+
 case $ZLIB in
     YES)   echo "  + using system zlib library" ;;
     NONE)  echo "  + zlib library is not used" ;;
diff --git a/auto/unix b/auto/unix
index 6bf89e2..8982968 100755
--- a/auto/unix
+++ b/auto/unix
@@ -29,7 +29,7 @@
 
 ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
 . auto/types/sizeof
-ngx_param=SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
+ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
 
 ngx_type="socklen_t"; ngx_types="uint32_t"; . auto/types/typedef
 
@@ -44,14 +44,16 @@
 . auto/endianess
 
 ngx_type="size_t"; . auto/types/sizeof
-ngx_param=MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
 
 ngx_type="off_t"; . auto/types/sizeof
-ngx_param=MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
+ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
 
 ngx_type="time_t"; . auto/types/sizeof
-ngx_param=TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
-ngx_param=TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
+ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
+ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
 
 
 # syscalls, libc calls and some features