Commit 5080db84 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Revert "nghttpx: Reconnect h1 backend if it lost connection before sending headers"

This reverts commit 8a59ce6d.
parent 053c7ac5
...@@ -158,16 +158,6 @@ void backend_retry(Downstream *downstream) { ...@@ -158,16 +158,6 @@ void backend_retry(Downstream *downstream) {
} }
} // namespace } // namespace
namespace {
void retry_readcb(struct ev_loop *loop, ev_io *w, int revents) {
auto conn = static_cast<Connection *>(w->data);
auto dconn = static_cast<HttpDownstreamConnection *>(conn->data);
auto downstream = dconn->get_downstream();
retry_downstream_connection(downstream, 502);
}
} // namespace
namespace { namespace {
void writecb(struct ev_loop *loop, ev_io *w, int revents) { void writecb(struct ev_loop *loop, ev_io *w, int revents) {
int rv; int rv;
...@@ -207,7 +197,7 @@ HttpDownstreamConnection::HttpDownstreamConnection( ...@@ -207,7 +197,7 @@ HttpDownstreamConnection::HttpDownstreamConnection(
struct ev_loop *loop, Worker *worker) struct ev_loop *loop, Worker *worker)
: conn_(loop, -1, nullptr, worker->get_mcpool(), : conn_(loop, -1, nullptr, worker->get_mcpool(),
group->shared_addr->timeout.write, group->shared_addr->timeout.read, group->shared_addr->timeout.write, group->shared_addr->timeout.read,
{}, {}, connectcb, retry_readcb, connect_timeoutcb, this, {}, {}, connectcb, readcb, connect_timeoutcb, this,
get_config()->tls.dyn_rec.warmup_threshold, get_config()->tls.dyn_rec.warmup_threshold,
get_config()->tls.dyn_rec.idle_timeout, Proto::HTTP1), get_config()->tls.dyn_rec.idle_timeout, Proto::HTTP1),
on_read_(&HttpDownstreamConnection::noop), on_read_(&HttpDownstreamConnection::noop),
...@@ -443,10 +433,7 @@ int HttpDownstreamConnection::initiate_connection() { ...@@ -443,10 +433,7 @@ int HttpDownstreamConnection::initiate_connection() {
conn_.again_rt(group_->shared_addr->timeout.read); conn_.again_rt(group_->shared_addr->timeout.read);
} }
// downstream host might close connection while waiting for ev_set_cb(&conn_.rev, readcb);
// request header fields. If it happens, establish new
// connection.
ev_set_cb(&conn_.rev, retry_readcb);
on_write_ = &HttpDownstreamConnection::write_first; on_write_ = &HttpDownstreamConnection::write_first;
first_write_done_ = false; first_write_done_ = false;
...@@ -1179,8 +1166,6 @@ int HttpDownstreamConnection::write_first() { ...@@ -1179,8 +1166,6 @@ int HttpDownstreamConnection::write_first() {
return SHRPX_ERR_RETRY; return SHRPX_ERR_RETRY;
} }
ev_set_cb(&conn_.rev, readcb);
if (conn_.tls.ssl) { if (conn_.tls.ssl) {
on_write_ = &HttpDownstreamConnection::write_tls; on_write_ = &HttpDownstreamConnection::write_tls;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment