nginx-0.1.26-RELEASE import

    *) Change: the invalid client header lines are now ignored and logged
       at the info level.

    *) Change: the server name is also logged in error log.

    *) Feature: the ngx_http_auth_basic_module module and the auth_basic
       and auth_basic_user_file directives.
diff --git a/auto/cc/bcc b/auto/cc/bcc
index 4b88129..af108bb 100644
--- a/auto/cc/bcc
+++ b/auto/cc/bcc
@@ -21,6 +21,11 @@
     ;;
 esac
 
+# __stdcall
+#CPU_OPT="$CPU_OPT -ps"
+# __fastcall
+CPU_OPT="$CPU_OPT -pr"
+
 CFLAGS="$CFLAGS $CPU_OPT"
 
 # multithreaded
diff --git a/auto/cc/msvc b/auto/cc/msvc
index 0fa1a2c..d920ed0 100644
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -36,6 +36,12 @@
     ;;
 esac
 
+# __stdcall
+#CPU_OPT="$CPU_OPT -Gz"
+# __fastcall
+CPU_OPT="$CPU_OPT -Gr"
+
+
 CFLAGS="$CFLAGS $CPU_OPT"
 
 
diff --git a/auto/lib/md5/make b/auto/lib/md5/make
index 8bdca0b..22189da 100644
--- a/auto/lib/md5/make
+++ b/auto/lib/md5/make
@@ -6,17 +6,17 @@
 
     msvc*)
         ngx_makefile=makefile.msvc
-        ngx_opt="CPU_OPT=$CPU_OPT LIBC=$LIBC MD5_ASM=$MD5_ASM"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC MD5_ASM=$MD5_ASM"
     ;;
 
     owc*)
         ngx_makefile=makefile.owc
-        ngx_opt="CPU_OPT=$CPU_OPT"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\""
     ;;
 
     bcc)
         ngx_makefile=makefile.bcc
-        ngx_opt="-DCPU_OPT=$CPU_OPT -DMD5_ASM=$MD5_ASM"
+        ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DMD5_ASM=$MD5_ASM"
     ;;
 
 esac
diff --git a/auto/lib/pcre/make b/auto/lib/pcre/make
index 6b52357..f57f7d9 100644
--- a/auto/lib/pcre/make
+++ b/auto/lib/pcre/make
@@ -6,17 +6,17 @@
 
     msvc*)
         ngx_makefile=makefile.msvc
-        ngx_opt="CPU_OPT=$CPU_OPT LIBC=$LIBC"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
     ;;
 
     owc*)
         ngx_makefile=makefile.owc
-        ngx_opt="CPU_OPT=$CPU_OPT"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\""
     ;;
 
     bcc)
         ngx_makefile=makefile.bcc
-        ngx_opt="-DCPU_OPT=$CPU_OPT"
+        ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
     ;;
 
 esac
@@ -26,7 +26,9 @@
 
     win32)
         cp auto/lib/pcre/patch.pcre.in $PCRE
+        cp auto/lib/pcre/patch.pcre.in.owc $PCRE
         cp auto/lib/pcre/patch.config.in $PCRE
+        cp auto/lib/pcre/patch.pcre.c $PCRE
         cp auto/lib/pcre/$ngx_makefile $PCRE
 
         ngx_pcre=`echo $PCRE | sed -e "s/\//$ngx_regex_dirsep/g"`
diff --git a/auto/lib/pcre/makefile.bcc b/auto/lib/pcre/makefile.bcc
index 4119452..a2dc5fb 100644
--- a/auto/lib/pcre/makefile.bcc
+++ b/auto/lib/pcre/makefile.bcc
@@ -18,3 +18,4 @@
 pcre.h:
 	patch -o pcre.h pcre.in patch.pcre.in
 	patch -o config.h config.in patch.config.in
