added terminal colors to the output of the util/mirror-tarballs script; also added the upstream_test_connect_kqueue patch for nginx 1.3.7.

This commit is contained in:
agentzh (Yichun Zhang) 2012-11-05 21:59:27 -08:00
parent 7be71ca17b
commit 8950d4655d
3 changed files with 66 additions and 15 deletions

View File

@ -0,0 +1,26 @@
--- nginx-1.3.7/src/http/ngx_http_upstream.c 2012-08-06 10:34:08.000000000 -0700
+++ nginx-1.3.7-patched/src/http/ngx_http_upstream.c 2012-11-05 21:17:38.000000000 -0800
@@ -1808,10 +1808,22 @@ ngx_http_upstream_test_connect(ngx_conne
#if (NGX_HAVE_KQUEUE)
+ ngx_event_t *ev;
+
if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
if (c->write->pending_eof) {
+ ev = c->write;
+
+ } else if (c->read->pending_eof) {
+ ev = c->read;
+
+ } else {
+ ev = NULL;
+ }
+
+ if (ev) {
c->log->action = "connecting to upstream";
- (void) ngx_connection_error(c, c->write->kq_errno,
+ (void) ngx_connection_error(c, ev->kq_errno,
"kevent() reported that connect() failed");
return NGX_ERROR;
}

View File

@ -3,7 +3,11 @@
#root=$(readlink -f -- "$(dirname -- "$0")/..")
root=`perl -MCwd -e'print Cwd::abs_path(shift)' $(dirname -- "$0")/..`
info_txt=`perl -e 'print "\033[33m[INFO]\033[0m"'`
echo -n "ngx_openresty "
. ./util/ver
echo
name=ngx_openresty-$version
work=$root/work
@ -28,20 +32,26 @@ cd nginx-$ver || exit 1
# patch the patch
echo "INFO: applying the upstream-pipelining patch"
echo "$info_txt applying the upstream-pipelining patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-upstream_pipelining.patch || exit 1
echo
echo "$info_txt applying the server_header patch for nginx"
cp $root/patches/nginx-$main_ver-server_header.patch server_header.patch || exit 1
sed $"s/NGINX_VERSION \".unknown\"/NGINX_VERSION \".$minor_ver\"/" server_header.patch \
> server_header.patch.tmp && mv -f server_header.patch.tmp server_header.patch || exit 1
patch -p2 < server_header.patch || exit 1
echo
#patch -p1 < $root/patches/nginx-$main_ver-redirect_memcpy_overlap.patch || exit 1
echo "$info_txt applying the no_error_pages patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-no_error_pages.patch || exit 1
echo
echo "$info_txt applying the no_Werror patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-no_Werror.patch || exit 1
echo
#patch -p1 < $root/patches/nginx-$main_ver-epoll_check_stale_wev.patch || exit 1
@ -61,14 +71,13 @@ patch -p1 < $root/patches/nginx-$main_ver-no_Werror.patch || exit 1
#echo "applying the named_location_clear_mods_ctx patch"
#patch -p1 < $root/patches/nginx-$main_ver-named_location_clear_mods_ctx.patch || exit 1
echo "applying the allow_request_body_updating patch"
echo "$info_txt applying the allow_request_body_updating patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-allow_request_body_updating.patch || exit 1
echo
echo "applying the log_escape_non_ascii patch"
echo "$info_txt applying the log_escape_non_ascii patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-log_escape_non_ascii.patch || exit 1
echo "applying the upstream_test_connect_kqueue patch"
patch -p1 < $root/patches/nginx-$main_ver-upstream_test_connect_kqueue.patch || exit 1
echo
#echo applying reset_wev_handler_in_named_locations.patch ...
#patch -p1 < $root/patches/nginx-$main_ver-reset_wev_handler_in_named_locations.patch || exit 1
@ -78,14 +87,17 @@ patch -p1 < $root/patches/nginx-$main_ver-upstream_test_connect_kqueue.patch ||
answer=`$root/util/ver-ge "$main_ver" 1.2.3`
if [ "$answer" = "N" ]; then
echo applying add_core_vars_polluting_globals.patch ...
echo "$info_txt applying the add_core_vars_polluting_globals patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-add_core_vars_polluting_globals.patch || exit 1
echo
echo applying resolver_debug_log_overflow.patch ...
echo "$info_txt applying the resolver_debug_log_overflow patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-resolver_debug_log_overflow.patch || exit 1
echo
echo applying poll_del_event_at_exit.patch ...
echo "$info_txt applying the poll_del_event_at_exit patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-poll_del_event_at_exit.patch || exit 1
echo
fi
#echo "INFO: applying null-character-fixes patch"
@ -93,17 +105,25 @@ fi
#patch -p1 < $root/patches/nginx-$main_ver-gzip_ok_invalid_read_fix.patch || exit 1
echo applying location_if_inherits_proxy.patch ...
echo "$info_txt applying the location_if_inherits_proxy patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-location_if_inherits_proxy.patch || exit 1
echo
echo applying nonbuffered-upstream-truncation.patch ...
echo "$info_txt applying the nonbuffered-upstream-truncation patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-nonbuffered-upstream-truncation.patch || exit 1
echo
echo applying channel-uninit-params.patch ...
echo "$info_txt applying the channel-uninit-params patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-channel-uninit-params.patch || exit 1
echo
echo applying dtrace.patch ...
echo "$info_txt applying the dtrace patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-dtrace.patch || exit 1
echo
echo "$info_txt applying the upstream_test_connect_kqueue patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-upstream_test_connect_kqueue.patch || exit 1
echo
rm -f *.patch || exit 1
@ -278,8 +298,13 @@ tar -xzf lua-$ver.tar.gz || exit 1
#rm "patch-lua-$ver-4" || exit 1
echo "$info_txt applying the makefile_install_fix patch for lua 5.1"
patch -p0 < $root/patches/lua-$ver-makefile_install_fix.patch || exit 1
echo
echo "$info_txt applying the disable_lua50_compat patch for lua 5.1"
patch -p0 < $root/patches/lua-$ver-disable_lua50_compat.patch || exit 1
echo
#################################

View File

@ -2,7 +2,7 @@
#main_ver=1.3.7
main_ver=1.2.4
minor_ver=7rc1
minor_ver=7rc2
version=$main_ver.$minor_ver
echo $version