From 62411f5a6e64bdaa8f85705fe07ecad154009c8d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 14 Jul 2020 01:08:08 +0900 Subject: [PATCH] nghttpx: Set client_handler to special frontend objects --- src/shrpx_client_handler.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 2b6638a6..c4b0be59 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -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(worker_); - case UpstreamAltMode::HEALTHMON: - return std::make_unique(); + case UpstreamAltMode::API: { + auto dconn = std::make_unique(worker_); + dconn->set_client_handler(this); + return dconn; + } + case UpstreamAltMode::HEALTHMON: { + auto dconn = std::make_unique(); + dconn->set_client_handler(this); + return dconn; + } default: break; }