+	patch -o pcre.c pcre.c patch.pcre.c
diff --git a/auto/lib/pcre/makefile.msvc b/auto/lib/pcre/makefile.msvc
index 7c61d31..4da4e0c 100644
--- a/auto/lib/pcre/makefile.msvc
+++ b/auto/lib/pcre/makefile.msvc
@@ -20,3 +20,4 @@
 pcre.h:
 	patch -o pcre.h pcre.in patch.pcre.in
 	patch -o config.h config.in patch.config.in
+	patch -o pcre.c pcre.c patch.pcre.c
diff --git a/auto/lib/pcre/makefile.owc b/auto/lib/pcre/makefile.owc
index 227fd90..8439c4c 100644
--- a/auto/lib/pcre/makefile.owc
+++ b/auto/lib/pcre/makefile.owc
@@ -15,5 +15,5 @@
 
 
 pcre.h:
-	patch -o pcre.h pcre.in patch.pcre.in
+	patch -o pcre.h pcre.in patch.pcre.in.owc
 	patch -o config.h config.in patch.config.in
diff --git a/auto/lib/pcre/patch.pcre.c b/auto/lib/pcre/patch.pcre.c
new file mode 100644
index 0000000..8e56b9d
--- /dev/null
+++ b/auto/lib/pcre/patch.pcre.c
@@ -0,0 +1,13 @@
+--- pcre.c	Thu Aug 21 14:43:07 2003
++++ pcre.c	Tue Mar 22 12:56:59 2005
+@@ -246,8 +246,8 @@
+ extern "C" void  (*pcre_free)(void *) = free;
+ extern "C" int   (*pcre_callout)(pcre_callout_block *) = NULL;
+ #else
+-void *(*pcre_malloc)(size_t) = malloc;
+-void  (*pcre_free)(void *) = free;
++void *(__cdecl *pcre_malloc)(size_t) = malloc;
++void  (__cdecl *pcre_free)(void *) = free;
+ int   (*pcre_callout)(pcre_callout_block *) = NULL;
+ #endif
+ #endif
diff --git a/auto/lib/pcre/patch.pcre.in b/auto/lib/pcre/patch.pcre.in
index c49a68f..7ae32a9 100644
--- a/auto/lib/pcre/patch.pcre.in
+++ b/auto/lib/pcre/patch.pcre.in
@@ -1,5 +1,5 @@
 --- pcre.in	Thu Aug 21 14:43:07 2003
-+++ pcre.in	Sun Mar  7 02:10:11 2004
++++ pcre.h	Tue Mar 22 12:56:59 2005
 @@ -10,9 +10,9 @@
  /* The file pcre.h is build by "configure". Do not edit it; instead
  make changes to pcre.in. */
@@ -13,3 +13,14 @@
  
  /* Win32 uses DLL by default */
  
+@@ -143,8 +143,8 @@
+ have to be different again. */
+ 
+ #ifndef VPCOMPAT
+-PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
+-PCRE_DATA_SCOPE void  (*pcre_free)(void *);
++PCRE_DATA_SCOPE void *(__cdecl *pcre_malloc)(size_t);
++PCRE_DATA_SCOPE void  (__cdecl *pcre_free)(void *);
+ PCRE_DATA_SCOPE int   (*pcre_callout)(pcre_callout_block *);
+ #else   /* VPCOMPAT */
+ extern void *pcre_malloc(size_t);
diff --git a/auto/lib/pcre/patch.pcre.in.owc b/auto/lib/pcre/patch.pcre.in.owc
new file mode 100644
index 0000000..8adbcbc
--- /dev/null
+++ b/auto/lib/pcre/patch.pcre.in.owc
@@ -0,0 +1,15 @@
+--- pcre.in	Thu Aug 21 14:43:07 2003
++++ pcre.h	Tue Mar 22 12:56:59 2005
+@@ -10,9 +10,9 @@
+ /* The file pcre.h is build by "configure". Do not edit it; instead
+ make changes to pcre.in. */
+ 
+-#define PCRE_MAJOR          @PCRE_MAJOR@
+-#define PCRE_MINOR          @PCRE_MINOR@
+-#define PCRE_DATE           @PCRE_DATE@
++#define PCRE_MAJOR          4
++#define PCRE_MINOR          4
++#define PCRE_DATE           21-August-2003
+ 
+ /* Win32 uses DLL by default */
+ 
diff --git a/auto/lib/zlib/make b/auto/lib/zlib/make
index 1859a34..715d2cf 100644
--- a/auto/lib/zlib/make
+++ b/auto/lib/zlib/make
@@ -6,18 +6,18 @@
 
     msvc*)
         ngx_makefile=makefile.msvc
