Skip to content

Commit

Permalink
Changes with nginx 1.5.5 17 Sep 2013
Browse files Browse the repository at this point in the history
*) Change: now nginx assumes HTTP/1.0 by default if it is not able to
detect protocol reliably.

*) Feature: the "disable_symlinks" directive now uses O_PATH on Linux.

*) Feature: now nginx uses EPOLLRDHUP events to detect premature
connection close by clients if the "epoll" method is used.

*) Bugfix: in the "valid_referers" directive if the "server_names"
parameter was used.

*) Bugfix: the $request_time variable did not work in nginx/Windows.

*) Bugfix: in the "image_filter" directive.
Thanks to Lanshun Zhou.

*) Bugfix: OpenSSL 1.0.1f compatibility.
Thanks to Piotr Sikora.
  • Loading branch information
nginx authored and kolbyjack committed Sep 17, 2013
1 parent b4f0587 commit c6e358d
Show file tree
Hide file tree
Showing 49 changed files with 553 additions and 160 deletions.
22 changes: 22 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@

Changes with nginx 1.5.5 17 Sep 2013

*) Change: now nginx assumes HTTP/1.0 by default if it is not able to
detect protocol reliably.

*) Feature: the "disable_symlinks" directive now uses O_PATH on Linux.

*) Feature: now nginx uses EPOLLRDHUP events to detect premature
connection close by clients if the "epoll" method is used.

*) Bugfix: in the "valid_referers" directive if the "server_names"
parameter was used.

*) Bugfix: the $request_time variable did not work in nginx/Windows.

*) Bugfix: in the "image_filter" directive.
Thanks to Lanshun Zhou.

*) Bugfix: OpenSSL 1.0.1f compatibility.
Thanks to Piotr Sikora.


Changes with nginx 1.5.4 27 Aug 2013

*) Change: the "js" extension MIME type has been changed to
Expand Down
23 changes: 23 additions & 0 deletions CHANGES.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@

Изменения в nginx 1.5.5 17.09.2013

*) Изменение: теперь nginx по умолчанию использует HTTP/1.0, если точно
определить протокол не удалось.

*) Добавление: директива disable_symlinks теперь использует O_PATH на
Linux.

*) Добавление: для определения того, что клиент закрыл соединение, при
использовании метода epoll теперь используются события EPOLLRDHUP.

*) Исправление: в директиве valid_referers при использовании параметра
server_names.

*) Исправление: переменная $request_time не работала в nginx/Windows.

*) Исправление: в директиве image_filter.
Спасибо Lanshun Zhou.

*) Исправление: совместимость с OpenSSL 1.0.1f.
Спасибо Piotr Sikora.


Изменения в nginx 1.5.4 27.08.2013

*) Изменение: MIME-тип для расширения js изменён на
Expand Down
23 changes: 23 additions & 0 deletions auto/cc/conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ if test -n "$CFLAGS"; then
ngx_include_opt="-I"
;;

sunc)

case "$NGX_MACHINE" in

i86pc)
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
;;

sun4u | sun4v)
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
;;

esac

case $CPU in

amd64)
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
;;

esac
;;

esac

else
Expand Down
8 changes: 4 additions & 4 deletions auto/cc/owc
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have


# the precompiled headers
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
NGX_PCH="$NGX_OBJS/ngx_config.pch"
NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
#NGX_PCH="$NGX_OBJS/ngx_config.pch"
#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"


# the link flags, built target is NT GUI mode application
Expand Down
4 changes: 4 additions & 0 deletions auto/lib/openssl/conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ if [ $OPENSSL != NONE ]; then
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"

if [ "$NGX_PLATFORM" = win32 ]; then
CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
fi
;;
esac

Expand Down
5 changes: 5 additions & 0 deletions auto/lib/pcre/conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ if [ $PCRE != NONE ]; then

*)
have=NGX_PCRE . auto/have

if [ "$NGX_PLATFORM" = win32 ]; then
have=PCRE_STATIC . auto/have
fi

CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
Expand Down
19 changes: 9 additions & 10 deletions auto/lib/pcre/make
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ case "$NGX_CC_NAME" in
ngx_pcre=`echo \-DPCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"`
;;

esac
*)
ngx_makefile=
;;

esac

case "$NGX_PLATFORM" in

win32)
if [ -n "$ngx_makefile" ]; then

cat << END >> $NGX_MAKEFILE
cat << END >> $NGX_MAKEFILE

`echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
Expand All @@ -41,10 +43,9 @@ case "$NGX_PLATFORM" in

END

;;
else

*)
cat << END >> $NGX_MAKEFILE
cat << END >> $NGX_MAKEFILE

$PCRE/pcre.h: $PCRE/Makefile

Expand All @@ -60,6 +61,4 @@ $PCRE/.libs/libpcre.a: $PCRE/Makefile

END

;;

esac
fi
4 changes: 2 additions & 2 deletions auto/lib/pcre/makefile.bcc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pcre.lib:

bcc32 -c $(CFLAGS) -I. $(PCREFLAGS) pcre_*.c

> pcre.lst
for %n in (*.obj) do @echo +%n & >> pcre.lst
copy /y nul pcre.lst
for %n in (*.obj) do @echo +%n ^^& >> pcre.lst
echo + >> pcre.lst

tlib pcre.lib @pcre.lst
Expand Down
2 changes: 1 addition & 1 deletion auto/lib/pcre/makefile.owc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 &
-DSUPPORT_PCRE8 -DHAVE_MEMMOVE


Expand Down
23 changes: 22 additions & 1 deletion auto/lib/zlib/make
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ case "$NGX_CC_NAME" in
ngx_zlib=`echo \-DZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
;;

