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/src/core/nginx.c b/src/core/nginx.c
index e2a35dc..06eedd3 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -119,7 +119,7 @@
 ngx_uint_t  ngx_max_module;
 
 
-int
+int ngx_cdecl
 main(int argc, char *const *argv)
 {
     ngx_int_t         i;
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 54afca9..d097cf7 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.1.25"
+#define NGINX_VER          "nginx/0.1.27"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_NEWPID_EXT     ".newbin"
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 653ff48..e8119fc 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -9,6 +9,7 @@
 
 
 static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last);
+static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf);
 static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 
 
@@ -35,7 +36,6 @@
 };
 
 
-
 /* The ten fixed arguments */
 
 static int argument_number[] = {
@@ -49,10 +49,9 @@
     NGX_CONF_TAKE7
 };
 
-static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf);
 
-
-char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
+char *
+ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
 {
     char             *rv;
     ngx_fd_t          fd;
@@ -173,7 +172,8 @@
 }
 
 
-static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last)
+static ngx_int_t
+ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last)
 {
     char           *rv;
     void           *conf, **confp;
@@ -331,7 +331,8 @@
 }
 
 
-static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf)
+static ngx_int_t
+ngx_conf_read_token(ngx_conf_t *cf)
 {
     u_char      *start, ch, *src, *dst;
     int          len;
@@ -576,7 +577,8 @@
 }
 
 
-static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+static char *
+ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     ngx_str_t  *value, file;
 
@@ -593,7 +595,8 @@
 }
 
 
-ngx_int_t ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name)
+ngx_int_t
+ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name)
 {
     u_char     *p;
     ngx_str_t   old;
@@ -641,7 +644,8 @@
 }
 
 
-ngx_open_file_t *ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name)
+ngx_open_file_t *
+ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name)
 {
     ngx_str_t         full;
     ngx_uint_t        i;
@@ -703,8 +707,9 @@
 }
 
 
-void ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err,
-                        char *fmt, ...)
+void ngx_cdecl
+ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err,
+    char *fmt, ...)
 {
     u_char   errstr[NGX_MAX_CONF_ERRSTR], *buf, *last;
     va_list  args;
@@ -729,7 +734,8 @@
 }
 
 
-char *ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -768,7 +774,8 @@
 }
 
 
-char *ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_str_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -794,7 +801,8 @@
 }
 
 
-char *ngx_conf_set_num_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_num_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -824,7 +832,8 @@
 }
 
 
-char *ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_size_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -854,7 +863,8 @@
 }
 
 
-char *ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -888,7 +898,8 @@
 }
 
 
-char *ngx_conf_set_sec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_sec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -922,7 +933,8 @@
 }
 
 
-char *ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char *p = conf;
 
@@ -951,7 +963,8 @@
 }
 
 
-char *ngx_conf_set_enum_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_enum_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -987,7 +1000,8 @@
 }
 
 
-char *ngx_conf_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     char  *p = conf;
 
@@ -1032,13 +1046,15 @@
 }
 
 
-char *ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+char *
+ngx_conf_unsupported(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     return "unsupported on this platform";
 }
 
 
-char *ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data)
+char *
+ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data)
 {
     ngx_conf_num_bounds_t  *bounds = post;
     ngx_int_t  *np = data;
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index 8dcdd54..d5a7a66 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -148,7 +148,7 @@
 
 
 typedef char *(*ngx_conf_post_handler_pt) (ngx_conf_t *cf,
-                                           void *data, void *conf);
+    void *data, void *conf);
 
 typedef struct {
     ngx_conf_post_handler_pt  post_handler;
@@ -274,8 +274,8 @@
 
 ngx_int_t ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name);
 ngx_open_file_t *ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name);
-void ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err,
-                        char *fmt, ...);
+void ngx_cdecl ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf,
+    ngx_err_t err, char *fmt, ...);
 
 
 char *ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index bc02449..675d427 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -63,6 +63,9 @@
 #define NGX_CHANGEBIN_SIGNAL     USR2
 #endif
 
+#define ngx_cdecl
+#define ngx_libc_cdecl
+
 #endif
 
 
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index adccd5e..181d059 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -58,11 +58,17 @@
 
 
 #if (NGX_HAVE_VARIADIC_MACROS)
-void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
-                        const char *fmt, ...)
+
+void
+ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
+    const char *fmt, ...)
+
 #else
-void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
-                        const char *fmt, va_list args)
+
+void
+ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
+    const char *fmt, va_list args)
+
 #endif
 {
 #if (NGX_HAVE_VARIADIC_MACROS)
@@ -144,7 +150,8 @@
 }
 
 
