summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/core
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2012-01-05 12:28:58 +0000
committerrobert <robert@openbsd.org>2012-01-05 12:28:58 +0000
commit79a58b938f55fd9f7302ccafddf487453d11fb74 (patch)
tree3d175cfbdd2d88c13319b2e008ebeb391a6857b5 /usr.sbin/nginx/src/core
parentFix typos in comment (s,exacty,exactly,) (diff)
downloadwireguard-openbsd-79a58b938f55fd9f7302ccafddf487453d11fb74.tar.xz
wireguard-openbsd-79a58b938f55fd9f7302ccafddf487453d11fb74.zip
update to nginx-1.0.11
Diffstat (limited to 'usr.sbin/nginx/src/core')
-rw-r--r--usr.sbin/nginx/src/core/nginx.c59
-rw-r--r--usr.sbin/nginx/src/core/nginx.h4
-rw-r--r--usr.sbin/nginx/src/core/ngx_inet.c6
-rw-r--r--usr.sbin/nginx/src/core/ngx_log.h16
-rw-r--r--usr.sbin/nginx/src/core/ngx_string.c9
5 files changed, 63 insertions, 31 deletions
diff --git a/usr.sbin/nginx/src/core/nginx.c b/usr.sbin/nginx/src/core/nginx.c
index b578617bee2..28c071e5541 100644
--- a/usr.sbin/nginx/src/core/nginx.c
+++ b/usr.sbin/nginx/src/core/nginx.c
@@ -203,6 +203,10 @@ main(int argc, char *const *argv)
ngx_cycle_t *cycle, init_cycle;
ngx_core_conf_t *ccf;
+#if (NGX_FREEBSD)
+ ngx_debug_init();
+#endif
+
if (ngx_strerror_init() != NGX_OK) {
return 1;
}
@@ -212,48 +216,51 @@ main(int argc, char *const *argv)
}
if (ngx_show_version) {
- ngx_log_stderr(0, "nginx version: " NGINX_VER);
+ ngx_write_stderr("nginx version: " NGINX_VER NGX_LINEFEED);
if (ngx_show_help) {
- ngx_log_stderr(0,
+ ngx_write_stderr(
"Usage: nginx [-?hvVtq] [-s signal] [-c filename] "
- "[-p prefix] [-g directives]" CRLF CRLF
- "Options:" CRLF
- " -?,-h : this help" CRLF
- " -v : show version and exit" CRLF
+ "[-p prefix] [-g directives]" NGX_LINEFEED
+ NGX_LINEFEED
+ "Options:" NGX_LINEFEED
+ " -?,-h : this help" NGX_LINEFEED
+ " -v : show version and exit" NGX_LINEFEED
" -V : show version and configure options then exit"
- CRLF
- " -t : test configuration and exit" CRLF
+ NGX_LINEFEED
+ " -t : test configuration and exit" NGX_LINEFEED
" -q : suppress non-error messages "
- "during configuration testing" CRLF
+ "during configuration testing" NGX_LINEFEED
" -s signal : send signal to a master process: "
- "stop, quit, reopen, reload" CRLF
+ "stop, quit, reopen, reload" NGX_LINEFEED
#ifdef NGX_PREFIX
" -p prefix : set prefix path (default: "
- NGX_PREFIX ")" CRLF
+ NGX_PREFIX ")" NGX_LINEFEED
#else
- " -p prefix : set prefix path (default: NONE)" CRLF
+ " -p prefix : set prefix path (default: NONE)" NGX_LINEFEED
#endif
" -c filename : set configuration file (default: "
- NGX_CONF_PATH ")" CRLF
+ NGX_CONF_PATH ")" NGX_LINEFEED
" -g directives : set global directives out of configuration "
- "file" CRLF
- " -u : disable chroot(2)" CRLF
+ "file" NGX_LINEFEED NGX_LINEFEED
+ " -u : disable chroot(2) "
+ "file" NGX_LINEFEED NGX_LINEFEED
);
}
if (ngx_show_configure) {
+ ngx_write_stderr(
#ifdef NGX_COMPILER
- ngx_log_stderr(0, "built by " NGX_COMPILER);
+ "built by " NGX_COMPILER NGX_LINEFEED
#endif
#if (NGX_SSL)
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- ngx_log_stderr(0, "TLS SNI support enabled");
+ "TLS SNI support enabled" NGX_LINEFEED
#else
- ngx_log_stderr(0, "TLS SNI support disabled");
+ "TLS SNI support disabled" NGX_LINEFEED
#endif
#endif
- ngx_log_stderr(0, "configure arguments:" NGX_CONFIGURE);
+ "configure arguments:" NGX_CONFIGURE NGX_LINEFEED);
}
if (!ngx_test_config) {
@@ -261,10 +268,6 @@ main(int argc, char *const *argv)
}
}
-#if (NGX_FREEBSD)
- ngx_debug_init();
-#endif
-
/* TODO */ ngx_max_sockets = -1;
ngx_time_init();
@@ -375,6 +378,10 @@ main(int argc, char *const *argv)
ngx_daemonized = 1;
}
+ if (ngx_inherited) {
+ ngx_daemonized = 1;
+ }
+
#endif
if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {
@@ -765,9 +772,9 @@ ngx_get_options(int argc, char *const *argv)
ngx_log_stderr(0, "invalid option: \"-s %s\"", ngx_signal);
return NGX_ERROR;
- case 'u':
- ngx_chrooted = 0;
- break;
+ case 'u':
+ ngx_chrooted = 0;
+ break;
default:
ngx_log_stderr(0, "invalid option: \"%c\"", *(p - 1));
diff --git a/usr.sbin/nginx/src/core/nginx.h b/usr.sbin/nginx/src/core/nginx.h
index edec7629963..735ad2af6b2 100644
--- a/usr.sbin/nginx/src/core/nginx.h
+++ b/usr.sbin/nginx/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 1000010
-#define NGINX_VERSION "1.0.10"
+#define nginx_version 1000011
+#define NGINX_VERSION "1.0.11"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/usr.sbin/nginx/src/core/ngx_inet.c b/usr.sbin/nginx/src/core/ngx_inet.c
index ac1ca8bf202..4baa74aeecd 100644
--- a/usr.sbin/nginx/src/core/ngx_inet.c
+++ b/usr.sbin/nginx/src/core/ngx_inet.c
@@ -671,7 +671,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
n = ngx_atoi(port, len);
- if (n < 1 || n > 65536) {
+ if (n < 1 || n > 65535) {
u->err = "invalid port";
return NGX_ERROR;
}
@@ -695,7 +695,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
if (n != NGX_ERROR) {
- if (n < 1 || n > 65536) {
+ if (n < 1 || n > 65535) {
u->err = "invalid port";
return NGX_ERROR;
}
@@ -835,7 +835,7 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
n = ngx_atoi(port, len);
- if (n < 1 || n > 65536) {
+ if (n < 1 || n > 65535) {
u->err = "invalid port";
return NGX_ERROR;
}
diff --git a/usr.sbin/nginx/src/core/ngx_log.h b/usr.sbin/nginx/src/core/ngx_log.h
index 1054836f13e..a55ef449c1c 100644
--- a/usr.sbin/nginx/src/core/ngx_log.h
+++ b/usr.sbin/nginx/src/core/ngx_log.h
@@ -203,6 +203,22 @@ void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
u_char *ngx_log_errno(u_char *buf, u_char *last, ngx_err_t err);
+/*
+ * ngx_write_stderr() cannot be implemented as macro, since
+ * MSVC does not allow to use #ifdef inside macro parameters.
+ *
+ * ngx_write_fd() is used instead of ngx_write_console(), since
+ * CharToOemBuff() inside ngx_write_console() cannot be used with
+ * read only buffer as destination and CharToOemBuff() is not needed
+ * for ngx_write_stderr() anyway.
+ */
+static ngx_inline void
+ngx_write_stderr(char *text)
+{
+ (void) ngx_write_fd(ngx_stderr, text, strlen(text));
+}
+
+
extern ngx_module_t ngx_errlog_module;
extern ngx_uint_t ngx_use_stderr;
diff --git a/usr.sbin/nginx/src/core/ngx_string.c b/usr.sbin/nginx/src/core/ngx_string.c
index 29f8e0d6717..f5e1d4bf3e2 100644
--- a/usr.sbin/nginx/src/core/ngx_string.c
+++ b/usr.sbin/nginx/src/core/ngx_string.c
@@ -1657,6 +1657,10 @@ ngx_escape_html(u_char *dst, u_char *src, size_t size)
len += sizeof("&amp;") - 2;
break;
+ case '"':
+ len += sizeof("&quot;") - 2;
+ break;
+
default:
break;
}
@@ -1684,6 +1688,11 @@ ngx_escape_html(u_char *dst, u_char *src, size_t size)
*dst++ = ';';
break;
+ case '"':
+ *dst++ = '&'; *dst++ = 'q'; *dst++ = 'u'; *dst++ = 'o';
+ *dst++ = 't'; *dst++ = ';';
+ break;
+
default:
*dst++ = ch;
break;