From 2ca3bf7a7e1c9d10e9628488427c04980f9ec3ff Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 May 2016 22:41:24 +0900 Subject: [PATCH 1/2] nghttpx: Fix bug that timeout on h1 backend makes that backend unavailable --- src/shrpx_http_downstream_connection.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index d2251789..7f515872 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -958,7 +958,8 @@ int HttpDownstreamConnection::tls_handshake() { connect_blocker->on_success(); - conn_.timeoutcb = timeoutcb; + ev_set_cb(&conn_.rt, timeoutcb); + ev_set_cb(&conn_.wt, timeoutcb); do_read_ = &HttpDownstreamConnection::read_tls; do_write_ = &HttpDownstreamConnection::write_tls; @@ -1137,7 +1138,8 @@ int HttpDownstreamConnection::connected() { connect_blocker->on_success(); - conn_.timeoutcb = timeoutcb; + ev_set_cb(&conn_.rt, timeoutcb); + ev_set_cb(&conn_.wt, timeoutcb); do_read_ = &HttpDownstreamConnection::read_clear; do_write_ = &HttpDownstreamConnection::write_clear; From f68dc02d6b0aebc509bf4330b750f7842b8382cf Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 May 2016 22:46:56 +0900 Subject: [PATCH 2/2] nghttpx: Remove unused private field from Connection object --- src/shrpx_connection.cc | 3 --- src/shrpx_connection.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index 95e1c320..bc64f1a0 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -61,9 +61,6 @@ Connection::Connection(struct ev_loop *loop, int fd, SSL *ssl, : tls{DefaultMemchunks(mcpool), DefaultPeekMemchunks(mcpool)}, wlimit(loop, &wev, write_limit.rate, write_limit.burst), rlimit(loop, &rev, read_limit.rate, read_limit.burst, this), - writecb(writecb), - readcb(readcb), - timeoutcb(timeoutcb), loop(loop), data(data), fd(fd), diff --git a/src/shrpx_connection.h b/src/shrpx_connection.h index a361e15e..8ce5aa24 100644 --- a/src/shrpx_connection.h +++ b/src/shrpx_connection.h @@ -125,9 +125,6 @@ struct Connection { ev_timer rt; RateLimit wlimit; RateLimit rlimit; - IOCb writecb; - IOCb readcb; - TimerCb timeoutcb; struct ev_loop *loop; void *data; int fd;