-        ngx_opt="CPU_OPT=$CPU_OPT LIBC=$LIBC"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
 
     ;;
 
     owc*)
         ngx_makefile=makefile.owc
-        ngx_opt="CPU_OPT=$CPU_OPT"
+        ngx_opt="CPU_OPT=\"$CPU_OPT\""
     ;;
 
     bcc)
         ngx_makefile=makefile.bcc
-        ngx_opt="-DCPU_OPT=$CPU_OPT"
+        ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
     ;;
 
 esac
diff --git a/auto/lib/zlib/patch.zlib.h b/auto/lib/zlib/patch.zlib.h
new file mode 100644
index 0000000..122f7fa
--- /dev/null
+++ b/auto/lib/zlib/patch.zlib.h
@@ -0,0 +1,10 @@
+--- zlib.h	Thu Jul  9 20:06:56 1998
++++ zlib-1.1.3/zlib.h	Tue Mar 22 13:41:04 2005
+@@ -709,7 +709,6 @@
+    (0 in case of error).
+ */
+ 
+-ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
+ /*
+      Converts, formats, and writes the args to the compressed file under
+    control of the format string, as in fprintf. gzprintf returns the number of
diff --git a/auto/modules b/auto/modules
index 1fe9ac8..4ab272e 100644
--- a/auto/modules
+++ b/auto/modules
@@ -104,6 +104,14 @@
 
 HTTP_MODULES="$HTTP_MODULES $HTTP_INDEX_MODULE"
 
+if [ $HTTP_AUTH_BASIC = YES ]; then
+    have=NGX_HTTP_AUTH_BASIC . auto/have
+    have=NGX_CRYPT . auto/have
+    HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_BASIC_MODULE"
+    HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_BASIC_SRCS"
+    CORE_LIBS="$CORE_LIBS $CRYPT_LIB"
+fi
+
 if [ $HTTP_ACCESS = YES ]; then
     have=NGX_HTTP_ACCESS . auto/have
     HTTP_MODULES="$HTTP_MODULES $HTTP_ACCESS_MODULE"
diff --git a/auto/options b/auto/options
index a8146d9..2bdb5df 100644
--- a/auto/options
+++ b/auto/options
@@ -50,6 +50,7 @@
 HTTP_SSL=NO
 HTTP_SSI=YES
 HTTP_ACCESS=YES
+HTTP_AUTH_BASIC=YES
 HTTP_USERID=YES
 HTTP_AUTOINDEX=YES
 HTTP_STATUS=NO
@@ -127,6 +128,7 @@
         --without-http_ssi_module)       HTTP_SSI=NO                ;;
         --without-http_userid_module)    HTTP_USERID=NO             ;;
         --without-http_access_module)    HTTP_ACCESS=NO             ;;
+        --without-http_auth_basic_module) HTTP_AUTH_BASIC=NO        ;;
         --without-http_autoindex_module) HTTP_AUTOINDEX=NO          ;;
         --without-http_status_module)    HTTP_STATUS=NO             ;;
         --without-http_geo_module)       HTTP_GEO=NO                ;;
@@ -207,6 +209,7 @@
   --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_auth_basic_module   disable ngx_http_auth_basic_module
   --without-http_autoindex_module    disable ngx_http_autoindex_module
   --without-http_geo_module          disable ngx_http_geo_module
   --without-http_rewrite_module      disable ngx_http_rewrite_module
diff --git a/auto/os/conf b/auto/os/conf
index 8c4739f..b48b640 100644
--- a/auto/os/conf
+++ b/auto/os/conf
@@ -39,6 +39,7 @@
         CORE_INCS="$UNIX_INCS"
         CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
         CORE_SRCS="$UNIX_SRCS"
+        CRYPT_LIB="-lcrypt"
     ;;
 
 esac
diff --git a/auto/os/freebsd b/auto/os/freebsd
index dfb547f..133f5f5 100644
--- a/auto/os/freebsd
+++ b/auto/os/freebsd
@@ -14,6 +14,7 @@
 CORE_INCS="$UNIX_INCS"
 CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
 CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
+CRYPT_LIB="-lcrypt"
 
 ngx_spacer='
 '
diff --git a/auto/os/linux b/auto/os/linux
index a83c180..84e4f66 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -13,7 +13,7 @@
 CORE_INCS="$UNIX_INCS"
 CORE_DEPS="$UNIX_DEPS $LINUX_DEPS"
 CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
-EVENT_MODULES="$EVENT_MODULES"
+CRYPT_LIB="-lcrypt"
 
 ngx_spacer='
 '
diff --git a/auto/os/solaris b/auto/os/solaris
index 2348c89..67e0a8e 100644
--- a/auto/os/solaris
+++ b/auto/os/solaris
@@ -13,8 +13,6 @@
 CORE_INCS="$UNIX_INCS"
 CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
 CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
-EVENT_MODULES="$EVENT_MODULES"
-
 CORE_LIBS="$CORE_LIBS -lsocket -lnsl -lrt"
 
 # Solaris's make does not support a blank line between target and rules
diff --git a/auto/sources b/auto/sources
index 288495f..fd46edd 100644
--- a/auto/sources
+++ b/auto/sources
@@ -123,6 +123,7 @@
             src/os/unix/ngx_thread.h \
             src/os/unix/ngx_socket.h \
             src/os/unix/ngx_os.h \
+            src/os/unix/ngx_user.h \
             src/os/unix/ngx_process_cycle.h"
 
 UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
@@ -142,6 +143,7 @@
             src/os/unix/ngx_daemon.c \
             src/os/unix/ngx_setproctitle.c \
             src/os/unix/ngx_posix_init.c \
+            src/os/unix/ngx_user.c \
             src/os/unix/ngx_process_cycle.c"
 
 POSIX_DEPS=src/os/unix/ngx_posix_config.h
@@ -180,6 +182,7 @@
             src/os/win32/ngx_thread.h \
             src/os/win32/ngx_socket.h \
             src/os/win32/ngx_os.h \
+            src/os/win32/ngx_user.h \
             src/os/win32/ngx_gui.h \
             src/os/win32/ngx_gui_resources.h \
             src/os/win32/ngx_process_cycle.h"
@@ -198,6 +201,7 @@
             src/os/win32/ngx_wsarecv_chain.c \
             src/os/win32/ngx_wsasend_chain.c \
             src/os/win32/ngx_win32_init.c \
+            src/os/win32/ngx_user.c \
             src/os/win32/ngx_gui.c \
             src/os/win32/ngx_process_cycle.c \
             src/event/ngx_event_acceptex.c"
@@ -290,6 +294,10 @@
 HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_module.c
 
 
+HTTP_AUTH_BASIC_MODULE=ngx_http_auth_basic_module
+HTTP_AUTH_BASIC_SRCS=src/http/modules/ngx_http_auth_basic_module.c
+
+
 HTTP_AUTOINDEX_MODULE=ngx_http_autoindex_module
 HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_module.c