nginx-0.3.13-RELEASE import

    *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS.

    *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and
       /dev/poll methods.

    *) Bugfix: in SSI handling.

    *) Bugfix: now Solaris sendfilev() is not used to transfer the client
       request body to FastCGI-server via the unix domain socket.

    *) Bugfix: the "auth_basic" directive did not disable the
       authorization; the bug had appeared in 0.3.11.
diff --git a/auto/cc/gcc b/auto/cc/gcc
index 0597072..9e0e52d 100644
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -36,7 +36,7 @@
 
 case "$NGX_MACHINE" in
 
-    sun4u | sparc )
+    sun4u | sparc | sparc64 )
         # "-mcpu=v9" enables the "casa" assembler instruction
         CFLAGS="$CFLAGS -mcpu=v9"
     ;;
diff --git a/auto/cc/msvc b/auto/cc/msvc
index 29c40c7..a890234 100644
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -49,6 +49,8 @@
     ;;
 esac
 
+# __cdecl, use with OpenSSL
+#CPU_OPT="$CPU_OPT -Gd"
 # __stdcall
 #CPU_OPT="$CPU_OPT -Gz"
 # __fastcall
diff --git a/auto/cc/owc b/auto/cc/owc
index c8088d2..8688600 100644
--- a/auto/cc/owc
+++ b/auto/cc/owc
@@ -2,7 +2,7 @@
 # Copyright (C) Igor Sysoev
 
 
-# Open Watcom C 1.0, 1.2
+# Open Watcom C 1.0, 1.2, 1.3
 
 # optimizations
 
@@ -60,7 +60,7 @@
 CFLAGS="$CFLAGS -zq"
 
 # Open Watcom C 1.2
-#have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
+have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
 
 
 # the precompiled headers
diff --git a/auto/endianess b/auto/endianess
index db6420d..0f16bc5 100644
--- a/auto/endianess
+++ b/auto/endianess
@@ -20,7 +20,7 @@
 
 END
 
-ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
           -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
 
 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
diff --git a/auto/feature b/auto/feature
index 0fbbe84..5a40c69 100644
--- a/auto/feature
+++ b/auto/feature
@@ -31,7 +31,7 @@
 END
 
 
-ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
           -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
 
 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
