nghttpx: Set client_handler to special frontend objects

This commit is contained in:
Tatsuhiro Tsujikawa 2020-07-14 01:08:08 +09:00
parent e9465f0ee5
commit 62411f5a6e
1 changed files with 10 additions and 4 deletions

View File

@ -902,10 +902,16 @@ ClientHandler::get_downstream_connection(int &err, Downstream *downstream) {
err = 0;
switch (faddr_->alt_mode) {
case UpstreamAltMode::API:
return std::make_unique<APIDownstreamConnection>(worker_);
case UpstreamAltMode::HEALTHMON:
return std::make_unique<HealthMonitorDownstreamConnection>();
case UpstreamAltMode::API: {
auto dconn = std::make_unique<APIDownstreamConnection>(worker_);
dconn->set_client_handler(this);
return dconn;
}
case UpstreamAltMode::HEALTHMON: {
auto dconn = std::make_unique<HealthMonitorDownstreamConnection>();
dconn->set_client_handler(this);
return dconn;
}
default:
break;
}