Skip to content

Commit

Permalink
Changes with nginx 1.1.13 16 Jan 2012
Browse files Browse the repository at this point in the history
*) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
"ssl_protocols" directive.

*) Bugfix: the "limit_req" directive parameters were not inherited
correctly; the bug had appeared in 1.1.12.

*) Bugfix: the "proxy_redirect" directive incorrectly processed
"Refresh" header if regular expression were used.

*) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter
did not return answer from cache if there were no live upstreams.

*) Bugfix: the "worker_cpu_affinity" directive might not work.

*) Bugfix: nginx could not be built on Solaris; the bug had appeared in
1.1.12.

*) Bugfix: in the ngx_http_mp4_module.

Maxim Dounin

_______________________________________________
nginx-announce mailing list
nginx-announce@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-announce
  • Loading branch information
igorsysoev authored and kolbyjack committed Jan 16, 2012
1 parent 0096256 commit b618026
Show file tree
Hide file tree
Showing 20 changed files with 174 additions and 79 deletions.
26 changes: 24 additions & 2 deletions CHANGES
@@ -1,8 +1,30 @@

Changes with nginx 1.1.13 16 Jan 2012

*) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
"ssl_protocols" directive.

*) Bugfix: the "limit_req" directive parameters were not inherited
correctly; the bug had appeared in 1.1.12.

*) Bugfix: the "proxy_redirect" directive incorrectly processed
"Refresh" header if regular expression were used.

*) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter
did not return answer from cache if there were no live upstreams.

*) Bugfix: the "worker_cpu_affinity" directive might not work.

*) Bugfix: nginx could not be built on Solaris; the bug had appeared in
1.1.12.

*) Bugfix: in the ngx_http_mp4_module.


Changes with nginx 1.1.12 26 Dec 2011

*) Change: a "proxy_pass" directive without URI part now uses changed
URI after redirection with the "error_page" directive;
URI after redirection with the "error_page" directive.
Thanks to Lanshun Zhou.

*) Feature: the "proxy/fastcgi/scgi/uwsgi_cache_lock",
Expand All @@ -28,7 +50,7 @@ Changes with nginx 1.1.12 26 Dec 2011
original request URI if variables were used.

*) Bugfix: a "proxy_pass" directive without URI part might use original
request after redirection with the "try_files" directive;
request after redirection with the "try_files" directive.
Thanks to Lanshun Zhou.

*) Bugfix: in the ngx_http_scgi_module.
Expand Down
26 changes: 24 additions & 2 deletions CHANGES.ru
@@ -1,9 +1,31 @@

Изменения в nginx 1.1.13 16.01.2012

*) Добавление: параметры TLSv1.1 и TLSv1.2 в директиве ssl_protocols.

*) Исправление: параметры директивы limit_req наследовались некорректно;
ошибка появилась в 1.1.12.

*) Исправление: директива proxy_redirect некорректно обрабатывала
заголовк Refresh при использовании регулярных выражений.

*) Исправление: директива proxy_cache_use_stale с параметром error не
возвращала ответ из кэша, если все бекенды были признаны
неработающими.

*) Исправление: директива worker_cpu_affinity могла не работать.

*) Исправление: nginx не собирался на Solaris; ошибка появилась в
1.1.12.

*) Исправление: в модуле ngx_http_mp4_module.


Изменения в nginx 1.1.12 26.12.2011

*) Изменение: после перенаправления запроса с помощью директивы
error_page директива proxy_pass без URI теперь использует изменённый
URI;
URI.
Спасибо Lanshun Zhou.

*) Добавление: директивы proxy/fastcgi/scgi/uwsgi_cache_lock,
Expand All @@ -30,7 +52,7 @@

*) Исправление: после перенаправления запроса с помощью директивы
try_files директива proxy_pass без URI могла использовать URI
исходного запроса;
исходного запроса.
Спасибо Lanshun Zhou.

*) Исправление: в модуле ngx_http_scgi_module.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2011 Igor Sysoev
* Copyright (C) 2002-2012 Igor Sysoev
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down
33 changes: 4 additions & 29 deletions auto/cc/icc
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) Igor Sysoev


# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1

NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
| sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
Expand All @@ -15,32 +15,7 @@ have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
# optimizations

CFLAGS="$CFLAGS -O"
# inline the functions declared with __inline
#CFLAGS="$CFLAGS -Ob1"
# inline any function, at the compiler's discretion
CFLAGS="$CFLAGS -Ob2"

# multi-file IP optimizations
case "$NGX_ICC_VER" in
9.*)
IPO="-ipo"
;;

# 8.1.38 under FreeBSD can not link -ipo
8.1)
IPO="-ip"
;;

