Commit ecfd5930 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Call ConnectBlocker::on_success when connection is established

parent 3c6b75fb
...@@ -194,8 +194,6 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) { ...@@ -194,8 +194,6 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) {
continue; continue;
} }
connect_blocker->on_success();
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
DCLOG(INFO, this) << "Connecting to downstream server"; DCLOG(INFO, this) << "Connecting to downstream server";
} }
...@@ -753,17 +751,20 @@ end: ...@@ -753,17 +751,20 @@ end:
} }
int HttpDownstreamConnection::on_connect() { int HttpDownstreamConnection::on_connect() {
auto connect_blocker = client_handler_->get_http1_connect_blocker();
if (!util::check_socket_connected(fd_)) { if (!util::check_socket_connected(fd_)) {
ev_io_stop(loop_, &wev_); ev_io_stop(loop_, &wev_);
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
DLOG(INFO, this) << "downstream connect failed"; DLOG(INFO, this) << "downstream connect failed";
} }
auto connect_blocker = client_handler_->get_http1_connect_blocker();
connect_blocker->on_failure(); connect_blocker->on_failure();
return -1; return -1;
} }
connect_blocker->on_success();
ev_io_start(loop_, &rev_); ev_io_start(loop_, &rev_);
ev_set_cb(&wev_, writecb); ev_set_cb(&wev_, writecb);
......
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