[-]
[+]
|
Added |
nginx-1.1.changes
|
|
[-]
[+]
|
Changed |
nginx-1.1.spec
^
|
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/CHANGES
^
|
@@ -1,4 +1,48 @@
+Changes with nginx 1.1.17 15 Mar 2012
+
+ *) Security: content of previously freed memory might be sent to a
+ client if backend returned specially crafted response.
+ Thanks to Matthew Daley.
+
+ *) Bugfix: in the embedded perl module if used from SSI.
+ Thanks to Matthew Daley.
+
+ *) Bugfix: in the ngx_http_uwsgi_module.
+
+
+Changes with nginx 1.1.16 29 Feb 2012
+
+ *) Change: the simultaneous subrequest limit has been raised to 200.
+
+ *) Feature: the "from" parameter of the "disable_symlinks" directive.
+
+ *) Feature: the "return" and "error_page" directives can now be used to
+ return 307 redirections.
+
+ *) Bugfix: a segmentation fault might occur in a worker process if the
+ "resolver" directive was used and there was no "error_log" directive
+ specified at global level.
+ Thanks to Roman Arutyunyan.
+
+ *) Bugfix: a segmentation fault might occur in a worker process if the
+ "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives were
+ used.
+
+ *) Bugfix: memory leaks.
+ Thanks to Lanshun Zhou.
+
+ *) Bugfix: in the "disable_symlinks" directive.
+
+ *) Bugfix: on ZFS filesystem disk cache size might be calculated
+ incorrectly; the bug had appeared in 1.0.1.
+
+ *) Bugfix: nginx could not be built by the icc 12.1 compiler.
+
+ *) Bugfix: nginx could not be built by gcc on Solaris; the bug had
+ appeared in 1.1.15.
+
+
Changes with nginx 1.1.15 15 Feb 2012
*) Feature: the "disable_symlinks" directive.
@@ -13,13 +57,14 @@
*) Bugfix: nginx could not be built with the ngx_http_perl_module if the
--with-openssl option was used.
- *) Bugfix: internal redirects to named locations were not limited.
+ *) Bugfix: the number of internal redirects to named locations was not
+ limited.
*) Bugfix: calling $r->flush() multiple times might cause errors in the
ngx_http_gzip_filter_module.
*) Bugfix: temporary files might be not removed if the "proxy_store"
- directive were used with SSI includes.
+ directive was used with SSI includes.
*) Bugfix: in some cases non-cacheable variables (such as the $args
variable) returned old empty cached value.
@@ -40,8 +85,8 @@
*) Bugfix: in the OpenSSL library initialization.
- *) Bugfix: the "proxy_redirect" directives might not be correctly
- inherited.
+ *) Bugfix: the "proxy_redirect" directives might be inherited
+ incorrectly.
*) Bugfix: memory leak during reconfiguration if the "pcre_jit"
directive was used.
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/CHANGES.ru
^
|
@@ -1,4 +1,49 @@
+Изменения в nginx 1.1.17 15.03.2012
+
+ *) Безопасность: содержимое ранее освобождённой памяти могло быть
+ отправлено клиенту, если бэкенд возвращал специально созданный ответ.
+ Спасибо Matthew Daley.
+
+ *) Исправление: при использовании встроенного перла из SSI.
+ Спасибо Matthew Daley.
+
+ *) Исправление: в модуле ngx_http_uwsgi_module.
+
+
+Изменения в nginx 1.1.16 29.02.2012
+
+ *) Изменение: ограничение на количество одновременных подзапросов
+ поднято до 200.
+
+ *) Добавление: параметр from в директиве disable_symlinks.
+
+ *) Добавление: директивы return и error_page теперь могут использоваться
+ для возврата перенаправлений с кодом 307.
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
+ если использовалась директива resolver и на глобальном уровне не была
+ задана директива error_log.
+ Спасибо Роману Арутюняну.
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
+ если использовались директивы "proxy_http_version 1.1" или
+ "fastcgi_keep_conn on".
+
+ *) Исправление: утечек памяти.
+ Спасибо Lanshun Zhou.
+
+ *) Исправление: в директиве disable_symlinks.
+
+ *) Исправление: при использовании ZFS размер кэша на диске мог считаться
+ некорректно; ошибка появилась в 1.0.1.
+
+ *) Исправление: nginx не собирался компилятором icc 12.1.
+
+ *) Исправление: nginx не собирался gcc на Solaris; ошибка появилась в
+ 1.1.15.
+
+
Изменения в nginx 1.1.15 15.02.2012
*) Добавление: директива disable_symlinks.
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/auto/cc/name
^
|
@@ -64,16 +64,16 @@
echo " + using Borland C++ compiler"
else
-if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
- NGX_CC_NAME=gcc
- echo " + using GNU C compiler"
-
-else
if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
else
+if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
+ NGX_CC_NAME=gcc
+ echo " + using GNU C compiler"
+
+else
if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
NGX_CC_NAME=sunc
echo " + using Sun C compiler"
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/man/nginx.8
^
|
@@ -25,7 +25,7 @@
.\" SUCH DAMAGE.
.\"
.\"
-.Dd August 10, 2011
+.Dd March 6, 2012
.Dt NGINX 8
.Os
.Sh NAME
@@ -33,25 +33,22 @@
.Nd "HTTP and reverse proxy server, mail proxy server"
.Sh SYNOPSIS
.Nm
-.Op Fl hqtvV?
+.Op Fl ?hqtVv
.Op Fl c Ar file
.Op Fl g Ar directives
.Op Fl p Ar prefix
.Op Fl s Ar signal
.Sh DESCRIPTION
-The
.Nm
-(spelled
+(pronounced
.Dq engine x )
is an HTTP and reverse proxy server, as well as a mail proxy server.
-The
-.Nm
-is known for its high performance, stability, rich feature set, simple
+It is known for its high performance, stability, rich feature set, simple
configuration, and low resource consumption.
.Pp
The options are as follows:
.Bl -tag -width ".Fl d Ar directives"
-.It Fl ?\& | h
+.It Fl ?\& , h
Print help.
.It Fl c Ar file
Use an alternative configuration
@@ -62,20 +59,20 @@
.Sx EXAMPLES
for details.
.It Fl p Ar prefix
-Set prefix path.
-Default value is
+Set the prefix path.
+The default value is
.Pa %%PREFIX%% .
.It Fl q
Suppress non-error messages during configuration testing.
.It Fl s Ar signal
-Send signal to the master process.
+Send a signal to the master process.
The argument
.Ar signal
can be one of:
.Cm stop , quit , reopen , reload .
-The following table shows the corresponding system signals.
+The following table shows the corresponding system signals:
.Pp
-.Bl -tag -width ".It Cm reopen" -compact
+.Bl -tag -width ".Cm reopen" -compact
.It Cm stop
.Dv SIGTERM
.It Cm quit
@@ -86,49 +83,48 @@
.Dv SIGHUP
.El
.It Fl t
-Don't run, just test the configuration file.
-The
+Do not run, just test the configuration file.
.Nm
-checks configuration for correct syntax and then tries to open files
-referred in configuration.
-.It Fl v
-Print
-.Nm
-version.
+checks the configuration file syntax and then tries to open files
+referenced in the configuration file.
.It Fl V
-Print
+Print the
.Nm
-version, compiler version and
+version, compiler version, and
.Pa configure
script parameters.
+.It Fl v
+Print the
+.Nm
+version.
.El
.Sh SIGNALS
The master process of
.Nm
-can handle the following signals.
+can handle the following signals:
.Pp
-.Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
+.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGINT , SIGTERM
Shut down quickly.
.It Dv SIGHUP
Reload configuration, start the new worker process with a new
-configuration, gracefully shut down old worker processes.
+configuration, and gracefully shut down old worker processes.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.It Dv SIGUSR2
-Upgrade
+Upgrade the
.Nm
executable on the fly.
.It Dv SIGWINCH
-Shut down gracefully worker processes.
+Shut down worker processes gracefully.
.El
.Pp
-While there's no need to explicitly control worker processes normally,
-they support some signals, too:
+While there is no need to explicitly control worker processes normally,
+they support some signals too:
.Pp
-.Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
+.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGTERM
Shut down quickly.
.It Dv SIGQUIT
@@ -150,40 +146,44 @@
.Pp
.Dl "error_log /path/to/log debug;"
.Pp
-It is also possible to enable the debugging for some IP address:
+It is also possible to enable the debugging for a particular IP address:
.Bd -literal -offset indent
events {
debug_connection 127.0.0.1;
}
.Ed
+.Sh ENVIRONMENT
+The
+.Ev NGINX
+environment variable is used internally by
+.Nm
+and should not be set directly by the user.
.Sh FILES
-.Bl -tag -width indent -compact
+.Bl -tag -width indent
.It Pa %%PID_PATH%%
-Contains the process ID of the
-.Nm
-listening for connections.
-The content of this file is not sensitive; it can be world-readable.
+Contains the process ID of
+.Nm .
+The contents of this file are not sensitive, so it can be world-readable.
.It Pa %%CONF_PATH%%
-Main configuration file.
+The main configuration file.
.It Pa %%ERROR_LOG_PATH%%
Error log file.
.El
.Sh EXIT STATUS
Exit status is 0 on success, or 1 if the command fails.
.Sh EXAMPLES
-.Bd -literal
-nginx -t -c ~/mynginx.conf -g "pid /var/run/mynginx.pid; worker_processes 2;"
-.Ed
Test configuration file
.Pa ~/mynginx.conf
-with global directives for PID and quantity of worker processes.
+with global directives for PID and quantity of worker processes:
+.Bd -literal -offset indent
+nginx -t -c ~/mynginx.conf \e
+ -g "pid /var/run/mynginx.pid; worker_processes 2;"
+.Ed
.Sh SEE ALSO
.\"Xr nginx.conf 5
.\"Pp
Documentation at
-.Pa http://nginx.org/
-and
-.Pa http://sysoev.ru/nginx/ .
+.Pa http://nginx.org/en/docs/ .
.Pp
For questions and technical support, please refer to
.Pa http://nginx.org/en/support.html .
@@ -193,10 +193,10 @@
started in 2002, with the first public release on October 4, 2004.
.Sh AUTHORS
.An -nosplit
-.An Igor Sysoev Aq igor@sysoev.ru
+.An Igor Sysoev Aq igor@sysoev.ru .
.Pp
-This manual page was written by
+This manual page was originally written by
.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
-as a result of compilation of many
+as a result of compiling many
.Nm
-documents all over the world.
+documents from all over the world.
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/nginx.h
^
|
@@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 1001015
-#define NGINX_VERSION "1.1.15"
+#define nginx_version 1001017
+#define NGINX_VERSION "1.1.17"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/ngx_connection.c
^
|
@@ -514,7 +514,7 @@
}
}
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
+#if (NGX_HAVE_KEEPALIVE_TUNABLE)
if (ls[i].keepidle) {
if (setsockopt(ls[i].fd, IPPROTO_TCP, TCP_KEEPIDLE,
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/ngx_open_file_cache.c
^
|
@@ -229,6 +229,7 @@
&& now - file->created < of->valid
#if (NGX_HAVE_OPENAT)
&& of->disable_symlinks == file->disable_symlinks
+ && of->disable_symlinks_from == file->disable_symlinks_from
#endif
))
{
@@ -395,6 +396,7 @@
file->err = of->err;
#if (NGX_HAVE_OPENAT)
file->disable_symlinks = of->disable_symlinks;
+ file->disable_symlinks_from = of->disable_symlinks_from;
#endif
if (of->err == 0) {
@@ -504,8 +506,8 @@
fd = ngx_openat_file(at_fd, name, mode, create, access);
- if (fd == NGX_FILE_ERROR) {
- return NGX_FILE_ERROR;
+ if (fd == NGX_INVALID_FILE) {
+ return NGX_INVALID_FILE;
}
if (ngx_file_at_info(at_fd, name, &atfi, AT_SYMLINK_NOFOLLOW)
@@ -565,7 +567,6 @@
u_char *p, *cp, *end;
ngx_fd_t at_fd;
ngx_str_t at_name;
- ngx_file_info_t fi;
if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) {
fd = ngx_open_file(name->data, mode, create, access);
@@ -582,22 +583,45 @@
p = name->data;
end = p + name->len;
- at_fd = AT_FDCWD;
at_name = *name;
- if (p[0] == '/') {
- at_fd = ngx_openat_file(at_fd, "/",
- NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
- NGX_FILE_OPEN, 0);
+ if (of->disable_symlinks_from) {
+
+ cp = p + of->disable_symlinks_from;
+
+ *cp = '\0';
- if (at_fd == NGX_FILE_ERROR) {
+ at_fd = ngx_open_file(p, NGX_FILE_SEARCH|NGX_FILE_NONBLOCK,
+ NGX_FILE_OPEN, 0);
+
+ *cp = '/';
+
+ if (at_fd == NGX_INVALID_FILE) {
+ of->err = ngx_errno;
+ of->failed = ngx_open_file_n;
+ return NGX_INVALID_FILE;
+ }
+
+ at_name.len = of->disable_symlinks_from;
+ p = cp + 1;
+
+ } else if (*p == '/') {
+
+ at_fd = ngx_open_file("/",
+ NGX_FILE_SEARCH|NGX_FILE_NONBLOCK,
+ NGX_FILE_OPEN, 0);
+
+ if (at_fd == NGX_INVALID_FILE) {
of->err = ngx_errno;
of->failed = ngx_openat_file_n;
- return NGX_FILE_ERROR;
+ return NGX_INVALID_FILE;
}
at_name.len = 1;
p++;
+
+ } else {
+ at_fd = NGX_AT_FDCWD;
}
for ( ;; ) {
@@ -615,12 +639,12 @@
if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) {
fd = ngx_openat_file_owner(at_fd, p,
- NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
+ NGX_FILE_SEARCH|NGX_FILE_NONBLOCK,
NGX_FILE_OPEN, 0, log);
} else {
fd = ngx_openat_file(at_fd, p,
- NGX_FILE_RDONLY|NGX_FILE_NONBLOCK|NGX_FILE_NOFOLLOW,
+ NGX_FILE_SEARCH|NGX_FILE_NONBLOCK|NGX_FILE_NOFOLLOW,
NGX_FILE_OPEN, 0);
}
@@ -632,9 +656,9 @@
goto failed;
}
- if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
+ if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%V\" failed", at_name);
+ ngx_close_file_n " \"%V\" failed", &at_name);
}
p = cp + 1;
@@ -642,47 +666,34 @@
at_name.len = cp - at_name.data;
}
- if (p == end && at_fd != AT_FDCWD) {
+ if (p == end) {
/*
- * If pathname ends with a trailing slash, check if last path
- * component is a directory; if not, fail with ENOTDIR as per
- * POSIX.
- *
- * We use separate check instead of O_DIRECTORY in the loop above,
- * as O_DIRECTORY doesn't work on FreeBSD 8.
+ * If pathname ends with a trailing slash, assume the last path
+ * component is a directory and reopen it with requested flags;
+ * if not, fail with ENOTDIR as per POSIX.
*
- * Note this returns already opened file descriptor, with different
- * mode/create/access. This is believed to be safe as we don't
- * use this codepath to create directories.
+ * We cannot rely on O_DIRECTORY in the loop above to check
+ * that the last path component is a directory because
+ * O_DIRECTORY doesn't work on FreeBSD 8. Fortunately, by
+ * reopening a directory, we don't depend on it at all.
*/
- if (ngx_fd_info(at_fd, &fi) == NGX_FILE_ERROR) {
- of->err = ngx_errno;
- of->failed = ngx_fd_info_n;
- fd = NGX_INVALID_FILE;
-
- goto failed;
- }
-
- if (ngx_is_dir(&fi)) {
- return at_fd;
- }
-
- of->err = ENOTDIR;
- of->failed = ngx_openat_file_n;
- fd = NGX_INVALID_FILE;
-
- goto failed;
+ fd = ngx_openat_file(at_fd, ".", mode, create, access);
+ goto done;
}
- if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER) {
+ if (of->disable_symlinks == NGX_DISABLE_SYMLINKS_NOTOWNER
+ && !(create & (NGX_FILE_CREATE_OR_OPEN|NGX_FILE_TRUNCATE)))
+ {
fd = ngx_openat_file_owner(at_fd, p, mode, create, access, log);
} else {
fd = ngx_openat_file(at_fd, p, mode|NGX_FILE_NOFOLLOW, create, access);
}
+done:
+
if (fd == NGX_INVALID_FILE) {
of->err = ngx_errno;
of->failed = ngx_openat_file_n;
@@ -690,9 +701,9 @@
failed:
- if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
+ if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%V\" failed", at_name);
+ ngx_close_file_n " \"%V\" failed", &at_name);
}
return fd;
@@ -1131,20 +1142,15 @@
/* hash == node->key */
- do {
- file = (ngx_cached_open_file_t *) node;
-
- rc = ngx_strcmp(name->data, file->name);
+ file = (ngx_cached_open_file_t *) node;
- if (rc == 0) {
- return file;
- }
+ rc = ngx_strcmp(name->data, file->name);
- node = (rc < 0) ? node->left : node->right;
-
- } while (node != sentinel && hash == node->key);
+ if (rc == 0) {
+ return file;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
return NULL;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/ngx_open_file_cache.h
^
|
@@ -33,6 +33,7 @@
ngx_uint_t min_uses;
#if (NGX_HAVE_OPENAT)
+ size_t disable_symlinks_from;
unsigned disable_symlinks:2;
#endif
@@ -69,6 +70,7 @@
uint32_t uses;
#if (NGX_HAVE_OPENAT)
+ size_t disable_symlinks_from;
unsigned disable_symlinks:2;
#endif
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/ngx_resolver.c
^
|
@@ -189,11 +189,6 @@
uc->sockaddr = u.addrs->sockaddr;
uc->socklen = u.addrs->socklen;
uc->server = u.addrs->name;
-
- uc->log = cf->cycle->new_log;
- uc->log.handler = ngx_resolver_log_error;
- uc->log.data = uc;
- uc->log.action = "resolving";
}
return r;
@@ -876,6 +871,12 @@
}
if (uc->connection == NULL) {
+
+ uc->log = *r->log;
+ uc->log.handler = ngx_resolver_log_error;
+ uc->log.data = uc;
+ uc->log.action = "resolving";
+
if (ngx_udp_connect(uc) != NGX_OK) {
return NGX_ERROR;
}
@@ -1688,20 +1689,15 @@
/* hash == node->key */
- do {
- rn = (ngx_resolver_node_t *) node;
+ rn = (ngx_resolver_node_t *) node;
- rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen);
-
- if (rc == 0) {
- return rn;
- }
+ rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen);
- node = (rc < 0) ? node->left : node->right;
-
- } while (node != sentinel && hash == node->key);
+ if (rc == 0) {
+ return rn;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
/* not found */
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/core/ngx_times.c
^
|
@@ -287,7 +287,7 @@
days = n / 86400;
- /* Jaunary 1, 1970 was Thursday */
+ /* January 1, 1970 was Thursday */
wday = (4 + days) % 7;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/event/ngx_event.h
^
|
@@ -83,7 +83,7 @@
#endif
#if (NGX_WIN32)
- /* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was succesfull */
+ /* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was successful */
unsigned accept_context_updated:1;
#endif
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/event/ngx_event_openssl.c
^
|
@@ -478,6 +478,7 @@
return NGX_OK;
}
+
ngx_int_t
ngx_ssl_ecdh_curve(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *name)
{
@@ -518,6 +519,7 @@
return NGX_OK;
}
+
ngx_int_t
ngx_ssl_create_connection(ngx_ssl_t *ssl, ngx_connection_t *c, ngx_uint_t flags)
{
@@ -842,7 +844,7 @@
case NGX_ERROR:
c->read->error = 1;
- /* fall thruogh */
+ /* fall through */
case NGX_AGAIN:
return c->ssl->last;
@@ -1801,44 +1803,39 @@
/* hash == node->key */
- do {
- sess_id = (ngx_ssl_sess_id_t *) node;
+ sess_id = (ngx_ssl_sess_id_t *) node;
- rc = ngx_memn2cmp(id, sess_id->id,
- (size_t) len, (size_t) node->data);
- if (rc == 0) {
+ rc = ngx_memn2cmp(id, sess_id->id, (size_t) len, (size_t) node->data);
- if (sess_id->expire > ngx_time()) {
- ngx_memcpy(buf, sess_id->session, sess_id->len);
+ if (rc == 0) {
- ngx_shmtx_unlock(&shpool->mutex);
+ if (sess_id->expire > ngx_time()) {
+ ngx_memcpy(buf, sess_id->session, sess_id->len);
- p = buf;
- sess = d2i_SSL_SESSION(NULL, &p, sess_id->len);
+ ngx_shmtx_unlock(&shpool->mutex);
- return sess;
- }
+ p = buf;
+ sess = d2i_SSL_SESSION(NULL, &p, sess_id->len);
- ngx_queue_remove(&sess_id->queue);
+ return sess;
+ }
- ngx_rbtree_delete(&cache->session_rbtree, node);
+ ngx_queue_remove(&sess_id->queue);
- ngx_slab_free_locked(shpool, sess_id->session);
+ ngx_rbtree_delete(&cache->session_rbtree, node);
+
+ ngx_slab_free_locked(shpool, sess_id->session);
#if (NGX_PTR_SIZE == 4)
- ngx_slab_free_locked(shpool, sess_id->id);
+ ngx_slab_free_locked(shpool, sess_id->id);
#endif
- ngx_slab_free_locked(shpool, sess_id);
-
- sess = NULL;
+ ngx_slab_free_locked(shpool, sess_id);
- goto done;
- }
+ sess = NULL;
- node = (rc < 0) ? node->left : node->right;
-
- } while (node != sentinel && hash == node->key);
+ goto done;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
done:
@@ -1908,31 +1905,26 @@
/* hash == node->key */
- do {
- sess_id = (ngx_ssl_sess_id_t *) node;
+ sess_id = (ngx_ssl_sess_id_t *) node;
- rc = ngx_memn2cmp(id, sess_id->id, len, (size_t) node->data);
+ rc = ngx_memn2cmp(id, sess_id->id, len, (size_t) node->data);
- if (rc == 0) {
+ if (rc == 0) {
- ngx_queue_remove(&sess_id->queue);
+ ngx_queue_remove(&sess_id->queue);
- ngx_rbtree_delete(&cache->session_rbtree, node);
+ ngx_rbtree_delete(&cache->session_rbtree, node);
- ngx_slab_free_locked(shpool, sess_id->session);
+ ngx_slab_free_locked(shpool, sess_id->session);
#if (NGX_PTR_SIZE == 4)
- ngx_slab_free_locked(shpool, sess_id->id);
+ ngx_slab_free_locked(shpool, sess_id->id);
#endif
- ngx_slab_free_locked(shpool, sess_id);
-
- goto done;
- }
-
- node = (rc < 0) ? node->left : node->right;
+ ngx_slab_free_locked(shpool, sess_id);
- } while (node != sentinel && hash == node->key);
+ goto done;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
done:
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/event/ngx_event_pipe.c
^
|
@@ -401,13 +401,14 @@
if (cl->buf->last - cl->buf->pos >= p->length) {
+ p->free_raw_bufs = cl->next;
+
/* STUB */ cl->buf->num = p->num++;
if (p->input_filter(p, cl->buf) == NGX_ERROR) {
return NGX_ABORT;
}
- p->free_raw_bufs = cl->next;
ngx_free_chain(p->pool, cl);
}
}
@@ -968,7 +969,7 @@
return NGX_OK;
}
- /* the first free buf is partialy filled, thus add the free buf after it */
+ /* the first free buf is partially filled, thus add the free buf after it */
cl->next = p->free_raw_bufs->next;
p->free_raw_bufs->next = cl;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_autoindex_module.c
^
|
@@ -95,8 +95,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_autoindex_create_loc_conf, /* create location configration */
- ngx_http_autoindex_merge_loc_conf /* merge location configration */
+ ngx_http_autoindex_create_loc_conf, /* create location configuration */
+ ngx_http_autoindex_merge_loc_conf /* merge location configuration */
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_fastcgi_module.c
^
|
@@ -1501,10 +1501,10 @@
h->lowcase_key = h->key.data + h->key.len + 1
+ h->value.len + 1;
- ngx_cpystrn(h->key.data, r->header_name_start,
- h->key.len + 1);
- ngx_cpystrn(h->value.data, r->header_start,
- h->value.len + 1);
+ ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
+ h->key.data[h->key.len] = '\0';
+ ngx_memcpy(h->value.data, r->header_start, h->value.len);
+ h->value.data[h->value.len] = '\0';
}
h->hash = r->header_hash;
@@ -2432,7 +2432,8 @@
if (prev->headers_hash.buckets
#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
+ && ((conf->upstream.cache == NULL)
+ == (prev->upstream.cache == NULL))
#endif
)
{
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_flv_module.c
^
|
@@ -109,9 +109,10 @@
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_gzip_static_module.c
^
|
@@ -129,9 +129,10 @@
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_index_module.c
^
|
@@ -62,8 +62,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_index_create_loc_conf, /* create location configration */
- ngx_http_index_merge_loc_conf /* merge location configration */
+ ngx_http_index_create_loc_conf, /* create location configuration */
+ ngx_http_index_merge_loc_conf /* merge location configuration */
};
@@ -209,9 +209,10 @@
of.test_only = 1;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
@@ -307,9 +308,10 @@
of.test_only = 1;
of.valid = clcf->open_file_cache_valid;
of.errors = clcf->open_file_cache_errors;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &dir, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_limit_conn_module.c
^
|
@@ -118,8 +118,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_limit_conn_create_conf, /* create location configration */
- ngx_http_limit_conn_merge_conf /* merge location configration */
+ ngx_http_limit_conn_create_conf, /* create location configuration */
+ ngx_http_limit_conn_merge_conf /* merge location configuration */
};
@@ -325,20 +325,15 @@
/* hash == node->key */
- do {
- lcn = (ngx_http_limit_conn_node_t *) &node->color;
-
- rc = ngx_memn2cmp(vv->data, lcn->data,
- (size_t) vv->len, (size_t) lcn->len);
- if (rc == 0) {
- return node;
- }
+ lcn = (ngx_http_limit_conn_node_t *) &node->color;
- node = (rc < 0) ? node->left : node->right;
-
- } while (node != sentinel && hash == node->key);
+ rc = ngx_memn2cmp(vv->data, lcn->data,
+ (size_t) vv->len, (size_t) lcn->len);
+ if (rc == 0) {
+ return node;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
return NULL;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_limit_req_module.c
^
|
@@ -121,8 +121,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_limit_req_create_conf, /* create location configration */
- ngx_http_limit_req_merge_conf /* merge location configration */
+ ngx_http_limit_req_create_conf, /* create location configuration */
+ ngx_http_limit_req_merge_conf /* merge location configuration */
};
@@ -385,47 +385,42 @@
/* hash == node->key */
- do {
- lr = (ngx_http_limit_req_node_t *) &node->color;
+ lr = (ngx_http_limit_req_node_t *) &node->color;
- rc = ngx_memn2cmp(data, lr->data, len, (size_t) lr->len);
+ rc = ngx_memn2cmp(data, lr->data, len, (size_t) lr->len);
- if (rc == 0) {
- ngx_queue_remove(&lr->queue);
- ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
+ if (rc == 0) {
+ ngx_queue_remove(&lr->queue);
+ ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
- ms = (ngx_msec_int_t) (now - lr->last);
+ ms = (ngx_msec_int_t) (now - lr->last);
- excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
+ excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
- if (excess < 0) {
- excess = 0;
- }
-
- *ep = excess;
-
- if ((ngx_uint_t) excess > limit->burst) {
- return NGX_BUSY;
- }
-
- if (account) {
- lr->excess = excess;
- lr->last = now;
- return NGX_OK;
- }
+ if (excess < 0) {
+ excess = 0;
+ }
- lr->count++;
+ *ep = excess;
- ctx->node = lr;
+ if ((ngx_uint_t) excess > limit->burst) {
+ return NGX_BUSY;
+ }
- return NGX_AGAIN;
+ if (account) {
+ lr->excess = excess;
+ lr->last = now;
+ return NGX_OK;
}
- node = (rc < 0) ? node->left : node->right;
+ lr->count++;
+
+ ctx->node = lr;
- } while (node != sentinel && hash == node->key);
+ return NGX_AGAIN;
+ }
- break;
+ node = (rc < 0) ? node->left : node->right;
}
*ep = 0;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_log_module.c
^
|
@@ -161,8 +161,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_log_create_loc_conf, /* create location configration */
- ngx_http_log_merge_loc_conf /* merge location configration */
+ ngx_http_log_create_loc_conf, /* create location configuration */
+ ngx_http_log_merge_loc_conf /* merge location configuration */
};
@@ -377,10 +377,10 @@
if (!r->root_tested) {
- /* test root directory existance */
+ /* test root directory existence */
if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
@@ -394,22 +394,24 @@
of.test_only = 1;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ /* simulate successful logging */
+ return len;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
{
if (of.err == 0) {
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
"testing \"%s\" existence failed", path.data);
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
@@ -417,7 +419,7 @@
ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
"testing \"%s\" existence failed", path.data);
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
}
@@ -426,7 +428,7 @@
script->values->elts)
== NULL)
{
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
@@ -444,16 +446,18 @@
of.valid = llcf->open_file_cache_valid;
of.min_uses = llcf->open_file_cache_min_uses;
of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) {
+ /* simulate successful logging */
+ return len;
+ }
if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
!= NGX_OK)
{
ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
"%s \"%s\" failed", of.failed, log.data);
- /* simulate successfull logging */
+ /* simulate successful logging */
return len;
}
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_memcached_module.c
^
|
@@ -115,8 +115,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_memcached_create_loc_conf, /* create location configration */
- ngx_http_memcached_merge_loc_conf /* merge location configration */
+ ngx_http_memcached_create_loc_conf, /* create location configuration */
+ ngx_http_memcached_merge_loc_conf /* merge location configuration */
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_mp4_module.c
^
|
@@ -440,9 +440,10 @@
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_proxy_module.c
^
|
@@ -530,8 +530,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_proxy_create_loc_conf, /* create location configration */
- ngx_http_proxy_merge_loc_conf /* merge location configration */
+ ngx_http_proxy_create_loc_conf, /* create location configuration */
+ ngx_http_proxy_merge_loc_conf /* merge location configuration */
};
@@ -1381,8 +1381,10 @@
h->value.data = h->key.data + h->key.len + 1;
h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
- ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1);
- ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1);
+ ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
+ h->key.data[h->key.len] = '\0';
+ ngx_memcpy(h->value.data, r->header_start, h->value.len);
+ h->value.data[h->value.len] = '\0';
if (h->key.len == r->lowcase_index) {
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_random_index_module.c
^
|
@@ -49,8 +49,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_random_index_create_loc_conf, /* create location configration */
- ngx_http_random_index_merge_loc_conf /* merge location configration */
+ ngx_http_random_index_create_loc_conf, /* create location configuration */
+ ngx_http_random_index_merge_loc_conf /* merge location configuration */
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_rewrite_module.c
^
|
@@ -112,8 +112,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_rewrite_create_loc_conf, /* create location configration */
- ngx_http_rewrite_merge_loc_conf /* merge location configration */
+ ngx_http_rewrite_create_loc_conf, /* create location configuration */
+ ngx_http_rewrite_merge_loc_conf /* merge location configuration */
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_scgi_module.c
^
|
@@ -941,8 +941,10 @@
h->value.data = h->key.data + h->key.len + 1;
h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
- ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1);
- ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1);
+ ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
+ h->key.data[h->key.len] = '\0';
+ ngx_memcpy(h->value.data, r->header_start, h->value.len);
+ h->value.data[h->value.len] = '\0';
if (h->key.len == r->lowcase_index) {
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
@@ -1384,7 +1386,8 @@
if (prev->headers_hash.buckets
#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
+ && ((conf->upstream.cache == NULL)
+ == (prev->upstream.cache == NULL))
#endif
)
{
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_ssi_filter_module.c
^
|
@@ -1204,7 +1204,7 @@
if (ctx->value_buf == NULL) {
ctx->param->value.data = ngx_pnalloc(r->pool,
- ctx->value_len);
+ ctx->value_len + 1);
if (ctx->param->value.data == NULL) {
return NGX_ERROR;
}
@@ -1375,6 +1375,16 @@
case ssi_quoted_symbol_state:
state = ctx->saved_state;
+ if (ctx->param->value.len == ctx->value_len) {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "too long \"%V%c...\" value of \"%V\" "
+ "parameter in \"%V\" SSI command",
+ &ctx->param->value, ch, &ctx->param->key,
+ &ctx->command);
+ state = ssi_error_state;
+ break;
+ }
+
ctx->param->value.data[ctx->param->value.len++] = ch;
break;
@@ -2886,7 +2896,7 @@
prev->ignore_recycled_buffers, 0);
ngx_conf_merge_size_value(conf->min_file_chunk, prev->min_file_chunk, 1024);
- ngx_conf_merge_size_value(conf->value_len, prev->value_len, 256);
+ ngx_conf_merge_size_value(conf->value_len, prev->value_len, 255);
if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
&prev->types_keys, &prev->types,
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_static_module.c
^
|
@@ -94,9 +94,10 @@
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_userid_filter_module.c
^
|
@@ -166,8 +166,8 @@
NULL, /* create server configuration */
NULL, /* merge server configuration */
- ngx_http_userid_create_conf, /* create location configration */
- ngx_http_userid_merge_conf /* merge location configration */
+ ngx_http_userid_create_conf, /* create location configuration */
+ ngx_http_userid_merge_conf /* merge location configuration */
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/ngx_http_uwsgi_module.c
^
|
@@ -43,7 +43,6 @@
static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r);
static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r);
static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r);
static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r,
ngx_int_t rc);
@@ -912,10 +911,7 @@
}
if (rc == NGX_ERROR) {
- r->http_version = NGX_HTTP_VERSION_9;
-
u->process_header = ngx_http_uwsgi_process_header;
-
return ngx_http_uwsgi_process_header(r);
}
@@ -985,8 +981,10 @@
h->value.data = h->key.data + h->key.len + 1;
h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
- ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1);
- ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1);
+ ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
+ h->key.data[h->key.len] = '\0';
+ ngx_memcpy(h->value.data, r->header_start, h->value.len);
+ h->value.data[h->value.len] = '\0';
if (h->key.len == r->lowcase_index) {
ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
@@ -1015,12 +1013,12 @@
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http uwsgi header done");
- if (r->http_version > NGX_HTTP_VERSION_9) {
+ u = r->upstream;
+
+ if (u->headers_in.status_n) {
return NGX_OK;
}
- u = r->upstream;
-
if (u->headers_in.status) {
status_line = &u->headers_in.status->value;
@@ -1032,20 +1030,15 @@
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
- r->http_version = NGX_HTTP_VERSION_10;
u->headers_in.status_n = status;
u->headers_in.status_line = *status_line;
} else if (u->headers_in.location) {
- r->http_version = NGX_HTTP_VERSION_10;
u->headers_in.status_n = 302;
ngx_str_set(&u->headers_in.status_line,
"302 Moved Temporarily");
} else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent neither valid HTTP/1.0 header "
- "nor \"Status\" header line");
u->headers_in.status_n = 200;
ngx_str_set(&u->headers_in.status_line, "200 OK");
}
@@ -1441,7 +1434,8 @@
if (prev->headers_hash.buckets
#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
+ && ((conf->upstream.cache == NULL)
+ == (prev->upstream.cache == NULL))
#endif
)
{
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/perl/nginx.pm
^
|
@@ -21,7 +21,9 @@
HTTP_MOVED_PERMANENTLY
HTTP_MOVED_TEMPORARILY
HTTP_REDIRECT
+ HTTP_SEE_OTHER
HTTP_NOT_MODIFIED
+ HTTP_TEMPORARY_REDIRECT
HTTP_BAD_REQUEST
HTTP_UNAUTHORIZED
@@ -48,7 +50,7 @@
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '1.1.15';
+our $VERSION = '1.1.17';
require XSLoader;
XSLoader::load('nginx', $VERSION);
@@ -67,7 +69,9 @@
use constant HTTP_MOVED_PERMANENTLY => 301;
use constant HTTP_MOVED_TEMPORARILY => 302;
use constant HTTP_REDIRECT => 302;
+use constant HTTP_SEE_OTHER => 303;
use constant HTTP_NOT_MODIFIED => 304;
+use constant HTTP_TEMPORARY_REDIRECT => 307;
use constant HTTP_BAD_REQUEST => 400;
use constant HTTP_UNAUTHORIZED => 401;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/modules/perl/nginx.xs
^
|
@@ -662,9 +662,10 @@
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ XSRETURN_EMPTY;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_busy_lock.c
^
|
@@ -300,7 +300,7 @@
if (bl->timeout == 0 && bl->max_waiting) {
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "busy lock waiting is useless with zero timeout, ignoring");
+ "busy lock waiting is useless with zero timeout, ignoring");
}
return NGX_CONF_OK;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_core_module.c
^
|
@@ -76,6 +76,10 @@
static char *ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
#endif
+#if (NGX_HAVE_OPENAT)
+static char *ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
+#endif
static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
@@ -187,18 +191,6 @@
#endif
-#if (NGX_HAVE_OPENAT)
-
-static ngx_conf_enum_t ngx_http_core_disable_symlinks[] = {
- { ngx_string("off"), NGX_DISABLE_SYMLINKS_OFF },
- { ngx_string("if_not_owner"), NGX_DISABLE_SYMLINKS_NOTOWNER },
- { ngx_string("on"), NGX_DISABLE_SYMLINKS_ON },
- { ngx_null_string, 0 }
-};
-
-#endif
-
-
static ngx_command_t ngx_http_core_commands[] = {
{ ngx_string("variables_hash_max_size"),
@@ -779,11 +771,11 @@
#if (NGX_HAVE_OPENAT)
{ ngx_string("disable_symlinks"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
+ ngx_http_disable_symlinks,
NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, disable_symlinks),
- &ngx_http_core_disable_symlinks },
+ 0,
+ NULL },
#endif
@@ -1320,9 +1312,11 @@
of.test_only = 1;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ return NGX_OK;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
@@ -1824,8 +1818,11 @@
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- if (status >= NGX_HTTP_MOVED_PERMANENTLY && status <= NGX_HTTP_SEE_OTHER) {
-
+ if (status == NGX_HTTP_MOVED_PERMANENTLY
+ || status == NGX_HTTP_MOVED_TEMPORARILY
+ || status == NGX_HTTP_SEE_OTHER
+ || status == NGX_HTTP_TEMPORARY_REDIRECT)
+ {
ngx_http_clear_location(r);
r->headers_out.location = ngx_list_push(&r->headers_out.headers);
@@ -2642,6 +2639,56 @@
}
+ngx_int_t
+ngx_http_set_disable_symlinks(ngx_http_request_t *r,
+ ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of)
+{
+#if (NGX_HAVE_OPENAT)
+ u_char *p;
+ ngx_str_t from;
+
+ of->disable_symlinks = clcf->disable_symlinks;
+
+ if (clcf->disable_symlinks_from == NULL) {
+ return NGX_OK;
+ }
+
+ if (ngx_http_complex_value(r, clcf->disable_symlinks_from, &from)
+ != NGX_OK)
+ {
+ return NGX_ERROR;
+ }
+
+ if (from.len == 0
+ || from.len > path->len
+ || ngx_memcmp(path->data, from.data, from.len) != 0)
+ {
+ return NGX_OK;
+ }
+
+ if (from.len == path->len) {
+ of->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF;
+ return NGX_OK;
+ }
+
+ p = path->data + from.len;
+
+ if (*p == '/') {
+ of->disable_symlinks_from = from.len;
+ return NGX_OK;
+ }
+
+ p--;
+
+ if (*p == '/') {
+ of->disable_symlinks_from = from.len - 1;
+ }
+#endif
+
+ return NGX_OK;
+}
+
+
static char *
ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
{
@@ -3372,6 +3419,7 @@
#if (NGX_HAVE_OPENAT)
clcf->disable_symlinks = NGX_CONF_UNSET_UINT;
+ clcf->disable_symlinks_from = NGX_CONF_UNSET_PTR;
#endif
return clcf;
@@ -3656,6 +3704,8 @@
#if (NGX_HAVE_OPENAT)
ngx_conf_merge_uint_value(conf->disable_symlinks, prev->disable_symlinks,
NGX_DISABLE_SYMLINKS_OFF);
+ ngx_conf_merge_ptr_value(conf->disable_symlinks_from,
+ prev->disable_symlinks_from, NULL);
#endif
return NGX_CONF_OK;
@@ -3920,7 +3970,7 @@
}
}
- if (lsopt.tcp_keepidle == 0 && lsopt.tcp_keepintvl == 0
+ if (lsopt.tcp_keepidle == 0 && lsopt.tcp_keepintvl == 0
&& lsopt.tcp_keepcnt == 0)
{
goto invalid_so_keepalive;
@@ -4579,7 +4629,7 @@
if (max == 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"open_file_cache\" must have the \"max\" parameter");
+ "\"open_file_cache\" must have the \"max\" parameter");
return NGX_CONF_ERROR;
}
@@ -4789,6 +4839,100 @@
}
#endif
+
+
+#if (NGX_HAVE_OPENAT)
+
+static char *
+ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_http_core_loc_conf_t *clcf = conf;
+
+ ngx_str_t *value;
+ ngx_uint_t i;
+ ngx_http_compile_complex_value_t ccv;
+
+ if (clcf->disable_symlinks != NGX_CONF_UNSET_UINT) {
+ return "is duplicate";
+ }
+
+ value = cf->args->elts;
+
+ for (i = 1; i < cf->args->nelts; i++) {
+
+ if (ngx_strcmp(value[i].data, "off") == 0) {
+ clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF;
+ continue;
+ }
+
+ if (ngx_strcmp(value[i].data, "if_not_owner") == 0) {
+ clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_NOTOWNER;
+ continue;
+ }
+
+ if (ngx_strcmp(value[i].data, "on") == 0) {
+ clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_ON;
+ continue;
+ }
+
+ if (ngx_strncmp(value[i].data, "from=", 5) == 0) {
+ value[i].len -= 5;
+ value[i].data += 5;
+
+ ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
+
+ ccv.cf = cf;
+ ccv.value = &value[i];
+ ccv.complex_value = ngx_palloc(cf->pool,
+ sizeof(ngx_http_complex_value_t));
+ if (ccv.complex_value == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
+
+ clcf->disable_symlinks_from = ccv.complex_value;
+
+ continue;
+ }
+
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "invalid parameter \"%V\"", &value[i]);
+ return NGX_CONF_ERROR;
+ }
+
+ if (clcf->disable_symlinks == NGX_CONF_UNSET_UINT) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "\"%V\" must have \"off\", \"on\" "
+ "or \"if_not_owner\" parameter",
+ &cmd->name);
+ return NGX_CONF_ERROR;
+ }
+
+ if (cf->args->nelts == 2) {
+ clcf->disable_symlinks_from = NULL;
+ return NGX_CONF_OK;
+ }
+
+ if (clcf->disable_symlinks_from == NGX_CONF_UNSET_PTR) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "duplicate parameters \"%V %V\"",
+ &value[1], &value[2]);
+ return NGX_CONF_ERROR;
+ }
+
+ if (clcf->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "\"from=\" cannot be used with \"off\" parameter");
+ return NGX_CONF_ERROR;
+ }
+
+ return NGX_CONF_OK;
+}
+
+#endif
static char *
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_core_module.h
^
|
@@ -406,6 +406,7 @@
#if (NGX_HAVE_OPENAT)
ngx_uint_t disable_symlinks; /* disable_symlinks */
+ ngx_http_complex_value_t *disable_symlinks_from;
#endif
ngx_array_t *error_pages; /* error_page */
@@ -509,6 +510,10 @@
ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *chain);
+ngx_int_t ngx_http_set_disable_symlinks(ngx_http_request_t *r,
+ ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of);
+
+
extern ngx_module_t ngx_http_core_module;
extern ngx_uint_t ngx_http_max_module;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_file_cache.c
^
|
@@ -799,21 +799,16 @@
/* node_key == node->key */
- do {
- fcn = (ngx_http_file_cache_node_t *) node;
+ fcn = (ngx_http_file_cache_node_t *) node;
- rc = ngx_memcmp(&key[sizeof(ngx_rbtree_key_t)], fcn->key,
- NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));
+ rc = ngx_memcmp(&key[sizeof(ngx_rbtree_key_t)], fcn->key,
+ NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));
- if (rc == 0) {
- return fcn;
- }
+ if (rc == 0) {
+ return fcn;
+ }
- node = (rc < 0) ? node->left : node->right;
-
- } while (node != sentinel && node_key == node->key);
-
- break;
+ node = (rc < 0) ? node->left : node->right;
}
/* not found */
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_parse.c
^
|
@@ -874,6 +874,10 @@
break;
}
+ if (ch == '\0') {
+ return NGX_HTTP_PARSE_INVALID_HEADER;
+ }
+
r->invalid_header = 1;
break;
@@ -936,6 +940,10 @@
break;
}
+ if (ch == '\0') {
+ return NGX_HTTP_PARSE_INVALID_HEADER;
+ }
+
r->invalid_header = 1;
break;
@@ -954,6 +962,8 @@
r->header_start = p;
r->header_end = p;
goto done;
+ case '\0':
+ return NGX_HTTP_PARSE_INVALID_HEADER;
default:
r->header_start = p;
state = sw_value;
@@ -975,6 +985,8 @@
case LF:
r->header_end = p;
goto done;
+ case '\0':
+ return NGX_HTTP_PARSE_INVALID_HEADER;
}
break;
@@ -988,6 +1000,8 @@
break;
case LF:
goto done;
+ case '\0':
+ return NGX_HTTP_PARSE_INVALID_HEADER;
default:
state = sw_value;
break;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_parse_time.c
^
|
@@ -242,7 +242,7 @@
year -= 1;
}
- /* Gauss' formula for Grigorian days since March 1, 1 BC */
+ /* Gauss' formula for Gregorian days since March 1, 1 BC */
time = (uint64_t) (
/* days in years including leap years since March 1, 1 BC */
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_request.h
^
|
@@ -10,7 +10,7 @@
#define NGX_HTTP_MAX_URI_CHANGES 10
-#define NGX_HTTP_MAX_SUBREQUESTS 50
+#define NGX_HTTP_MAX_SUBREQUESTS 200
/* must be 2^n */
#define NGX_HTTP_LC_HEADER_LEN 32
@@ -75,6 +75,7 @@
#define NGX_HTTP_MOVED_TEMPORARILY 302
#define NGX_HTTP_SEE_OTHER 303
#define NGX_HTTP_NOT_MODIFIED 304
+#define NGX_HTTP_TEMPORARY_REDIRECT 307
#define NGX_HTTP_BAD_REQUEST 400
#define NGX_HTTP_UNAUTHORIZED 401
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_script.c
^
|
@@ -1505,9 +1505,12 @@
of.test_only = 1;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
-#if (NGX_HAVE_OPENAT)
- of.disable_symlinks = clcf->disable_symlinks;
-#endif
+
+ if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
+ e->ip = ngx_http_script_exit;
+ e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return;
+ }
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_special_response.c
^
|
@@ -74,6 +74,14 @@
;
+static char ngx_http_error_307_page[] =
+"<html>" CRLF
+"<head><title>307 Temporary Redirect</title></head>" CRLF
+"<body bgcolor=\"white\">" CRLF
+"<center><h1>307 Temporary Redirect</h1></center>" CRLF
+;
+
+
static char ngx_http_error_400_page[] =
"<html>" CRLF
"<head><title>400 Bad Request</title></head>" CRLF
@@ -294,16 +302,20 @@
ngx_null_string, /* 201, 204 */
-#define NGX_HTTP_LAST_LEVEL_200 202
-#define NGX_HTTP_LEVEL_200 (NGX_HTTP_LAST_LEVEL_200 - 201)
+#define NGX_HTTP_LAST_2XX 202
+#define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 201)
/* ngx_null_string, */ /* 300 */
ngx_string(ngx_http_error_301_page),
ngx_string(ngx_http_error_302_page),
ngx_string(ngx_http_error_303_page),
+ ngx_null_string, /* 304 */
+ ngx_null_string, /* 305 */
+ ngx_null_string, /* 306 */
+ ngx_string(ngx_http_error_307_page),
-#define NGX_HTTP_LAST_LEVEL_300 304
-#define NGX_HTTP_LEVEL_300 (NGX_HTTP_LAST_LEVEL_300 - 301)
+#define NGX_HTTP_LAST_3XX 308
+#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
ngx_string(ngx_http_error_400_page),
ngx_string(ngx_http_error_401_page),
@@ -323,8 +335,8 @@
ngx_string(ngx_http_error_415_page),
ngx_string(ngx_http_error_416_page),
-#define NGX_HTTP_LAST_LEVEL_400 417
-#define NGX_HTTP_LEVEL_400 (NGX_HTTP_LAST_LEVEL_400 - 400)
+#define NGX_HTTP_LAST_4XX 417
+#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX)
ngx_string(ngx_http_error_494_page), /* 494, request header too large */
ngx_string(ngx_http_error_495_page), /* 495, https certificate error */
@@ -342,7 +354,7 @@
ngx_null_string, /* 506 */
ngx_string(ngx_http_error_507_page)
-#define NGX_HTTP_LAST_LEVEL_500 508
+#define NGX_HTTP_LAST_5XX 508
};
@@ -428,25 +440,22 @@
err = 0;
} else if (error >= NGX_HTTP_MOVED_PERMANENTLY
- && error < NGX_HTTP_LAST_LEVEL_300)
+ && error < NGX_HTTP_LAST_3XX)
{
/* 3XX */
- err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200;
+ err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX;
} else if (error >= NGX_HTTP_BAD_REQUEST
- && error < NGX_HTTP_LAST_LEVEL_400)
+ && error < NGX_HTTP_LAST_4XX)
{
/* 4XX */
- err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200
- + NGX_HTTP_LEVEL_300;
+ err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX;
} else if (error >= NGX_HTTP_NGINX_CODES
- && error < NGX_HTTP_LAST_LEVEL_500)
+ && error < NGX_HTTP_LAST_5XX)
{
/* 49X, 5XX */
- err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_LEVEL_200
- + NGX_HTTP_LEVEL_300
- + NGX_HTTP_LEVEL_400;
+ err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX;
switch (error) {
case NGX_HTTP_TO_HTTPS:
case NGX_HTTPS_CERT_ERROR:
@@ -570,12 +579,11 @@
return NGX_ERROR;
}
- if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY
- && overwrite <= NGX_HTTP_SEE_OTHER)
+ if (overwrite != NGX_HTTP_MOVED_PERMANENTLY
+ && overwrite != NGX_HTTP_MOVED_TEMPORARILY
+ && overwrite != NGX_HTTP_SEE_OTHER
+ && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)
{
- r->err_status = overwrite;
-
- } else {
r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
}
@@ -595,7 +603,7 @@
return ngx_http_send_special_response(r, clcf, r->err_status
- NGX_HTTP_MOVED_PERMANENTLY
- + NGX_HTTP_LEVEL_200);
+ + NGX_HTTP_OFF_3XX);
}
@@ -626,7 +634,7 @@
if (clcf->msie_padding
&& (r->headers_in.msie || r->headers_in.chrome)
&& r->http_version >= NGX_HTTP_VERSION_10
- && err >= NGX_HTTP_LEVEL_300)
+ && err >= NGX_HTTP_OFF_4XX)
{
r->headers_out.content_length_n +=
sizeof(ngx_http_msie_padding) - 1;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/http/ngx_http_upstream.c
^
|
@@ -2293,7 +2293,7 @@
}
if (ngx_event_flags & NGX_USE_AIO_EVENT) {
- /* the posted aio operation may currupt a shadow buffer */
+ /* the posted aio operation may corrupt a shadow buffer */
p->single_buf = 1;
}
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/mail/ngx_mail_core_module.c
^
|
@@ -26,7 +26,7 @@
static ngx_conf_deprecated_t ngx_conf_deprecated_so_keepalive = {
- ngx_conf_deprecated, "so_keepalive",
+ ngx_conf_deprecated, "so_keepalive",
"so_keepalive\" parameter of the \"listen"
};
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/mail/ngx_mail_pop3_handler.c
^
|
@@ -218,7 +218,7 @@
break;
- /* suppress warinings */
+ /* suppress warnings */
case ngx_pop3_passwd:
break;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_darwin_sendfile_chain.c
^
|
@@ -173,7 +173,7 @@
if (file && header.nelts == 0) {
- /* create the tailer iovec and coalesce the neighbouring bufs */
+ /* create the trailer iovec and coalesce the neighbouring bufs */
prev = NULL;
iov = NULL;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_files.h
^
|
@@ -78,8 +78,25 @@
#if (NGX_HAVE_OPENAT)
#define NGX_FILE_NOFOLLOW O_NOFOLLOW
+
+#if defined(O_DIRECTORY)
+#define NGX_FILE_DIRECTORY O_DIRECTORY
+#else
+#define NGX_FILE_DIRECTORY 0
#endif
+#if defined(O_SEARCH)
+#define NGX_FILE_SEARCH O_SEARCH|NGX_FILE_DIRECTORY
+
+#elif defined(O_EXEC)
+#define NGX_FILE_SEARCH O_EXEC|NGX_FILE_DIRECTORY
+
+#else
+#define NGX_FILE_SEARCH O_RDONLY|NGX_FILE_DIRECTORY
+#endif
+
+#endif /* NGX_HAVE_OPENAT */
+
#define NGX_FILE_DEFAULT_ACCESS 0644
#define NGX_FILE_OWNER_ACCESS 0600
@@ -163,7 +180,7 @@
#define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR)
#define ngx_file_access(sb) ((sb)->st_mode & 0777)
#define ngx_file_size(sb) (sb)->st_size
-#define ngx_file_fs_size(sb) ((sb)->st_blocks * 512)
+#define ngx_file_fs_size(sb) ngx_max((sb)->st_size, (sb)->st_blocks * 512)
#define ngx_file_mtime(sb) (sb)->st_mtime
#define ngx_file_uniq(sb) (sb)->st_ino
@@ -259,7 +276,8 @@
#define ngx_de_access(dir) (((dir)->info.st_mode) & 0777)
#define ngx_de_size(dir) (dir)->info.st_size
-#define ngx_de_fs_size(dir) ((dir)->info.st_blocks * 512)
+#define ngx_de_fs_size(dir) \
+ ngx_max((dir)->info.st_size, (dir)->info.st_blocks * 512)
#define ngx_de_mtime(dir) (dir)->info.st_mtime
@@ -340,6 +358,8 @@
#define ngx_file_at_info_n "fstatat()"
+#define NGX_AT_FDCWD (ngx_fd_t) AT_FDCWD
+
#endif
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_freebsd_sendfile_chain.c
^
|
@@ -178,7 +178,7 @@
if (file) {
- /* create the tailer iovec and coalesce the neighbouring bufs */
+ /* create the trailer iovec and coalesce the neighbouring bufs */
prev = NULL;
iov = NULL;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_process.c
^
|
@@ -544,7 +544,7 @@
static void
ngx_unlock_mutexes(ngx_pid_t pid)
-{
+{
ngx_uint_t i;
ngx_shm_zone_t *shm_zone;
ngx_list_part_t *part;
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_process_cycle.c
^
|
@@ -250,6 +250,10 @@
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_JUST_RESPAWN);
ngx_start_cache_manager_processes(cycle, 1);
+
+ /* allow new processes to start */
+ ngx_msleep(100);
+
live = 1;
ngx_signal_worker_processes(cycle,
ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
|
[-]
[+]
|
Changed |
nginx-1.1.17.tar.bz2/src/os/unix/ngx_user.c
^
|
@@ -67,7 +67,7 @@
#if (NGX_THREADS && NGX_NONREENTRANT_CRYPT)
- /* crypt() is a time consuming funtion, so we only try to lock */
+ /* crypt() is a time consuming function, so we only try to lock */
if (ngx_mutex_trylock(ngx_crypt_mutex) != NGX_OK) {
return NGX_AGAIN;
|