*)
IPO="-ipo -ipo_obj"
;;
esac

# single-file IP optimizations
#IPO="-ip"

CFLAGS="$CFLAGS $IPO"
CORE_LINK="$CORE_LINK $IPO"
CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"


Expand All @@ -64,15 +39,15 @@ esac
CFLAGS="$CFLAGS $CPU_OPT"

if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O $IPO $CPU_OPT"
PCRE_OPT="-O $CPU_OPT"
fi

if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O $IPO $CPU_OPT"
MD5_OPT="-O $CPU_OPT"
fi

if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O $IPO $CPU_OPT"
ZLIB_OPT="-O $CPU_OPT"
fi


Expand Down
2 changes: 1 addition & 1 deletion auto/lib/pcre/conf
Expand Up @@ -165,7 +165,7 @@ else
PCRE=YES
fi

if [ $PCRE == YES ]; then
if [ $PCRE = YES ]; then
ngx_feature="PCRE JIT support"
ngx_feature_name="NGX_HAVE_PCRE_JIT"
ngx_feature_test="int jit = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/core/nginx.h
Expand Up @@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_


#define nginx_version 1001011
#define NGINX_VERSION "1.1.12"
#define nginx_version 1001013
#define NGINX_VERSION "1.1.13"
#define NGINX_VER "nginx/" NGINX_VERSION

#define NGINX_VAR "NGINX"
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_hash.c
Expand Up @@ -277,7 +277,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
start = nelts / (bucket_size / (2 * sizeof(void *)));
start = start ? start : 1;

if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) {
if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) {
start = hinit->max_size - 1000;
}

Expand Down
41 changes: 32 additions & 9 deletions src/core/ngx_log.h
Expand Up @@ -121,15 +121,38 @@ void ngx_cdecl ngx_log_debug_core(ngx_log_t *log, ngx_err_t err,

#if (NGX_HAVE_VARIADIC_MACROS)

#define ngx_log_debug0 ngx_log_debug
#define ngx_log_debug1 ngx_log_debug
#define ngx_log_debug2 ngx_log_debug
#define ngx_log_debug3 ngx_log_debug
#define ngx_log_debug4 ngx_log_debug
#define ngx_log_debug5 ngx_log_debug
#define ngx_log_debug6 ngx_log_debug
#define ngx_log_debug7 ngx_log_debug
#define ngx_log_debug8 ngx_log_debug
#define ngx_log_debug0(level, log, err, fmt) \
ngx_log_debug(level, log, err, fmt)

#define ngx_log_debug1(level, log, err, fmt, arg1) \
ngx_log_debug(level, log, err, fmt, arg1)

#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
ngx_log_debug(level, log, err, fmt, arg1, arg2)

#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3)

#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4)

#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
ngx_log_debug(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5)

#define ngx_log_debug6(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6) \
ngx_log_debug(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6)

#define ngx_log_debug7(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
ngx_log_debug(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7)

#define ngx_log_debug8(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
ngx_log_debug(level, log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)


#else /* NO VARIADIC MACROS */
Expand Down
32 changes: 18 additions & 14 deletions src/event/ngx_event_openssl.c
Expand Up @@ -78,18 +78,6 @@ ngx_module_t ngx_openssl_module = {
};


static long ngx_ssl_protocols[] = {
SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1,
SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1,
SSL_OP_NO_SSLv2|SSL_OP_NO_TLSv1,
SSL_OP_NO_TLSv1,
SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3,
SSL_OP_NO_SSLv3,
SSL_OP_NO_SSLv2,
0,
};


int ngx_ssl_connection_index;
int ngx_ssl_server_conf_index;
int ngx_ssl_session_cache_index;
Expand Down Expand Up @@ -171,9 +159,25 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)

SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_DH_USE);

if (ngx_ssl_protocols[protocols >> 1] != 0) {
SSL_CTX_set_options(ssl->ctx, ngx_ssl_protocols[protocols >> 1]);
if (!(protocols & NGX_SSL_SSLv2)) {
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv2);
}
if (!(protocols & NGX_SSL_SSLv3)) {
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv3);
}
if (!(protocols & NGX_SSL_TLSv1)) {
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1);
}
#ifdef SSL_OP_NO_TLSv1_1
if (!(protocols & NGX_SSL_TLSv1_1)) {
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_1);
}
#endif
#ifdef SSL_OP_NO_TLSv1_2
if (!(protocols & NGX_SSL_TLSv1_2)) {
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_2);
}
#endif

