From 82d9ffa1ad4e181cdfd87a8bb9d5a43e4e0ee3d5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 28 May 2016 22:41:24 +0900 Subject: [PATCH] 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 b6337c7b..f9db8438 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;