Skip to content

Commit

Permalink
checked in the upstream_test_connect_kqueue patch for the nginx 1.2.4…
Browse files Browse the repository at this point in the history
… core and applied it by default.
  • Loading branch information
agentzh committed Nov 6, 2012
1 parent 0602a38 commit 0e72914
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
26 changes: 26 additions & 0 deletions patches/nginx-1.2.4-upstream_test_connect_kqueue.patch
@@ -0,0 +1,26 @@
--- nginx-1.2.4/src/http/ngx_http_upstream.c 2012-08-06 10:34:08.000000000 -0700
+++ nginx-1.2.4-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;
}
3 changes: 3 additions & 0 deletions util/mirror-tarballs
Expand Up @@ -67,6 +67,9 @@ patch -p1 < $root/patches/nginx-$main_ver-allow_request_body_updating.patch || e
echo "applying the log_escape_non_ascii patch"
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 applying reset_wev_handler_in_named_locations.patch ...
#patch -p1 < $root/patches/nginx-$main_ver-reset_wev_handler_in_named_locations.patch || exit 1

Expand Down

0 comments on commit 0e72914

Please sign in to comment.