#ifdef SSL_OP_NO_COMPRESSION
SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_COMPRESSION);
Expand Down
8 changes: 5 additions & 3 deletions src/event/ngx_event_openssl.h
Expand Up @@ -81,9 +81,11 @@ typedef struct {



#define NGX_SSL_SSLv2 2
#define NGX_SSL_SSLv3 4
#define NGX_SSL_TLSv1 8
#define NGX_SSL_SSLv2 0x0002
#define NGX_SSL_SSLv3 0x0004
#define NGX_SSL_TLSv1 0x0008
#define NGX_SSL_TLSv1_1 0x0010
#define NGX_SSL_TLSv1_2 0x0020


#define NGX_SSL_BUFFER 1
Expand Down
4 changes: 4 additions & 0 deletions src/http/modules/ngx_http_fastcgi_module.c
Expand Up @@ -2314,6 +2314,10 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
|NGX_HTTP_UPSTREAM_FT_OFF;
}

if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
}

if (conf->upstream.cache_methods == 0) {
conf->upstream.cache_methods = prev->upstream.cache_methods;
}
Expand Down
2 changes: 2 additions & 0 deletions src/http/modules/ngx_http_limit_req_module.c
Expand Up @@ -570,6 +570,8 @@ ngx_http_limit_req_merge_conf(ngx_conf_t *cf, void *parent, void *child)

if (conf->shm_zone == NULL) {
conf->shm_zone = prev->shm_zone;
conf->burst = prev->burst;
conf->nodelay = prev->nodelay;
}

ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level,
Expand Down
8 changes: 4 additions & 4 deletions src/http/modules/ngx_http_mp4_module.c
Expand Up @@ -165,10 +165,10 @@ typedef struct {
((u_char *) (p))[7] = n4

#define ngx_mp4_get_32value(p) \
( (((u_char *) (p))[0] << 24) \
+ (((u_char *) (p))[1] << 16) \
+ (((u_char *) (p))[2] << 8) \
+ (((u_char *) (p))[3]) )
( ((uint32_t) ((u_char *) (p))[0] << 24) \
+ ( ((u_char *) (p))[1] << 16) \
+ ( ((u_char *) (p))[2] << 8) \
+ ( ((u_char *) (p))[3]) )

#define ngx_mp4_set_32value(p, n) \
((u_char *) (p))[0] = (u_char) ((n) >> 24); \
Expand Down
38 changes: 31 additions & 7 deletions src/http/modules/ngx_http_proxy_module.c
Expand Up @@ -2348,6 +2348,8 @@ static ngx_int_t
ngx_http_proxy_rewrite_redirect_regex(ngx_http_request_t *r, ngx_table_elt_t *h,
size_t prefix, ngx_http_proxy_redirect_t *pr)
{
size_t len;
u_char *data;
ngx_str_t redirect, replacement;

redirect.len = h->value.len - prefix;
Expand All @@ -2361,7 +2363,23 @@ ngx_http_proxy_rewrite_redirect_regex(ngx_http_request_t *r, ngx_table_elt_t *h,
return NGX_ERROR;
}

h->value = replacement;
if (!prefix) {
h->value = replacement;
return NGX_OK;
}

len = prefix + replacement.len;

data = ngx_pnalloc(r->pool, len);
if (data == NULL) {
return NGX_ERROR;
}

ngx_memcpy(data, h->value.data, prefix);
ngx_memcpy(data + prefix, replacement.data, replacement.len);

h->value.len = len;
h->value.data = data;

return NGX_OK;
}
Expand Down Expand Up @@ -2667,17 +2685,21 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
(NGX_CONF_BITMASK_SET
|NGX_HTTP_UPSTREAM_FT_OFF));

if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
|NGX_HTTP_UPSTREAM_FT_OFF;
}

if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
}

if (conf->upstream.cache_methods == 0) {
conf->upstream.cache_methods = prev->upstream.cache_methods;
}

conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;

if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
|NGX_HTTP_UPSTREAM_FT_OFF;
}

ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
prev->upstream.cache_bypass, NULL);

Expand Down Expand Up @@ -3580,7 +3602,9 @@ ngx_http_proxy_set_ssl(ngx_conf_t *cf, ngx_http_proxy_loc_conf_t *plcf)
plcf->upstream.ssl->log = cf->log;

if (ngx_ssl_create(plcf->upstream.ssl,
NGX_SSL_SSLv2|NGX_SSL_SSLv3|NGX_SSL_TLSv1, NULL)
NGX_SSL_SSLv2|NGX_SSL_SSLv3|NGX_SSL_TLSv1
|NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2,
NULL)
!= NGX_OK)
{
return NGX_ERROR;
Expand Down

0 comments on commit b618026

Please sign in to comment.