-static void ngx_log_write(ngx_log_t *log, u_char *errstr, size_t len)
+static void
+ngx_log_write(ngx_log_t *log, u_char *errstr, size_t len)
 {
 #if (NGX_WIN32)
     u_long  written;
@@ -180,8 +187,9 @@
 
 #if !(NGX_HAVE_VARIADIC_MACROS)
 
-void ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
-                   const char *fmt, ...)
+void ngx_cdecl
+ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
+    const char *fmt, ...)
 {
     va_list  args;
 
@@ -193,7 +201,8 @@
 }
 
 
-void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...)
+void ngx_cdecl
+ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...)
 {
     va_list  args;
 
@@ -205,7 +214,8 @@
 #endif
 
 
-ngx_log_t *ngx_log_init(void)
+ngx_log_t *
+ngx_log_init(void)
 {
     ngx_log.file = &ngx_stderr;
     ngx_log.log_level = NGX_LOG_NOTICE;
@@ -240,7 +250,8 @@
 }
 
 
-ngx_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args)
+ngx_log_t *
+ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args)
 {
     ngx_log_t  *log;
     ngx_str_t  *value, *name;
@@ -267,7 +278,8 @@
 }
 
 
-char *ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log)
+char *
+ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log)
 {
     ngx_uint_t   i, n, d;
     ngx_str_t   *value;
@@ -320,7 +332,8 @@
 }
 
 
-static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+static char *
+ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 {
     ngx_str_t  *value;
 
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
index aae92e7..5952b52 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -103,11 +103,12 @@
 
 #define NGX_HAVE_VARIADIC_MACROS  0
 
-void ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
+void ngx_cdecl ngx_log_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
     const char *fmt, ...);
 void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
     const char *fmt, va_list args);
-void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...);
+void ngx_cdecl ngx_log_debug_core(ngx_log_t *log, ngx_err_t err,
+    const char *fmt, ...);
 
 
 #endif /* VARIADIC MACROS */
diff --git a/src/core/ngx_regex.c b/src/core/ngx_regex.c
index 1257994..eda243b 100644
--- a/src/core/ngx_regex.c
+++ b/src/core/ngx_regex.c
@@ -8,22 +8,24 @@
 #include <ngx_core.h>
 
 
-static void *ngx_regex_malloc(size_t size);
-static void ngx_regex_free(void *p);
+static void * ngx_libc_cdecl ngx_regex_malloc(size_t size);
+static void ngx_libc_cdecl ngx_regex_free(void *p);
 
 
 static ngx_pool_t  *ngx_pcre_pool;
 
 
-void ngx_regex_init(void)
+void
+ngx_regex_init(void)
 {
     pcre_malloc = ngx_regex_malloc;
     pcre_free = ngx_regex_free;
 }
 
 
-ngx_regex_t *ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options,
-                               ngx_pool_t *pool, ngx_str_t *err)
+ngx_regex_t *
+ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options, ngx_pool_t *pool,
+    ngx_str_t *err)
 {
     int              erroff;
     const char      *errstr;
@@ -79,7 +81,8 @@
 }
 
 
-ngx_int_t ngx_regex_capture_count(ngx_regex_t *re)
+ngx_int_t
+ngx_regex_capture_count(ngx_regex_t *re)
 {
     int  rc, n;
 
@@ -95,8 +98,8 @@
 }
 
 
-ngx_int_t ngx_regex_exec(ngx_regex_t *re, ngx_str_t *s,
-                         int *captures, ngx_int_t size)
+ngx_int_t
+ngx_regex_exec(ngx_regex_t *re, ngx_str_t *s, int *captures, ngx_int_t size)
 {
     int  rc;
 
@@ -111,7 +114,8 @@
 }
 
 
-static void *ngx_regex_malloc(size_t size)
+static void * ngx_libc_cdecl
+ngx_regex_malloc(size_t size)
 {
     ngx_pool_t      *pool;
 #if (NGX_THREADS)
@@ -135,7 +139,8 @@
 }
 
 
-static void ngx_regex_free(void *p)
+static void ngx_libc_cdecl
+ngx_regex_free(void *p)
 {
     return;
 }
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index a1f593f..8d69c1b 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -75,7 +75,7 @@
  */
 
 
-u_char *
+u_char * ngx_cdecl
 ngx_sprintf(u_char *buf, const char *fmt, ...)
 {
     u_char   *p;
@@ -89,7 +89,7 @@
 }
 
 
-u_char *
+u_char * ngx_cdecl
 ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...)
 {
     u_char   *p;
diff --git a/src/core/ngx_string.h b/src/core/ngx_string.h
index 25b06b3..24a2379 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -74,8 +74,8 @@
 
 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n);
 u_char *ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src);
-u_char *ngx_sprintf(u_char *buf, const char *fmt, ...);
-u_char *ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...);
+u_char * ngx_cdecl ngx_sprintf(u_char *buf, const char *fmt, ...);
+u_char * ngx_cdecl ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...);
 u_char *ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args);
 
 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n);