From c1a496cf4e5369d375aab732f170f3c7cdeef0ce Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 2 Feb 2018 21:09:04 +0900 Subject: [PATCH] nghttpx: Fix bug that h1 backend idle timeout expires sooner --- 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 4fdcb643..f50c0f4f 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -782,8 +782,10 @@ void idle_timeoutcb(struct ev_loop *loop, ev_timer *w, int revents) { auto conn = static_cast(w->data); auto dconn = static_cast(conn->data); - // We don't have to check conn->expired_rt() since we restart timer - // when connection gets idle. + if (w == &conn->rt && !conn->expired_rt()) { + return; + } + if (LOG_ENABLED(INFO)) { DCLOG(INFO, dconn) << "Idle connection timeout"; }