Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff between nginx 1.11.2 on github and nginx in openresty 1.11.2.1
diff -ruN -x '*.orig' nginx-1.11.2/README openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/README
--- nginx-1.11.2/README 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/README 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,38 @@
+This is an Nginx fork that adds dtrace USDT probes.
+
+Installation:
+
+ ./configure --with-dtrace-probes \
+ --with-dtrace=/usr/sbin/dtrace \
+ ...
+ make
+ make install
+
+Usage on Linux (with systemtap):
+
+ # make the stap-nginx script visiable in your PATH
+ export PATH=/usr/local/nginx/sbin:$PATH
+
+ # list all the static probes available in your nginx
+ stap-nginx -L 'process("nginx").mark("*")'
+
+ # run the test.stp file
+ stap-nginx test.stp
+
+Sample test.stp file:
+
+ probe begin
+ {
+ print("Tracing. Hit CTRL-C to stop.\n")
+ }
+
+ probe process("nginx").mark("http-subrequest-start")
+ {
+ printf("uri: %s?%s\n", ngx_http_req_uri($arg1),
+ ngx_http_req_args($arg1))
+ }
+
+For now, only tested on Solaris 11 Express and Fedora Linux 17.
+
+The original Nginx documentation is available at http://nginx.org
+
diff -ruN -x '*.orig' nginx-1.11.2/auto/cc/clang openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/clang
--- nginx-1.11.2/auto/cc/clang 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/clang 2016-08-25 00:20:57.000000000 +0000
@@ -88,7 +88,7 @@
fi
# stop on warning
-CFLAGS="$CFLAGS -Werror"
+#CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
diff -ruN -x '*.orig' nginx-1.11.2/auto/cc/conf openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/conf
--- nginx-1.11.2/auto/cc/conf 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/conf 2016-08-25 00:20:57.000000000 +0000
@@ -144,7 +144,7 @@
CFLAGS="$CFLAGS $NGX_CC_OPT"
NGX_TEST_LD_OPT="$NGX_LD_OPT"
-if [ "$NGX_PLATFORM" != win32 ]; then
+if [ 1 ]; then
if test -n "$NGX_LD_OPT"; then
ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
diff -ruN -x '*.orig' nginx-1.11.2/auto/cc/gcc openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/gcc
--- nginx-1.11.2/auto/cc/gcc 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/gcc 2016-08-25 00:20:57.000000000 +0000
@@ -166,7 +166,7 @@
# stop on warning
-CFLAGS="$CFLAGS -Werror"
+#CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
diff -ruN -x '*.orig' nginx-1.11.2/auto/cc/icc openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/icc
--- nginx-1.11.2/auto/cc/icc 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/cc/icc 2016-08-25 00:20:57.000000000 +0000
@@ -111,7 +111,7 @@
esac
# stop on warning
-CFLAGS="$CFLAGS -Werror"
+#CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
diff -ruN -x '*.orig' nginx-1.11.2/auto/configure openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/configure
--- nginx-1.11.2/auto/configure 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/configure 1970-01-01 00:00:00.000000000 +0000
@@ -1,116 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-LC_ALL=C
-export LC_ALL
-
-. auto/options
-. auto/init
-. auto/sources
-
-test -d $NGX_OBJS || mkdir -p $NGX_OBJS
-
-echo > $NGX_AUTO_HEADERS_H
-echo > $NGX_AUTOCONF_ERR
-
-echo "#define NGX_CONFIGURE \"$NGX_CONFIGURE\"" > $NGX_AUTO_CONFIG_H
-
-
-if [ $NGX_DEBUG = YES ]; then
- have=NGX_DEBUG . auto/have
-fi
-
-
-if test -z "$NGX_PLATFORM"; then
- echo "checking for OS"
-
- NGX_SYSTEM=`uname -s 2>/dev/null`
- NGX_RELEASE=`uname -r 2>/dev/null`
- NGX_MACHINE=`uname -m 2>/dev/null`
-
- echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"
-
- NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
-
- case "$NGX_SYSTEM" in
- MINGW32_*)
- NGX_PLATFORM=win32
- ;;
- esac
-
-else
- echo "building for $NGX_PLATFORM"
- NGX_SYSTEM=$NGX_PLATFORM
-fi
-
-. auto/cc/conf
-
-if [ "$NGX_PLATFORM" != win32 ]; then
- . auto/headers
-fi
-
-. auto/os/conf
-
-if [ "$NGX_PLATFORM" != win32 ]; then
- . auto/unix
-fi
-
-. auto/threads
-. auto/modules
-. auto/lib/conf
-
-case ".$NGX_PREFIX" in
- .)
- NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
- have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
- ;;
-
- .!)
- NGX_PREFIX=
- ;;
-
- *)
- have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
- ;;
-esac
-
-if [ ".$NGX_CONF_PREFIX" != "." ]; then
- have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define
-fi
-
-have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define
-have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define
-have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
-have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
-have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define
-
-have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
-have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\""
-. auto/define
-have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\""
-. auto/define
-have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\""
-. auto/define
-have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\""
-. auto/define
-have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
-. auto/define
-
-. auto/make
-. auto/lib/make
-. auto/install
-
-# STUB
-. auto/stubs
-
-have=NGX_USER value="\"$NGX_USER\"" . auto/define
-have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define
-
-if [ ".$NGX_BUILD" != "." ]; then
- have=NGX_BUILD value="\"$NGX_BUILD\"" . auto/define
-fi
-
-. auto/summary
diff -ruN -x '*.orig' nginx-1.11.2/auto/install openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/install
--- nginx-1.11.2/auto/install 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/install 2016-08-25 00:20:57.000000000 +0000
@@ -16,6 +16,20 @@
fi
+case ".$NGX_STAP_NGX_PATH" in
+ ./*)
+ ;;
+
+ .)
+ NGX_STAP_NGX_PATH=$NGX_PREFIX/sbin/stap-nginx
+ ;;
+
+ *)
+ NGX_STAP_NGX_PATH=$NGX_PREFIX/$NGX_STAP_NGX_PATH
+ ;;
+esac
+
+
case ".$NGX_SBIN_PATH" in
./*)
;;
@@ -61,6 +75,16 @@
esac
+case ".$NGX_TAPSET_PREFIX" in
+ ./* | .)
+ ;;
+
+ *)
+ NGX_TAPSET_PREFIX=$NGX_PREFIX/$NGX_TAPSET_PREFIX
+ ;;
+esac
+
+
case ".$NGX_ERROR_LOG_PATH" in
./* | .)
;;
@@ -158,6 +182,36 @@
|| cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
END
+if [ $NGX_DTRACE = YES -a $DTRACE_FROM_SYSTEMTAP = YES ]; then
+
+ ngx_tapset_srcs="$NGX_TAPSET_SRCS"
+
+ cat << END >> $NGX_MAKEFILE
+ test -d '\$(DESTDIR)$NGX_TAPSET_PREFIX' || \
+ mkdir -p '\$(DESTDIR)$NGX_TAPSET_PREFIX'
+END
+
+ for ngx_tapset_src in $ngx_tapset_srcs
+ do
+ ngx_tapset_file=`basename $ngx_tapset_src`
+
+ cat << END >> $NGX_MAKEFILE
+
+ sed -e "s|NGX_SBIN_PATH|$NGX_SBIN_PATH|g" $ngx_long_cont \
+ $ngx_tapset_src > '\$(DESTDIR)$NGX_TAPSET_PREFIX/$ngx_tapset_file'
+END
+
+ done
+
+ cat << END >> $NGX_MAKEFILE
+
+ test -d '\$(DESTDIR)`dirname "$NGX_STAP_NGX_PATH"`' || \
+ mkdir -p '\$(DESTDIR)`dirname "$NGX_STAP_NGX_PATH"`'
+ cp $NGX_OBJS/stap-nginx '\$(DESTDIR)$NGX_STAP_NGX_PATH'
+ chmod 0755 '\$(DESTDIR)$NGX_STAP_NGX_PATH'
+END
+
+fi
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
@@ -194,6 +248,19 @@
done
+if [ $NGX_DTRACE = YES ]; then
+ cat << END >> $NGX_MAKEFILE
+
+$NGX_OBJS${ngx_dirsep}stap-nginx: src/dtrace/stap-nginx
+ sed -e "s|NGX_TAPSET_PREFIX|$NGX_TAPSET_PREFIX|g" $ngx_long_cont \
+ -e "s|NGX_SBIN_DIR|`dirname $NGX_SBIN_PATH`|g" $ngx_long_cont \
+ -e "s|NGX_SBIN_PATH|$NGX_SBIN_PATH|g" $ngx_long_cont \
+ src/dtrace/stap-nginx > $NGX_OBJS${ngx_dirsep}stap-nginx
+END
+
+fi
+
+
# create Makefile
cat << END >> Makefile
diff -ruN -x '*.orig' nginx-1.11.2/auto/make openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/make
--- nginx-1.11.2/auto/make 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/make 2016-08-25 00:20:57.000000000 +0000
@@ -27,6 +27,9 @@
END
+if [ $NGX_DTRACE = YES ]; then
+ echo DTRACE = $DTRACE >> $NGX_MAKEFILE
+fi
if test -n "$NGX_PERL_CFLAGS"; then
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
@@ -208,6 +211,46 @@
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
+
+if [ $NGX_DTRACE = YES ]; then
+
+ ngx_dtrace_obj=$NGX_OBJS${ngx_dirsep}ngx_dtrace_provider.$ngx_objext
+
+ ngx_dtrace_h=$NGX_OBJS${ngx_dirsep}ngx_dtrace_provider.h
+
+ ngx_dtrace_d=$NGX_OBJS${ngx_dirsep}dtrace_providers.d
+
+ ngx_dtrace_providers=`echo $NGX_DTRACE_PROVIDERS \
+ | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
+ -e "s/\//$ngx_regex_dirsep/g"`
+
+ cat << END >> $NGX_MAKEFILE
+
+all: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext}
+
+$ngx_dtrace_d: $ngx_dtrace_providers
+ cat $ngx_dtrace_providers > $ngx_dtrace_d
+
+$ngx_dtrace_h: $ngx_dtrace_d
+ \$(DTRACE) -h -o $ngx_dtrace_h -s $ngx_dtrace_d
+END
+
+ if [ $DTRACE_PROBE_OBJ = YES ]; then
+ cat << END >> $NGX_MAKEFILE
+$ngx_dtrace_obj: $ngx_dtrace_d $ngx_deps$ngx_spacer
+ \$(DTRACE) -G -o $ngx_dtrace_obj -s $ngx_dtrace_d $ngx_objs
+END
+
+ ngx_deps="$ngx_deps$ngx_long_cont$ngx_dtrace_obj"
+ ngx_objs="$ngx_objs$ngx_long_cont$ngx_dtrace_obj"
+
+ if [ "$DTRACE_FROM_SYSTEMTAP" = YES ]; then
+ ngx_deps="$ngx_deps$ngx_long_cont$NGX_OBJS${ngx_dirsep}stap-nginx"
+ fi
+ fi
+fi
+
+
ngx_libs=
if test -n "$NGX_LD_OPT$CORE_LIBS"; then
ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
diff -ruN -x '*.orig' nginx-1.11.2/auto/modules openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/modules
--- nginx-1.11.2/auto/modules 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/modules 2016-08-25 00:20:57.000000000 +0000
@@ -75,7 +75,8 @@
src/http/ngx_http_variables.h \
src/http/ngx_http_script.h \
src/http/ngx_http_upstream.h \
- src/http/ngx_http_upstream_round_robin.h"
+ src/http/ngx_http_upstream_round_robin.h \
+ src/http/ngx_http_probe.h"
ngx_module_srcs="src/http/ngx_http.c \
src/http/ngx_http_core_module.c \
src/http/ngx_http_special_response.c \
diff -ruN -x '*.orig' nginx-1.11.2/auto/options openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/options
--- nginx-1.11.2/auto/options 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/options 2016-08-25 00:20:57.000000000 +0000
@@ -13,6 +13,8 @@
NGX_ERROR_LOG_PATH=
NGX_PID_PATH=
NGX_LOCK_PATH=
+NGX_TAPSET_PREFIX=
+NGX_STAP_NGX_PATH=
NGX_USER=
NGX_GROUP=
NGX_BUILD=
@@ -22,6 +24,12 @@
NGX_OBJS=objs
NGX_DEBUG=NO
+NGX_DTRACE=NO
+DTRACE=dtrace
+
+DTRACE_PROBE_OBJ=YES
+DTRACE_FROM_SYSTEMTAP=NO
+
NGX_CC_OPT=
NGX_LD_OPT=
CPU=NO
@@ -181,6 +189,8 @@
--error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
--pid-path=*) NGX_PID_PATH="$value" ;;
--lock-path=*) NGX_LOCK_PATH="$value" ;;
+ --tapset-prefix=*) NGX_TAPSET_PREFIX="$value" ;;
+ --stap-nginx-path=*) NGX_STAP_NGX_PATH="$value" ;;
--user=*) NGX_USER="$value" ;;
--group=*) NGX_GROUP="$value" ;;
@@ -317,11 +327,13 @@
--with-ld-opt=*) NGX_LD_OPT="$value" ;;
--with-cpu-opt=*) CPU="$value" ;;
--with-debug) NGX_DEBUG=YES ;;
-
+ --with-dtrace=*) DTRACE="$value" ;;
+ --with-dtrace-probes) NGX_DTRACE=YES ;;
--without-pcre) USE_PCRE=DISABLED ;;
--with-pcre) USE_PCRE=YES ;;
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
+ --with-pcre-conf-opt=*) PCRE_CONF_OPT="$value" ;;
--with-pcre-jit) PCRE_JIT=YES ;;
--with-openssl=*) OPENSSL="$value" ;;
@@ -389,6 +401,8 @@
--error-log-path=PATH set error log pathname
--pid-path=PATH set nginx.pid pathname
--lock-path=PATH set nginx.lock pathname
+ --tapset-prefix=PATH set systemtap tapset directory prefix
+ --stap-nginx-path=PATH set stap-nginx pathname
--user=USER set non-privileged user for
worker processes
@@ -523,6 +537,7 @@
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
+ --with-pcre-conf-opt=OPTIONS set additional configure options for PCRE
--with-pcre-jit build PCRE with JIT compilation support
--with-zlib=DIR set path to zlib library sources
@@ -538,6 +553,8 @@
--with-openssl-opt=OPTIONS set additional build options for OpenSSL
--with-debug enable debug logging
+ --with-dtrace-probes enable dtrace USDT probes
+ --with-dtrace=PATH set dtrace utility pathname
END
@@ -569,6 +586,7 @@
NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
+NGX_TAPSET_PREFIX=${NGX_TAPSET_PREFIX:-tapset}
if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
NGX_ERROR_LOG_PATH=
diff -ruN -x '*.orig' nginx-1.11.2/auto/os/darwin openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/darwin
--- nginx-1.11.2/auto/os/darwin 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/darwin 2016-08-25 00:20:57.000000000 +0000
@@ -116,3 +116,6 @@
ngx_feature_test="int32_t lock, n;
n = OSAtomicCompareAndSwap32Barrier(0, 1, &lock)"
. auto/feature
+
+DTRACE_PROBE_OBJ=NO
+
diff -ruN -x '*.orig' nginx-1.11.2/auto/os/freebsd openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/freebsd
--- nginx-1.11.2/auto/os/freebsd 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/freebsd 2016-08-25 00:20:57.000000000 +0000
@@ -105,3 +105,8 @@
echo " + cpuset_setaffinity() found"
have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
fi
+
+if [ $NGX_DTRACE = YES ]; then
+ NGX_LD_OPT="$NGX_LD_OPT -lelf"
+fi
+
diff -ruN -x '*.orig' nginx-1.11.2/auto/os/linux openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/linux
--- nginx-1.11.2/auto/os/linux 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/os/linux 2016-08-25 00:20:57.000000000 +0000
@@ -171,3 +171,5 @@
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+
+DTRACE_FROM_SYSTEMTAP=YES
diff -ruN -x '*.orig' nginx-1.11.2/auto/sources openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/sources
--- nginx-1.11.2/auto/sources 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/sources 2016-08-25 00:20:57.000000000 +0000
@@ -40,10 +40,16 @@
src/core/ngx_resolver.h \
src/core/ngx_open_file_cache.h \
src/core/ngx_crypt.h \
+ src/core/ngx_core_probe.h \
src/core/ngx_proxy_protocol.h \
src/core/ngx_syslog.h"
+if [ $NGX_DTRACE = YES ]; then
+ CORE_DEPS="$CORE_DEPS objs/ngx_dtrace_provider.h"
+fi
+
+
CORE_SRCS="src/core/nginx.c \
src/core/ngx_log.c \
src/core/ngx_palloc.c \
@@ -89,7 +95,8 @@
src/event/ngx_event_timer.h \
src/event/ngx_event_posted.h \
src/event/ngx_event_connect.h \
- src/event/ngx_event_pipe.h"
+ src/event/ngx_event_pipe.h \
+ src/event/ngx_event_probe.h"
EVENT_SRCS="src/event/ngx_event.c \
src/event/ngx_event_timer.c \
@@ -252,3 +259,7 @@
HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c
+
+NGX_DTRACE_PROVIDERS=src/dtrace/nginx_provider.d
+
+NGX_TAPSET_SRCS=src/dtrace/nginx.stp
diff -ruN -x '*.orig' nginx-1.11.2/auto/summary openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/summary
--- nginx-1.11.2/auto/summary 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/auto/summary 2016-08-25 00:20:57.000000000 +0000
@@ -58,6 +58,19 @@
echo " nginx logs errors to stderr"
fi
+if [ $NGX_DTRACE = YES ]; then
+ cat << END
+ nginx dtrace static probes enabled
+END
+
+ if [ $DTRACE_FROM_SYSTEMTAP = YES ]; then
+ cat << END
+ nginx systemtap tapset prefix: "$NGX_TAPSET_PREFIX"
+ nginx systemtap wrapper script: "$NGX_STAP_NGX_PATH"
+END
+ fi
+fi
+
cat << END
nginx http access log file: "$NGX_HTTP_LOG_PATH"
nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
diff -ruN -x '*.orig' nginx-1.11.2/configure openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/configure
--- nginx-1.11.2/configure 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/configure 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) Nginx, Inc.
+
+
+LC_ALL=C
+export LC_ALL
+
+. auto/options
+. auto/init
+. auto/sources
+
+test -d $NGX_OBJS || mkdir -p $NGX_OBJS
+
+echo > $NGX_AUTO_HEADERS_H
+echo > $NGX_AUTOCONF_ERR
+
+echo "#define NGX_CONFIGURE \"$NGX_CONFIGURE\"" > $NGX_AUTO_CONFIG_H
+
+
+if [ $NGX_DEBUG = YES ]; then
+ have=NGX_DEBUG . auto/have
+fi
+
+if [ $NGX_DTRACE = YES ]; then
+ have=NGX_DTRACE . auto/have
+fi
+
+if test -z "$NGX_PLATFORM"; then
+ echo "checking for OS"
+
+ NGX_SYSTEM=`uname -s 2>/dev/null`
+ NGX_RELEASE=`uname -r 2>/dev/null`
+ NGX_MACHINE=`uname -m 2>/dev/null`
+
+ echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE"
+
+ NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
+
+ case "$NGX_SYSTEM" in
+ MINGW32_*)
+ NGX_PLATFORM=win32
+ ;;
+ esac
+
+else
+ echo "building for $NGX_PLATFORM"
+ NGX_SYSTEM=$NGX_PLATFORM
+fi
+
+. auto/cc/conf
+
+if [ "$NGX_PLATFORM" != win32 ]; then
+ . auto/headers
+fi
+
+. auto/os/conf
+
+if [ "$NGX_PLATFORM" != win32 ]; then
+ . auto/unix
+fi
+
+. auto/threads
+. auto/modules
+. auto/lib/conf
+
+case ".$NGX_PREFIX" in
+ .)
+ NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
+ have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
+ ;;
+
+ .!)
+ NGX_PREFIX=
+ ;;
+
+ *)
+ have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
+ ;;
+esac
+
+if [ ".$NGX_CONF_PREFIX" != "." ]; then
+ have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define
+fi
+
+have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define
+have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define
+have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
+have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
+have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define
+
+have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
+have=NGX_HTTP_CLIENT_TEMP_PATH value="\"$NGX_HTTP_CLIENT_TEMP_PATH\""
+. auto/define
+have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\""
+. auto/define
+have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\""
+. auto/define
+have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\""
+. auto/define
+have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
+. auto/define
+
+. auto/make
+. auto/lib/make
+. auto/install
+
+# STUB
+. auto/stubs
+
+have=NGX_USER value="\"$NGX_USER\"" . auto/define
+have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define
+
+if [ ".$NGX_BUILD" != "." ]; then
+ have=NGX_BUILD value="\"$NGX_BUILD\"" . auto/define
+fi
+
+. auto/summary
diff -ruN -x '*.orig' nginx-1.11.2/docs/html/50x.html openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/html/50x.html
--- nginx-1.11.2/docs/html/50x.html 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/html/50x.html 2016-08-25 00:20:57.000000000 +0000
@@ -16,6 +16,6 @@
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the <a href="http://nginx.org/r/error_log">error log</a> for details.</p>
-<p><em>Faithfully yours, nginx.</em></p>
+<p><em>Faithfully yours, OpenResty.</em></p>
</body>
</html>
diff -ruN -x '*.orig' nginx-1.11.2/docs/html/index.html openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/html/index.html
--- nginx-1.11.2/docs/html/index.html 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/html/index.html 2016-08-25 00:20:57.000000000 +0000
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
-<title>Welcome to nginx!</title>
+<title>Welcome to OpenResty!</title>
<style>
body {
width: 35em;
@@ -11,15 +11,13 @@
</style>
</head>
<body>
-<h1>Welcome to nginx!</h1>
-<p>If you see this page, the nginx web server is successfully installed and
+<h1>Welcome to OpenResty!</h1>
+<p>If you see this page, the OpenResty web platform is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
-<a href="http://nginx.org/">nginx.org</a>.<br/>
-Commercial support is available at
-<a href="http://nginx.com/">nginx.com</a>.</p>
+<a href="https://openresty.org/">openresty.org</a>.<br/>
-<p><em>Thank you for using nginx.</em></p>
+<p><em>Thank you for flying OpenResty.</em></p>
</body>
</html>
diff -ruN -x '*.orig' nginx-1.11.2/docs/text/README openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/text/README
--- nginx-1.11.2/docs/text/README 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/docs/text/README 1970-01-01 00:00:00.000000000 +0000
@@ -1,3 +0,0 @@
-
-Documentation is available at http://nginx.org
-
diff -ruN -x '*.orig' nginx-1.11.2/src/core/nginx.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/nginx.h
--- nginx-1.11.2/src/core/nginx.h 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/nginx.h 2016-08-25 00:20:57.000000000 +0000
@@ -11,7 +11,7 @@
#define nginx_version 1011002
#define NGINX_VERSION "1.11.2"
-#define NGINX_VER "nginx/" NGINX_VERSION
+#define NGINX_VER "openresty/" NGINX_VERSION ".1"
#ifdef NGX_BUILD
#define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")"
diff -ruN -x '*.orig' nginx-1.11.2/src/core/ngx_core_probe.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_core_probe.h
--- nginx-1.11.2/src/core/ngx_core_probe.h 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_core_probe.h 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,24 @@
+#ifndef _NGX_CORE_PROBE_H_INCLUDED_
+#define _NGX_CORE_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_dtrace_provider.h>
+
+#define ngx_core_probe_create_pool_done(pool, size) \
+ NGINX_CREATE_POOL_DONE(pool, size)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_core_probe_create_pool_done(pool, size)
+
+#endif
+
+
+#endif /* _NGX_CORE_PROBE_H_INCLUDED_ */
diff -ruN -x '*.orig' nginx-1.11.2/src/core/ngx_log.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_log.h
--- nginx-1.11.2/src/core/ngx_log.h 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_log.h 2016-08-25 00:20:57.000000000 +0000
@@ -73,7 +73,9 @@
};
-#define NGX_MAX_ERROR_STR 2048
+#ifndef NGX_MAX_ERROR_STR
+#define NGX_MAX_ERROR_STR 4096
+#endif
/*********************************/
diff -ruN -x '*.orig' nginx-1.11.2/src/core/ngx_palloc.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_palloc.c
--- nginx-1.11.2/src/core/ngx_palloc.c 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/core/ngx_palloc.c 2016-08-25 00:20:57.000000000 +0000
@@ -7,6 +7,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
+#include <ngx_core_probe.h>
static ngx_inline void *ngx_palloc_small(ngx_pool_t *pool, size_t size,
@@ -39,6 +40,8 @@
p->cleanup = NULL;
p->log = log;
+ ngx_core_probe_create_pool_done(p, size);
+
return p;
}
diff -ruN -x '*.orig' nginx-1.11.2/src/dtrace/nginx.stp openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/nginx.stp
--- nginx-1.11.2/src/dtrace/nginx.stp 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/nginx.stp 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,299 @@
+/* tapset for nginx */
+
+
+function ngx_indent(n, delta)
+{
+ s = ""
+ for (i = 0; i < n; i++) {
+ s .= delta
+ }
+
+ return s
+}
+
+
+function ngx_http_subreq_depth(r)
+{
+ depth = 0
+
+ for (pr = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->parent;
+ pr != 0;
+ pr = @cast(pr, "ngx_http_request_t", "NGX_SBIN_PATH")->parent)
+ {
+ depth++
+ }
+
+ return depth
+}
+
+
+function ngx_http_req_parent(r)
+{
+ return @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->parent
+}
+
+
+/* retrieve the request uri string from the ngx_http_request_t pointer */
+function ngx_http_req_uri(r)
+{
+ len = @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->uri->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->uri->data, len)
+}
+
+
+/* retrieve the request query string from the ngx_http_request_t pointer */
+function ngx_http_req_args(r)
+{
+ len = @cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->args->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(r, "ngx_http_request_s", "NGX_SBIN_PATH")->args->data, len)
+}
+
+
+/* retrieve the first command name (or directive name) from
+ * the ngx_module_t pointer */
+function ngx_http_module_cmd(m)
+{
+ cmds = @cast(m, "ngx_module_t", "NGX_SBIN_PATH")->commands
+ if (cmds == 0) {
+ return ""
+ }
+
+ len = @cast(cmds, "ngx_command_t", "NGX_SBIN_PATH")->name->len
+
+ if (len == 0) {
+ return ""
+ }
+
+ return user_string_n(@cast(cmds, "ngx_command_t", "NGX_SBIN_PATH")->name->data, len)
+}
+
+
+function ngx_chain_buf(cl)
+{
+ return @cast(cl, "ngx_chain_t", "NGX_SBIN_PATH")->buf
+}
+
+
+function ngx_chain_next(cl)
+{
+ return @cast(cl, "ngx_chain_t", "NGX_SBIN_PATH")->next
+}
+
+function ngx_buf_tag(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->tag
+}
+
+function ngx_buf_in_memory(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->temporary
+ || @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->memory
+ || @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->mmap
+}
+
+
+function ngx_buf_pos(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->pos
+}
+
+
+function ngx_buf_file_pos(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->file_pos
+}
+
+
+function ngx_buf_last(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->last
+}
+
+
+function ngx_buf_file_last(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->file_last
+}
+
+
+function ngx_buf_end(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->end
+}
+
+
+function ngx_buf_in_file(b)
+{
+ return @cast(b, "ngx_buf_t", "NGX_SBIN_PATH")->in_file
+}
+
+
+function ngx_buf_last_buf(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->last_buf
+}
+
+
+function ngx_buf_last_in_chain(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->last_in_chain
+}
+
+
+function ngx_buf_sync(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->sync
+}
+
+
+function ngx_buf_flush(b)
+{
+ return @cast(b, "ngx_buf_t", "/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx")->flush
+}
+
+
+function ngx_buf_size(b)
+{
+ if (ngx_buf_in_memory(b)) {
+ return ngx_buf_last(b) - ngx_buf_pos(b)
+ }
+
+ return ngx_buf_file_last(b) - ngx_buf_file_pos(b)
+}
+
+
+function ngx_buf_data(b)
+{
+ return user_string_n(ngx_buf_pos(b), ngx_buf_last(b) - ngx_buf_pos(b))
+}
+
+
+function ngx_chain_writer_ctx_out(ctx)
+{
+ return @cast(c, "ngx_chain_writer_ctx_t", "NGX_SBIN_PATH")->out
+}
+
+
+function ngx_chain_dump:string (input)
+{
+ if (input == 0) {
+ return "NULL"
+ }
+
+ out = ""
+ cl = input
+ while (cl) {
+ buf = ngx_chain_buf(cl)
+
+ if (ngx_buf_in_memory(buf)) {
+ out .= sprintf("[%s]", text_str(ngx_buf_data(buf)))
+
+ } else {
+ out .= "\"\""
+ }
+
+ if (ngx_buf_in_file(buf)) {
+ out .= sprintf("<in_file:%d-%d>", ngx_buf_file_pos(buf),
+ ngx_buf_file_last(buf))
+ }
+
+ if (ngx_buf_last_buf(buf)) {
+ out .= "<last_buf>"
+ }
+
+ if (ngx_buf_last_in_chain(buf)) {
+ out .= "<last_in_chain>"
+ }
+
+ if (ngx_buf_sync(buf)) {
+ out .= "<sync>"
+ }
+
+ if (ngx_buf_flush(buf)) {
+ out .= "<flush>"
+ }
+
+ tag = ngx_buf_tag(buf)
+ if (tag) {
+ out .= sprintf("<tag:%p>", tag)
+ }
+
+ cl = ngx_chain_next(cl)
+ if (cl) {
+ out .= " "
+ }
+ }
+ return out
+}
+
+
+function ngx_pool_cleanup_file_name(c)
+{
+ return user_string(@cast(c, "ngx_pool_cleanup_file_t", "NGX_SBIN_PATH")->name)
+}
+
+
+function ngx_http_req_content_length(r)
+{
+ return @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->headers_in->content_length_n
+}
+
+
+function ngx_http_req_body_temp_file_name(r)
+{
+ rb = @cast(r, "ngx_http_request_t", "NGX_SBIN_PATH")->request_body
+ if (!rb) {
+ return ""
+ }
+
+ tf = @cast(rb, "ngx_http_request_body_t", "NGX_SBIN_PATH")->temp_file
+ if (!tf) {
+ return ""
+ }
+
+ len = @cast(tf, "ngx_temp_file_t", "NGX_SBIN_PATH")->file->name->len
+
+ return user_string_n(@cast(tf, "ngx_temp_file_t", "NGX_SBIN_PATH")->file->name->data, len)
+}
+
+
+function ngx_table_elt_key(e)
+{
+ len = @cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->key->len
+
+ return user_string_n(@cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->key->data, len)
+}
+
+
+function ngx_table_elt_value(e)
+{
+ len = @cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->value->len
+
+ return user_string_n(@cast(e, "ngx_table_elt_t", "NGX_SBIN_PATH")->value->data, len)
+}
+
+
+function ngx_iovec_dump:string (iov, iovcnt) {
+ out = ""
+ for (i = 0; i < iovcnt; i++) {
+ out .= sprintf("\"%s\"(%p)", text_str(user_string_n(
+ @cast(iov, "struct iovec")[i]->iov_base,
+ @cast(iov, "struct iovec")[i]->iov_len)
+ ), @cast(iov, "struct iovec")[i]->iov_base)
+ if (i != iovcnt - 1) {
+ out .= " "
+ }
+ }
+ return out
+}
+
diff -ruN -x '*.orig' nginx-1.11.2/src/dtrace/nginx_provider.d openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/nginx_provider.d
--- nginx-1.11.2/src/dtrace/nginx_provider.d 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/nginx_provider.d 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,39 @@
+typedef struct { int dummy; } ngx_str_t;
+typedef int64_t ngx_int_t;
+typedef uint64_t ngx_uint_t;
+typedef ngx_uint_t ngx_msec_t;
+typedef struct { int dummy; } ngx_module_t;
+typedef struct { int dummy; } ngx_http_module_t;
+typedef struct { int dummy; } ngx_table_elt_t;
+typedef struct { int dummy; } ngx_event_t;
+typedef struct { int dummy; } ngx_pool_t;
+typedef char unsigned u_char;
+
+
+provider nginx {
+ /* probes for subrequests */
+ probe http__subrequest__cycle(void *pr, ngx_str_t *uri, ngx_str_t *args);
+ probe http__subrequest__start(void *r);
+ probe http__subrequest__finalize_writing(void *r);
+ probe http__subrequest__finalize_nonactive(void *r);
+ probe http__subrequest__wake__parent(void *r);
+ probe http__subrequest__done(void *r);
+ probe http__subrequest__post__start(void *r, ngx_int_t rc);
+ probe http__subrequest__post__done(void *r, ngx_int_t rc);
+ probe http__module__post__config(ngx_module_t *m);
+ probe http__read__body__done(void *r);
+ probe http__read__req__line__done(void *r);
+ probe http__read__req__header__done(void *r, ngx_table_elt_t *h);
+ probe timer__add(ngx_event_t *ev, ngx_msec_t timer);
+ probe timer__del(ngx_event_t *ev);
+ probe timer__expire(ngx_event_t *ev);
+ probe create__pool__done(ngx_pool_t *pool, size_t size);
+};
+
+
+#pragma D attributes Evolving/Evolving/Common provider nginx provider
+#pragma D attributes Private/Private/Unknown provider nginx module
+#pragma D attributes Private/Private/Unknown provider nginx function
+#pragma D attributes Private/Private/Common provider nginx name
+#pragma D attributes Evolving/Evolving/Common provider nginx args
+
diff -ruN -x '*.orig' nginx-1.11.2/src/dtrace/stap-nginx openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/stap-nginx
--- nginx-1.11.2/src/dtrace/stap-nginx 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/dtrace/stap-nginx 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH="NGX_SBIN_DIR:$PATH"
+export PATH
+exec stap -d "NGX_SBIN_PATH" -I "NGX_TAPSET_PREFIX" "$@"
+
diff -ruN -x '*.orig' nginx-1.11.2/src/event/ngx_event_openssl.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_openssl.c
--- nginx-1.11.2/src/event/ngx_event_openssl.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_openssl.c 2016-08-25 00:20:57.000000000 +0000
@@ -1306,6 +1306,28 @@
return NGX_AGAIN;
}
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ if (sslerr == SSL_ERROR_WANT_X509_LOOKUP
+# ifdef SSL_ERROR_PENDING_SESSION
+ || sslerr == SSL_ERROR_PENDING_SESSION
+# endif
+ )
+ {
+ c->read->handler = ngx_ssl_handshake_handler;
+ c->write->handler = ngx_ssl_handshake_handler;
+
+ if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
+ if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
+ return NGX_ERROR;
+ }
+
+ return NGX_AGAIN;
+ }
+#endif
+
err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
c->ssl->no_wait_shutdown = 1;
diff -ruN -x '*.orig' nginx-1.11.2/src/event/ngx_event_probe.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_probe.h
--- nginx-1.11.2/src/event/ngx_event_probe.h 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_probe.h 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,32 @@
+#ifndef _NGX_EVENT_PROBE_H_INCLUDED_
+#define _NGX_EVENT_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_event.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_dtrace_provider.h>
+
+#define ngx_event_probe_timer_add(ev, timer) \
+ NGINX_TIMER_ADD(ev, timer)
+
+#define ngx_event_probe_timer_del(ev) \
+ NGINX_TIMER_DEL(ev)
+
+#define ngx_event_probe_timer_expire(ev) \
+ NGINX_TIMER_EXPIRE(ev)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_event_probe_timer_add(ev, timer)
+#define ngx_event_probe_timer_del(ev)
+#define ngx_event_probe_timer_expire(ev)
+
+#endif
+
+
+#endif /* _NGX_EVENT_PROBE_H_INCLUDED_ */
diff -ruN -x '*.orig' nginx-1.11.2/src/event/ngx_event_timer.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_timer.c
--- nginx-1.11.2/src/event/ngx_event_timer.c 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_timer.c 2016-08-25 00:20:57.000000000 +0000
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
+#include <ngx_event_probe.h>
ngx_rbtree_t ngx_event_timer_rbtree;
@@ -91,6 +92,8 @@
ev->timedout = 1;
+ ngx_event_probe_timer_expire(ev);
+
ev->handler(ev);
}
}
@@ -136,3 +139,19 @@
ev->handler(ev);
}
}
+
+
+#if (NGX_DTRACE)
+void
+ngx_event_probe_timer_add_helper(ngx_event_t *ev, ngx_msec_t timer)
+{
+ ngx_event_probe_timer_add(ev, timer);
+}
+
+
+void
+ngx_event_probe_timer_del_helper(ngx_event_t *ev)
+{
+ ngx_event_probe_timer_del(ev);
+}
+#endif
diff -ruN -x '*.orig' nginx-1.11.2/src/event/ngx_event_timer.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_timer.h
--- nginx-1.11.2/src/event/ngx_event_timer.h 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/event/ngx_event_timer.h 2016-08-25 00:20:57.000000000 +0000
@@ -25,12 +25,23 @@
void ngx_event_cancel_timers(void);
+#if (NGX_DTRACE)
+void ngx_event_probe_timer_add_helper(ngx_event_t *ev,
+ ngx_msec_t timer);
+void ngx_event_probe_timer_del_helper(ngx_event_t *ev);
+#endif
+
+
extern ngx_rbtree_t ngx_event_timer_rbtree;
static ngx_inline void
ngx_event_del_timer(ngx_event_t *ev)
{
+#if (NGX_DTRACE)
+ ngx_event_probe_timer_del_helper(ev);
+#endif
+
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"event timer del: %d: %M",
ngx_event_ident(ev->data), ev->timer.key);
@@ -77,6 +88,10 @@
ev->timer.key = key;
+#if (NGX_DTRACE)
+ ngx_event_probe_timer_add_helper(ev, timer);
+#endif
+
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
"event timer add: %d: %M:%M",
ngx_event_ident(ev->data), timer, ev->timer.key);
diff -ruN -x '*.orig' nginx-1.11.2/src/http/modules/ngx_http_log_module.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/modules/ngx_http_log_module.c
--- nginx-1.11.2/src/http/modules/ngx_http_log_module.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/modules/ngx_http_log_module.c 2016-08-25 00:20:57.000000000 +0000
@@ -79,6 +79,8 @@
time_t open_file_cache_valid;
ngx_uint_t open_file_cache_min_uses;
+ ngx_flag_t escape_non_ascii;
+
ngx_uint_t off; /* unsigned off:1 */
} ngx_http_log_loc_conf_t;
@@ -131,7 +133,8 @@
uintptr_t data);
static u_char *ngx_http_log_variable(ngx_http_request_t *r, u_char *buf,
ngx_http_log_op_t *op);
-static uintptr_t ngx_http_log_escape(u_char *dst, u_char *src, size_t size);
+static uintptr_t ngx_http_log_escape(ngx_http_log_loc_conf_t *lcf, u_char *dst,
+ u_char *src, size_t size);
static void *ngx_http_log_create_main_conf(ngx_conf_t *cf);
@@ -173,6 +176,13 @@
0,
NULL },
+ { ngx_string("log_escape_non_ascii"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
+ ngx_conf_set_flag_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_log_loc_conf_t, escape_non_ascii),
+ NULL },
+
ngx_null_command
};
@@ -931,6 +941,7 @@
ngx_http_log_variable_getlen(ngx_http_request_t *r, uintptr_t data)
{
uintptr_t len;
+ ngx_http_log_loc_conf_t *lcf;
ngx_http_variable_value_t *value;
value = ngx_http_get_indexed_variable(r, data);
@@ -939,7 +950,9 @@
return 1;
}
- len = ngx_http_log_escape(NULL, value->data, value->len);
+ lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
+
+ len = ngx_http_log_escape(lcf, NULL, value->data, value->len);
value->escape = len ? 1 : 0;
@@ -950,6 +963,7 @@
static u_char *
ngx_http_log_variable(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
{
+ ngx_http_log_loc_conf_t *lcf;
ngx_http_variable_value_t *value;
value = ngx_http_get_indexed_variable(r, op->data);
@@ -963,16 +977,18 @@
return ngx_cpymem(buf, value->data, value->len);
} else {
- return (u_char *) ngx_http_log_escape(buf, value->data, value->len);
+ lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
+ return (u_char *) ngx_http_log_escape(lcf, buf, value->data, value->len);
}
}
static uintptr_t
-ngx_http_log_escape(u_char *dst, u_char *src, size_t size)
+ngx_http_log_escape(ngx_http_log_loc_conf_t *lcf, u_char *dst, u_char *src,
+ size_t size)
{
- ngx_uint_t n;
- static u_char hex[] = "0123456789ABCDEF";
+ ngx_uint_t n;
+ static u_char hex[] = "0123456789ABCDEF";
static uint32_t escape[] = {
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
@@ -992,6 +1008,12 @@
0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
};
+ if (lcf->escape_non_ascii) {
+ ngx_memset(&escape[4], 0xff, sizeof(uint32_t) * 4);
+
+ } else {
+ ngx_memzero(&escape[4], sizeof(uint32_t) * 4);
+ }
if (dst == NULL) {
@@ -1075,6 +1097,7 @@
}
conf->open_file_cache = NGX_CONF_UNSET_PTR;
+ conf->escape_non_ascii = NGX_CONF_UNSET;
return conf;
}
@@ -1090,6 +1113,8 @@
ngx_http_log_fmt_t *fmt;
ngx_http_log_main_conf_t *lmcf;
+ ngx_conf_merge_value(conf->escape_non_ascii, prev->escape_non_ascii, 1);
+
if (conf->open_file_cache == NGX_CONF_UNSET_PTR) {
conf->open_file_cache = prev->open_file_cache;
diff -ruN -x '*.orig' nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c
--- nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/modules/ngx_http_proxy_module.c 2016-08-25 00:20:57.000000000 +0000
@@ -793,10 +793,10 @@
static ngx_http_variable_t ngx_http_proxy_vars[] = {
{ ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
+ NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
{ ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
+ NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
{ ngx_string("proxy_add_x_forwarded_for"), NULL,
ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http.c
--- nginx-1.11.2/src/http/ngx_http.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http.c 2016-08-25 00:20:57.000000000 +0000
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
@@ -305,6 +306,9 @@
module = cf->cycle->modules[m]->ctx;
if (module->postconfiguration) {
+
+ ngx_http_probe_module_post_config(ngx_modules[m]);
+
if (module->postconfiguration(cf) != NGX_OK) {
return NGX_CONF_ERROR;
}
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_core_module.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_core_module.c
--- nginx-1.11.2/src/http/ngx_http_core_module.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_core_module.c 2016-08-25 00:20:57.000000000 +0000
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
typedef struct {
@@ -61,6 +62,8 @@
void *conf);
static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
+static char *ngx_http_core_no_error_pages(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
static char *ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
@@ -634,6 +637,14 @@
0,
NULL },
+ { ngx_string("no_error_pages"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
+ |NGX_CONF_NOARGS,
+ ngx_http_core_no_error_pages,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ 0,
+ NULL },
+
{ ngx_string("try_files"),
NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_2MORE,
ngx_http_core_try_files,
@@ -2427,6 +2438,8 @@
ngx_http_postponed_request_t *pr, *p;
if (r->subrequests == 0) {
+ ngx_http_probe_subrequest_cycle(r, uri, args);
+
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"subrequests cycle while processing \"%V\"", uri);
return NGX_ERROR;
@@ -2553,6 +2566,8 @@
*psr = sr;
+ ngx_http_probe_subrequest_start(sr);
+
return ngx_http_post_request(sr, NULL);
}
@@ -3591,7 +3606,6 @@
* clcf->types = NULL;
* clcf->default_type = { 0, NULL };
* clcf->error_log = NULL;
- * clcf->error_pages = NULL;
* clcf->try_files = NULL;
* clcf->client_body_path = NULL;
* clcf->regex = NULL;
@@ -3602,6 +3616,7 @@
* clcf->keepalive_disable = 0;
*/
+ clcf->error_pages = NGX_CONF_UNSET_PTR;
clcf->client_max_body_size = NGX_CONF_UNSET;
clcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE;
clcf->client_body_timeout = NGX_CONF_UNSET_MSEC;
@@ -3800,9 +3815,7 @@
}
}
- if (conf->error_pages == NULL && prev->error_pages) {
- conf->error_pages = prev->error_pages;
- }
+ ngx_conf_merge_ptr_value(conf->error_pages, prev->error_pages, NULL);
ngx_conf_merge_str_value(conf->default_type,
prev->default_type, "text/plain");
@@ -4810,6 +4823,10 @@
ngx_http_compile_complex_value_t ccv;
if (clcf->error_pages == NULL) {
+ return "conflicts with \"no_error_pages\"";
+ }
+
+ if (clcf->error_pages == NGX_CONF_UNSET_PTR) {
clcf->error_pages = ngx_array_create(cf->pool, 4,
sizeof(ngx_http_err_page_t));
if (clcf->error_pages == NULL) {
@@ -4914,6 +4931,25 @@
return NGX_CONF_OK;
}
+
+
+static char *
+ngx_http_core_no_error_pages(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_http_core_loc_conf_t *clcf = conf;
+
+ if (clcf->error_pages == NULL) {
+ return "is duplicate";
+ }
+
+ if (clcf->error_pages != NGX_CONF_UNSET_PTR) {
+ return "conflicts with \"error_page\"";
+ }
+
+ clcf->error_pages = NULL;
+
+ return NGX_CONF_OK;
+}
static char *
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_header_filter_module.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_header_filter_module.c
--- nginx-1.11.2/src/http/ngx_http_header_filter_module.c 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_header_filter_module.c 2016-08-25 00:20:57.000000000 +0000
@@ -46,7 +46,7 @@
};
-static char ngx_http_server_string[] = "Server: nginx" CRLF;
+static char ngx_http_server_string[] = "Server: openresty" CRLF;
static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_probe.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_probe.h
--- nginx-1.11.2/src/http/ngx_http_probe.h 1970-01-01 00:00:00.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_probe.h 2016-08-25 00:20:57.000000000 +0000
@@ -0,0 +1,75 @@
+#ifndef _NGX_HTTP_PROBE_H_INCLUDED_
+#define _NGX_HTTP_PROBE_H_INCLUDED_
+
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+#include <ngx_http.h>
+
+
+#if (NGX_DTRACE)
+
+#include <ngx_dtrace_provider.h>
+
+#define ngx_http_probe_subrequest_cycle(pr, uri, args) \
+ NGINX_HTTP_SUBREQUEST_CYCLE(pr, uri, args)
+
+#define ngx_http_probe_subrequest_start(r) \
+ NGINX_HTTP_SUBREQUEST_START(r)
+
+#define ngx_http_probe_subrequest_finalize_writing(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_WRITING(r)
+
+#define ngx_http_probe_subrequest_finalize_nonactive(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_NONACTIVE(r)
+
+#define ngx_http_probe_subrequest_finalize_nonactive(r) \
+ NGINX_HTTP_SUBREQUEST_FINALIZE_NONACTIVE(r)
+
+#define ngx_http_probe_subrequest_wake_parent(r) \
+ NGINX_HTTP_SUBREQUEST_WAKE_PARENT(r)
+
+#define ngx_http_probe_subrequest_done(r) \
+ NGINX_HTTP_SUBREQUEST_DONE(r)
+
+#define ngx_http_probe_subrequest_post_start(r, rc) \
+ NGINX_HTTP_SUBREQUEST_POST_START(r, rc)
+
+#define ngx_http_probe_subrequest_post_done(r, rc) \
+ NGINX_HTTP_SUBREQUEST_POST_DONE(r, rc)
+
+#define ngx_http_probe_module_post_config(m) \
+ NGINX_HTTP_MODULE_POST_CONFIG(m)
+
+#define ngx_http_probe_read_body_abort(r, reason) \
+ NGINX_HTTP_READ_BODY_ABORT(r, reason)
+
+#define ngx_http_probe_read_body_done(r) \
+ NGINX_HTTP_READ_BODY_DONE(r)
+
+#define ngx_http_probe_read_req_line_done(r) \
+ NGINX_HTTP_READ_REQ_LINE_DONE(r)
+
+#define ngx_http_probe_read_req_header_done(r, h) \
+ NGINX_HTTP_READ_REQ_HEADER_DONE(r, h)
+
+#else /* !(NGX_DTRACE) */
+
+#define ngx_http_probe_subrequest_cycle(pr, uri, args)
+#define ngx_http_probe_subrequest_start(r)
+#define ngx_http_probe_subrequest_finalize_writing(r)
+#define ngx_http_probe_subrequest_finalize_nonactive(r)
+#define ngx_http_probe_subrequest_wake_parent(r)
+#define ngx_http_probe_subrequest_done(r)
+#define ngx_http_probe_subrequest_post_start(r, rc)
+#define ngx_http_probe_subrequest_post_done(r, rc)
+#define ngx_http_probe_module_post_config(m)
+#define ngx_http_probe_read_body_abort(r, reason)
+#define ngx_http_probe_read_body_done(r)
+#define ngx_http_probe_read_req_line_done(r)
+#define ngx_http_probe_read_req_header_done(r, h)
+
+#endif /* NGX_DTRACE */
+
+
+#endif /* _NGX_HTTP_PROBE_H_INCLUDED_ */
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_request.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_request.c
--- nginx-1.11.2/src/http/ngx_http_request.c 2016-08-02 20:47:43.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_request.c 2016-08-25 00:20:57.000000000 +0000
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static void ngx_http_wait_request_handler(ngx_event_t *ev);
@@ -1062,7 +1063,6 @@
}
}
-
ngx_int_t
ngx_http_process_request_uri(ngx_http_request_t *r)
{
@@ -1319,6 +1319,8 @@
return;
}
+ ngx_http_probe_read_req_header_done(r, h);
+
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http header: \"%V: %V\"",
&h->key, &h->value);
@@ -2014,7 +2016,7 @@
ngx_int_t rc;
ngx_http_connection_t *hc;
ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
+ ngx_http_core_srv_conf_t *cscf = NULL;
#if (NGX_SUPPRESS_WARN)
cscf = NULL;
@@ -2288,7 +2290,11 @@
}
if (r != r->main && r->post_subrequest) {
+ ngx_http_probe_subrequest_post_start(r, rc);
+
rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);
+
+ ngx_http_probe_subrequest_post_done(r, rc);
}
if (rc == NGX_ERROR
@@ -2338,6 +2344,8 @@
if (r->buffered || r->postponed) {
+ ngx_http_probe_subrequest_finalize_writing(r);
+
if (ngx_http_set_write_handler(r) != NGX_OK) {
ngx_http_terminate_request(r, 0);
}
@@ -2373,10 +2381,14 @@
pr->postponed = pr->postponed->next;
}
+ ngx_http_probe_subrequest_done(r);
+
c->data = pr;
} else {
+ ngx_http_probe_subrequest_finalize_nonactive(r);
+
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http finalize non-active request: \"%V?%V\"",
&r->uri, &r->args);
@@ -2388,6 +2400,8 @@
}
}
+ ngx_http_probe_subrequest_wake_parent(r);
+
if (ngx_http_post_request(pr, NULL) != NGX_OK) {
r->main->count++;
ngx_http_terminate_request(r, 0);
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_request_body.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_request_body.c
--- nginx-1.11.2/src/http/ngx_http_request_body.c 2016-05-18 02:48:24.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_request_body.c 2016-08-25 00:20:57.000000000 +0000
@@ -8,6 +8,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <ngx_http_probe.h>
static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
@@ -421,6 +422,8 @@
rb->post_handler(r);
}
+ ngx_http_probe_read_body_done(r);
+
return NGX_OK;
}
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_upstream.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_upstream.c
--- nginx-1.11.2/src/http/ngx_http_upstream.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_upstream.c 2016-08-25 00:20:57.000000000 +0000
@@ -481,12 +481,19 @@
ngx_http_upstream_init(ngx_http_request_t *r)
{
ngx_connection_t *c;
+ ngx_http_upstream_t *u;
c = r->connection;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http init upstream, client timer: %d", c->read->timer_set);
+ u = r->upstream;
+
+ u->connect_timeout = u->conf->connect_timeout;
+ u->send_timeout = u->conf->send_timeout;
+ u->read_timeout = u->conf->read_timeout;
+
#if (NGX_HTTP_V2)
if (r->stream) {
ngx_http_upstream_init_request(r);
@@ -1458,7 +1465,7 @@
u->request_body_sent = 0;
if (rc == NGX_AGAIN) {
- ngx_add_timer(c->write, u->conf->connect_timeout);
+ ngx_add_timer(c->write, u->connect_timeout);
return;
}
@@ -1547,7 +1554,7 @@
if (rc == NGX_AGAIN) {
if (!c->write->timer_set) {
- ngx_add_timer(c->write, u->conf->connect_timeout);
+ ngx_add_timer(c->write, u->connect_timeout);
}
c->ssl->handler = ngx_http_upstream_ssl_handshake;
@@ -1823,7 +1830,7 @@
if (rc == NGX_AGAIN) {
if (!c->write->ready) {
- ngx_add_timer(c->write, u->conf->send_timeout);
+ ngx_add_timer(c->write, u->send_timeout);
} else if (c->write->timer_set) {
ngx_del_timer(c->write);
@@ -1866,7 +1873,7 @@
return;
}
- ngx_add_timer(c->read, u->conf->read_timeout);
+ ngx_add_timer(c->read, u->read_timeout);
if (c->read->ready) {
ngx_http_upstream_process_header(r, u);
@@ -2017,7 +2024,7 @@
#endif
- if (u->header_sent) {
+ if (u->request_body_sent) {
u->write_event_handler = ngx_http_upstream_dummy_handler;
(void) ngx_handle_write_event(c->write, 0);
@@ -2665,7 +2672,7 @@
}
if (rev->active) {
- ngx_add_timer(rev, u->conf->read_timeout);
+ ngx_add_timer(rev, u->read_timeout);
} else if (rev->timer_set) {
ngx_del_timer(rev);
@@ -2989,7 +2996,7 @@
p->cyclic_temp_file = 0;
}
- p->read_timeout = u->conf->read_timeout;
+ p->read_timeout = u->read_timeout;
p->send_timeout = clcf->send_timeout;
p->send_lowat = clcf->send_lowat;
@@ -3246,7 +3253,7 @@
}
if (upstream->write->active && !upstream->write->ready) {
- ngx_add_timer(upstream->write, u->conf->send_timeout);
+ ngx_add_timer(upstream->write, u->send_timeout);
} else if (upstream->write->timer_set) {
ngx_del_timer(upstream->write);
@@ -3258,7 +3265,7 @@
}
if (upstream->read->active && !upstream->read->ready) {
- ngx_add_timer(upstream->read, u->conf->read_timeout);
+ ngx_add_timer(upstream->read, u->read_timeout);
} else if (upstream->read->timer_set) {
ngx_del_timer(upstream->read);
@@ -3451,7 +3458,7 @@
}
if (upstream->read->active && !upstream->read->ready) {
- ngx_add_timer(upstream->read, u->conf->read_timeout);
+ ngx_add_timer(upstream->read, u->read_timeout);
} else if (upstream->read->timer_set) {
ngx_del_timer(upstream->read);
diff -ruN -x '*.orig' nginx-1.11.2/src/http/ngx_http_upstream.h openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_upstream.h
--- nginx-1.11.2/src/http/ngx_http_upstream.h 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/http/ngx_http_upstream.h 2016-08-25 00:20:57.000000000 +0000
@@ -312,6 +312,12 @@
ngx_chain_writer_ctx_t writer;
ngx_http_upstream_conf_t *conf;
+
+#define HAVE_NGX_UPSTREAM_TIMEOUT_FIELDS 1
+ ngx_msec_t connect_timeout;
+ ngx_msec_t send_timeout;
+ ngx_msec_t read_timeout;
+
#if (NGX_HTTP_CACHE)
ngx_array_t *caches;
#endif
diff -ruN -x '*.orig' nginx-1.11.2/src/os/unix/ngx_process_cycle.c openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/os/unix/ngx_process_cycle.c
--- nginx-1.11.2/src/os/unix/ngx_process_cycle.c 2016-11-08 06:32:14.000000000 +0000
+++ openresty-srpm/openresty-1.11.2.1/bundle/nginx-1.11.2/src/os/unix/ngx_process_cycle.c 2016-08-25 00:20:57.000000000 +0000
@@ -1129,7 +1129,7 @@
if (ngx_terminate || ngx_quit) {
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
- exit(0);
+ ngx_worker_process_exit(cycle);
}
if (ngx_reopen) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.