diff --git a/auto/fmt/fmt b/auto/fmt/fmt
deleted file mode 100644
index a316d9b..0000000
--- a/auto/fmt/fmt
+++ /dev/null
@@ -1,98 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-
-
-echo $ngx_n "checking for $ngx_type printf() format ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_type printf() format
-
-END
-
-
-ngx_format=no
-ngx_comma=
-
-
-for ngx_fmt in $ngx_formats
-do
-
-    cat << END > $NGX_AUTOTEST.c
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <stdio.h>
-#include <sys/resource.h>
-$NGX_INCLUDE_INTTYPES_H
-$NGX_INCLUDE_AUTO_CONFIG_H
-
-int main() {
-    printf("$ngx_fmt", ($ngx_type) $ngx_max_value);
-    return 0;
-}
-
-END
-
-    ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
-              -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
-    eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-    ngx_max_val=`echo $ngx_max_value | sed -e "s/L*\$//"`
-
-    if [ -x $NGX_AUTOTEST ]; then
-
-        if [ "`$NGX_AUTOTEST`" = $ngx_max_val ]; then
-
-            if [ $ngx_fmt_collect = yes ]; then
-                echo $ngx_n "$ngx_comma \"${ngx_fmt}\" is appropriate$ngx_c"
-            else
-                echo $ngx_n "$ngx_comma \"${ngx_fmt}\" used$ngx_c"
-            fi
-
-            ngx_format=$ngx_fmt
-        fi
-    fi
-
-    rm -f $NGX_AUTOTEST
-
-    if [ $ngx_format != no ]; then
-        if [ $ngx_fmt_collect = yes ]; then
-            eval "ngx_${ngx_size}_fmt=\"\${ngx_${ngx_size}_fmt} \$ngx_format\""
-            ngx_comma=","
-            continue
-        else
-            break
-        fi
-    fi
-
-    echo $ngx_n "$ngx_comma \"${ngx_fmt}\" is not appropriate$ngx_c"
-    ngx_comma=","
-
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-    cat $NGX_AUTOTEST.c  >> $NGX_AUTOCONF_ERR
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-    echo $ngx_test       >> $NGX_AUTOCONF_ERR
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-done
-
-echo
-
-if [ $ngx_format = no ]; then
-    echo "$0: error: printf() $ngx_type format not found"
-
-    exit 1
-fi
-
-
-if [ $ngx_fmt_collect = no ]; then
-    cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_fmt_name
-#define $ngx_fmt_name  "$ngx_format"
-#endif
-
-END
-
-fi
diff --git a/auto/fmt/ptrfmt b/auto/fmt/ptrfmt
deleted file mode 100644
index 32ba8a4..0000000
--- a/auto/fmt/ptrfmt
+++ /dev/null
@@ -1,86 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-
-
-echo $ngx_n "checking for $ngx_type printf() format ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_type printf() format
-
-END
-
-
-ngx_format=no
-ngx_comma=
-ngx_fmt_x=
-
-for ngx_fmt in $ngx_formats
-do
-
-    cat << END > $NGX_AUTOTEST.c
-
-int main() {
-    printf("$ngx_fmt", ($ngx_type) $ngx_max_value);
-    return 0;
-}
-
-END
-
-    ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
-              -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
-    eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-    ngx_max_val=`echo $ngx_max_value | sed -e "s/L*\$//"`
-
-    if [ -x $NGX_AUTOTEST ]; then
-        if [ "`$NGX_AUTOTEST`" = $ngx_max_val ]; then
-            ngx_format=$ngx_fmt
-        fi
-    fi
-
-    rm $NGX_AUTOTEST
-
-    if [ $ngx_format != no ]; then
-        break
-    fi
-
-    ngx_fmt_x=`echo $ngx_fmt | sed -e "s/d/X/"`
-
-    echo $ngx_n "$ngx_comma \"${ngx_fmt_x}\" is not appropriate$ngx_c"
-    ngx_comma=","
-
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-    cat $NGX_AUTOTEST.c  >> $NGX_AUTOCONF_ERR
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-    echo $ngx_test       >> $NGX_AUTOCONF_ERR
-    echo "----------"    >> $NGX_AUTOCONF_ERR
-done
-
-
-if [ $ngx_format = no ]; then
-    echo "$0: error: printf() $ngx_type format not found"
-
-    exit 1
-fi
-
-
-if [ $ngx_ptr_size = 4 ]; then
-    ngx_fmt_x="%0`expr 2 \* $ngx_ptr_size`"
-else
-    ngx_fmt_x="%"
-fi
-
-ngx_format=`echo $ngx_format | sed -e "s/d/X/" -e "s/^%/$ngx_fmt_x/"`
-
-echo "$ngx_comma \"${ngx_format}\" used"
-
-
-cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_fmt_name
-#define $ngx_fmt_name  "$ngx_format"
-#endif
-
-END
diff --git a/auto/fmt/xfmt b/auto/fmt/xfmt
deleted file mode 100644
index 957e590..0000000
--- a/auto/fmt/xfmt
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-
-
-cat << END | sed -e 's/d"$/x"/' >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_fmt_name
-#define $ngx_fmt_name  "$ngx_fmt"
-#endif
-
-END
diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
index 3356689..32f82ca 100644
--- a/auto/lib/openssl/conf
+++ b/auto/lib/openssl/conf
@@ -23,29 +23,47 @@
 
 else
 
-    if [ "$NGX_PLATFORM" != win32 ]; then
-        OPENSSL=NO
+    case "$NGX_PLATFORM" in
 
-        ngx_feature="OpenSSL library"
-        ngx_feature_name="NGX_OPENSSL"
-        ngx_feature_run=no
-        ngx_feature_incs="#include <openssl/ssl.h>"
-        ngx_feature_libs="-lssl -lcrypto"
-        ngx_feature_test="SSL_library_init()"
-        . auto/feature
-
-        if [ $ngx_found = yes ]; then
+        win32)
+            have=NGX_OPENSSL . auto/have
             have=NGX_SSL . auto/have
