Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-03-22 19:02:46 +0300
committerIgor Sysoev <igor@sysoev.ru>2005-03-22 19:02:46 +0300
commit4d656dcd0bd6309b0ec76fc444198ed6c2948a8e (patch)
tree67ce201b7d515273fa2a6a617542cece4fa16898 /src/core
parent3599a1b885533d929315494258fb407765243a95 (diff)
nginx-0.1.26-RELEASE importrelease-0.1.26
*) 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.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c2
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_conf_file.c60
-rw-r--r--src/core/ngx_conf_file.h6
-rw-r--r--src/core/ngx_config.h3
-rw-r--r--src/core/ngx_log.c37
-rw-r--r--src/core/ngx_log.h5
-rw-r--r--src/core/ngx_regex.c25
-rw-r--r--src/core/ngx_string.c4
-rw-r--r--src/core/ngx_string.h4
10 files changed, 93 insertions, 55 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index e2a35dc67..06eedd3d7 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -119,7 +119,7 @@ ngx_module_t ngx_core_module = {
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 54afca93a..d097cf749 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 653ff48b3..e8119fcdd 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 @@ ngx_module_t ngx_conf_module = {
};
-
/* The ten fixed arguments */
static int argument_number[] = {
@@ -49,10 +49,9 @@ static int argument_number[] = {
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 @@ char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
}
-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_handler(ngx_conf_t *cf, ngx_int_t last)
}
-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 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)
+static char *
+ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_str_t *value, file;
@@ -593,7 +595,8 @@ static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
-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_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)
+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 @@ 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, ...)
{
u_char errstr[NGX_MAX_CONF_ERRSTR], *buf, *last;
va_list args;
@@ -729,7 +734,8 @@ void ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err,
}
-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_flag_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 *
+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_str_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 *
+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_num_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 *
+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_size_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 *
+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_msec_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 *
+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_sec_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 *
+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_bufs_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 *
+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_enum_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 *
+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_set_bitmask_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
-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 8dcdd5455..d5a7a6622 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -148,7 +148,7 @@ struct ngx_conf_s {
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 @@ char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename);
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 bc02449dc..675d427d4 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 adccd5e33..181d05928 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -58,11 +58,17 @@ static const char *debug_levels[] = {
#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 @@ void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
}
-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 @@ static void ngx_log_write(ngx_log_t *log, u_char *errstr, size_t len)
#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_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
}
-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 @@ void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...)
#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_init(void)
}
-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 @@ ngx_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args)
}
-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 @@ char *ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log)
}
-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 aae92e718..5952b5243 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -103,11 +103,12 @@ void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
#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 12579946b..eda243bec 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_regex_t *ngx_regex_compile(ngx_str_t *pattern, ngx_int_t options,
}
-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_capture_count(ngx_regex_t *re)
}
-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 @@ ngx_int_t ngx_regex_exec(ngx_regex_t *re, ngx_str_t *s,
}
-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_malloc(size_t size)
}
-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 a1f593f96..8d69c1b72 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -75,7 +75,7 @@ ngx_pstrdup(ngx_pool_t *pool, ngx_str_t *src)
*/
-u_char *
+u_char * ngx_cdecl
ngx_sprintf(u_char *buf, const char *fmt, ...)
{
u_char *p;
@@ -89,7 +89,7 @@ ngx_sprintf(u_char *buf, const char *fmt, ...)
}
-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 25b06b3f6..24a237903 100644
--- a/src/core/ngx_string.h
+++ b/src/core/ngx_string.h
@@ -74,8 +74,8 @@ typedef struct {
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);