*)
ngx_makefile=
;;

esac


Expand All @@ -33,13 +37,30 @@ done=NO
case "$NGX_PLATFORM" in

win32)
cat << END >> $NGX_MAKEFILE

if [ -n "$ngx_makefile" ]; then
cat << END >> $NGX_MAKEFILE

`echo "$ZLIB/zlib.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f auto/lib/zlib/$ngx_makefile $ngx_opt $ngx_zlib

END

else

cat << END >> $NGX_MAKEFILE

$ZLIB/libz.a: $NGX_MAKEFILE
cd $ZLIB \\
&& \$(MAKE) distclean \\
&& \$(MAKE) -f win32/Makefile.gcc \\
CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
libz.a

END

fi

done=YES
;;

Expand Down
1 change: 1 addition & 0 deletions auto/modules
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fi

if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
have=NGX_HAVE_EPOLL . auto/have
have=NGX_HAVE_EPOLLRDHUP . auto/have
have=NGX_HAVE_EVENTFD . auto/have
have=NGX_TEST_BUILD_EPOLL . auto/have
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
Expand Down
32 changes: 32 additions & 0 deletions auto/os/linux
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,41 @@ if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
EVENT_FOUND=YES


# EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8

ngx_feature="EPOLLRDHUP"
ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
ngx_feature_run=no
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0, fd = 0;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
ee.data.ptr = NULL;
epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
. auto/feature
fi


# O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14

ngx_feature="O_PATH"
ngx_feature_name="NGX_HAVE_O_PATH"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int fd; struct stat sb;
fd = openat(AT_FDCWD, \".\", O_PATH|O_DIRECTORY|O_NOFOLLOW);
if (fstatat(fd, \"\", &sb, AT_EMPTY_PATH) != 0) return 1"
. auto/feature


# sendfile()

CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
Expand Down
13 changes: 12 additions & 1 deletion auto/os/win32
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@ CORE_INCS="$WIN32_INCS"
CORE_DEPS="$WIN32_DEPS"
CORE_SRCS="$WIN32_SRCS $IOCP_SRCS"
OS_CONFIG="$WIN32_CONFIG"
CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
NGX_ICONS="$NGX_WIN32_ICONS"
SELECT_SRCS=$WIN32_SELECT_SRCS

case "$NGX_CC_NAME" in

gcc)
CORE_LIBS="$CORE_LIBS -ladvapi32 -lws2_32"
;;

*)
CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
;;

esac

EVENT_MODULES="$EVENT_MODULES $IOCP_MODULE"
EVENT_FOUND=YES

Expand Down
2 changes: 1 addition & 1 deletion auto/unix
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
. auto/feature


ngx_feature="TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT"
ngx_feature="TCP_KEEPIDLE"
ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
Expand Down
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 1005004
#define NGINX_VERSION "1.5.4"
#define nginx_version 1005005
#define NGINX_VERSION "1.5.5"
#define NGINX_VER "nginx/" NGINX_VERSION

#define NGINX_VAR "NGINX"
Expand Down
6 changes: 3 additions & 3 deletions src/core/ngx_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
continue;
}

if (ls[i].fd != -1) {
if (ls[i].fd != (ngx_socket_t) -1) {
continue;
}

Expand All @@ -312,7 +312,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)

s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0);

if (s == -1) {
if (s == (ngx_socket_t) -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
ngx_socket_n " %V failed", &ls[i].addr_text);
return NGX_ERROR;
Expand Down Expand Up @@ -863,7 +863,7 @@ ngx_close_connection(ngx_connection_t *c)
ngx_uint_t log_error, level;
ngx_socket_t fd;

if (c->fd == -1) {
if (c->fd == (ngx_socket_t) -1) {
ngx_log_error(NGX_LOG_ALERT, c->log, 0, "connection already closed");
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/ngx_cycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}
}

if (nls[n].fd == -1) {
if (nls[n].fd == (ngx_socket_t) -1) {
nls[n].open = 1;
}
}
Expand Down Expand Up @@ -649,7 +649,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
ls = old_cycle->listening.elts;
for (i = 0; i < old_cycle->listening.nelts; i++) {

if (ls[i].remain || ls[i].fd == -1) {
if (ls[i].remain || ls[i].fd == (ngx_socket_t) -1) {
continue;
}

Expand Down Expand Up @@ -813,7 +813,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)

ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {
if (ls[i].fd == -1 || !ls[i].open) {
if (ls[i].fd == (ngx_socket_t) -1 || !ls[i].open) {
continue;
}

Expand Down
Loading

0 comments on commit c6e358d

Please sign in to comment.