-            CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
             OPENSSL=YES
 
-            case "$NGX_SYSTEM" in
-                SunOS)
-                    CORE_LIBS="$CORE_LIBS -ldl"
-                ;;
-            esac
-        fi
+            CORE_INCS="$CORE_INCS c:/openssl/include"
+            CORE_LIBS="$CORE_LIBS c:/openssl/ssleay32.lib"
+            CORE_LIBS="$CORE_LIBS c:/openssl/libeay32.lib"
 
-    fi
+            # libeay32.lib requires gdi32.lib
+            CORE_LIBS="$CORE_LIBS gdi32.lib"
+            # OpenSSL 0.8's libeay32.lib requires advapi32.lib
+            CORE_LIBS="$CORE_LIBS advapi32.lib"
+        ;;
+
+        *)
+            OPENSSL=NO
+
+            ngx_feature="OpenSSL library"
+            ngx_feature_name="NGX_OPENSSL"
+            ngx_feature_run=no
+            ngx_feature_incs="#include <openssl/ssl.h>"
+            ngx_feature_libs="-lssl -lcrypto"
+            ngx_feature_test="SSL_library_init()"
+            . auto/feature
+
+            if [ $ngx_found = yes ]; then
+                have=NGX_SSL . auto/have
+                CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+                OPENSSL=YES
+
+                case "$NGX_SYSTEM" in
+                    SunOS)
+                        CORE_LIBS="$CORE_LIBS -ldl"
+                    ;;
+                esac
+            fi
+        ;;
+
+    esac
 
 fi
diff --git a/auto/lib/openssl/make b/auto/lib/openssl/make
index ff05a38..31e15dc 100644
--- a/auto/lib/openssl/make
+++ b/auto/lib/openssl/make
@@ -1,6 +1,7 @@
 
 # Copyright (C) Igor Sysoev
 
+
 if test -n "$OPENSSL_OPT"; then
     NGX_OPENSSL_CONFIG="./Configure \"$OPENSSL_OPT\""
 else
diff --git a/auto/os/conf b/auto/os/conf
index 4ad72d8..f4ba388 100644
--- a/auto/os/conf
+++ b/auto/os/conf
@@ -63,7 +63,7 @@
         have=NGX_HAVE_NONALIGNED . auto/have
     ;;
 
-    sun4u | ia64 )
+    sun4u | sparc | sparc64 | ia64 )
         have=NGX_ALIGNMENT value=16 . auto/define
     ;;
 
diff --git a/auto/os/linux b/auto/os/linux
index 6354bed..39027b3 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -110,5 +110,5 @@
 ngx_feature_incs="#include <sched.h>"
 ngx_feature_libs=
 ngx_feature_test="long mask = 0;
-                  sched_setaffinity(0, 32, &mask)"
+                  sched_setaffinity(0, 32, (cpu_set_t *) &mask)"
 . auto/feature
diff --git a/auto/types/sizeof b/auto/types/sizeof
index 796aed1..2cd1fb8 100644
--- a/auto/types/sizeof
+++ b/auto/types/sizeof
@@ -31,7 +31,7 @@
 END
 
 
-ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
           -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
 
 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
diff --git a/auto/types/typedef b/auto/types/typedef
index 4b89643..884ef25 100644
--- a/auto/types/typedef
+++ b/auto/types/typedef
@@ -33,7 +33,9 @@
 
 END
 
-    ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
+    ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+              -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
     eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
 
     if [ -x $NGX_AUTOTEST ]; then
diff --git a/auto/unix b/auto/unix
index 6295ec2..0fe2974 100755
--- a/auto/unix
+++ b/auto/unix
@@ -4,10 +4,7 @@
 
 have=NGX_HAVE_UNIX_DOMAIN . auto/have
 
-
-# STUB
-CC_WARN=
-ngx_fmt_collect=yes
+ngx_feature_libs=
 
 
 # C types