Skip to content

Commit

Permalink
merged nginx-1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
shudu committed Mar 21, 2012
1 parent 28672dc commit 4670de6
Show file tree
Hide file tree
Showing 46 changed files with 398 additions and 288 deletions.
45 changes: 45 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@

Changes with nginx 1.0.14 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.


Changes with nginx 1.0.13 05 Mar 2012

*) 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: memory leaks.
Thanks to Lanshun Zhou.

*) Bugfix: nginx might log incorrect error "upstream prematurely closed
connection" instead of correct "upstream sent too big header" one.
Thanks to Feibo Li.

*) Bugfix: on ZFS filesystem disk cache size might be calculated
incorrectly; the bug had appeared in 1.0.1.

*) Bugfix: the number of internal redirects to named locations was not
limited.

*) Bugfix: temporary files might be not removed if the "proxy_store"
directive was used with SSI includes.

*) Bugfix: in some cases non-cacheable variables (such as the $args
variable) returned old empty cached value.

*) Bugfix: the "proxy_redirect" directives might be inherited
incorrectly.

*) Bugfix: nginx could not be built with the ngx_http_perl_module if the
--with-openssl option was used.

*) Bugfix: nginx could not be built by the icc 12.1 compiler.


Changes with nginx 1.0.12 06 Feb 2012

*) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
Expand Down
45 changes: 45 additions & 0 deletions CHANGES.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@

Изменения в nginx 1.0.14 15.03.2012

*) Безопасность: содержимое ранее освобождённой памяти могло быть
отправлено клиенту, если бэкенд возвращал специально созданный ответ.
Спасибо Matthew Daley.


Изменения в nginx 1.0.13 05.03.2012

*) Добавление: директивы return и error_page теперь могут использоваться
для возврата перенаправлений с кодом 307.

*) Исправление: в рабочем процессе мог произойти segmentation fault,
если использовалась директива resolver и на глобальном уровне не была
задана директива error_log.
Спасибо Роману Арутюняну.

*) Исправление: утечек памяти.
Спасибо Lanshun Zhou.

*) Исправление: nginx мог некорректно сообщать об ошибке "upstream
prematurely closed connection" вместо "upstream sent too big header".
Спасибо Feibo Li.

*) Исправление: при использовании ZFS размер кэша на диске мог считаться
некорректно; ошибка появилась в 1.0.1.

*) Исправление: количество внутренних перенаправлений в именованные
location'ы не ограничивалось.
*) Исправление: при использовании директивы proxy_store с
SSI-подзапросами временные файлы могли не удаляться.
*) Исправление: в некоторых случаях некэшируемые переменные (такие, как
$args) возвращали старое пустое закэшированное значение.
*) Исправление: директивы proxy_redirect могли наследоваться
некорректно.
*) Исправление: nginx не собирался с модулем ngx_http_perl_module, если
использовался параметр --with-openssl.
*) Исправление: nginx не собирался компилятором icc 12.1.
Изменения в nginx 1.0.12 06.02.2012
*) Добавление: параметры TLSv1.1 и TLSv1.2 в директиве ssl_protocols.
Expand Down
10 changes: 5 additions & 5 deletions auto/cc/name
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ if [ "$CC" = bcc32 ]; then
NGX_CC_NAME=bcc
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
Expand Down
1 change: 1 addition & 0 deletions auto/lib/perl/make
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ $NGX_OBJS/src/http/modules/perl/Makefile: \
&& NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \
NGX_PCRE=$PCRE \
NGX_OBJS=$NGX_OBJS \
NGX_OPENSSL=$OPENSSL \
$NGX_PERL Makefile.PL \
LIB=$NGX_PERL_MODULES \
INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN
Expand Down
10 changes: 10 additions & 0 deletions auto/unix
Original file line number Diff line number Diff line change
Expand Up @@ -758,3 +758,13 @@ ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
. auto/feature


ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
. auto/feature
4 changes: 2 additions & 2 deletions src/core/nginx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_


#define nginx_version 1000012
#define NGINX_VERSION "1.0.12"
#define nginx_version 1000014
#define NGINX_VERSION "1.0.14"
#define NGINX_VER "nginx/" NGINX_VERSION

#define tengine_version 1002004
Expand Down
17 changes: 6 additions & 11 deletions src/core/ngx_open_file_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,20 +837,15 @@ ngx_open_file_lookup(ngx_open_file_cache_t *cache, ngx_str_t *name,

/* 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;
Expand Down
28 changes: 12 additions & 16 deletions src/core/ngx_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_addr_t *addr)
uc->sockaddr = addr->sockaddr;
uc->socklen = addr->socklen;
uc->server = addr->name;

uc->log = cf->cycle->new_log;
uc->log.handler = ngx_resolver_log_error;
uc->log.data = uc;
uc->log.action = "resolving";
}

return r;
Expand Down Expand Up @@ -830,6 +825,12 @@ ngx_resolver_send_query(ngx_resolver_t *r, ngx_resolver_node_t *rn)
uc = r->udp_connection;

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;
}
Expand Down Expand Up @@ -1625,20 +1626,15 @@ ngx_resolver_lookup_name(ngx_resolver_t *r, ngx_str_t *name, uint32_t hash)

/* hash == node->key */

do {
rn = (ngx_resolver_node_t *) node;

rc = ngx_memn2cmp(name->data, rn->name, name->len, rn->nlen);
rn = (ngx_resolver_node_t *) node;

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 */
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_times.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ ngx_gmtime(time_t t, ngx_tm_t *tp)

days = n / 86400;

/* Jaunary 1, 1970 was Thursday */
/* January 1, 1970 was Thursday */

wday = (4 + days) % 7;

Expand Down
2 changes: 1 addition & 1 deletion src/event/ngx_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct ngx_event_s {
#endif

#if (NGX_WIN32)
/* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was succesfull */
/* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was successful */
unsigned accept_context_updated:1;
#endif

Expand Down
74 changes: 32 additions & 42 deletions src/event/ngx_event_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
case NGX_ERROR:
c->read->error = 1;

/* fall thruogh */
/* fall through */

case NGX_AGAIN:
return c->ssl->last;
Expand Down Expand Up @@ -1847,44 +1847,39 @@ ngx_ssl_get_cached_session(ngx_ssl_conn_t *ssl_conn, u_char *id, int len,

/* 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);

return sess;
}

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);
ngx_slab_free_locked(shpool, sess_id);

sess = NULL;
sess = NULL;

goto done;
}

node = (rc < 0) ? node->left : node->right;

} while (node != sentinel && hash == node->key);
goto done;
}

break;
node = (rc < 0) ? node->left : node->right;
}

done:
Expand Down Expand Up @@ -1954,31 +1949,26 @@ ngx_ssl_remove_session(SSL_CTX *ssl, ngx_ssl_session_t *sess)

/* 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;
}
ngx_slab_free_locked(shpool, sess_id);

node = (rc < 0) ? node->left : node->right;

} while (node != sentinel && hash == node->key);
goto done;
}

break;
node = (rc < 0) ? node->left : node->right;
}

done:
Expand Down
2 changes: 1 addition & 1 deletion src/event/ngx_event_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b)
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;
Expand Down
4 changes: 2 additions & 2 deletions src/http/modules/ngx_http_autoindex_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ static ngx_http_module_t ngx_http_autoindex_module_ctx = {
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 */
};


Expand Down
Loading

0 comments on commit 4670de6

Please sign in to comment.