From 8eee8ac3673e196fce2a1a05056266c013fc5f5e Mon Sep 17 00:00:00 2001 From: Emil Hesslow Date: Thu, 28 Sep 2023 10:07:44 -0700 Subject: [PATCH] Back out "Manage RevproxyController lifetime with shared_ptr" Reviewed By: jano Differential Revision: D49715876 fbshipit-source-id: 46ebcf7b24c54f8bd9370bd363d7d5e5bf710632 --- proxygen/lib/http/session/HTTPSessionAcceptor.cpp | 4 ++-- proxygen/lib/http/session/HTTPSessionAcceptor.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proxygen/lib/http/session/HTTPSessionAcceptor.cpp b/proxygen/lib/http/session/HTTPSessionAcceptor.cpp index 4dd1b9a288..fd025cdafd 100644 --- a/proxygen/lib/http/session/HTTPSessionAcceptor.cpp +++ b/proxygen/lib/http/session/HTTPSessionAcceptor.cpp @@ -30,7 +30,7 @@ HTTPSessionAcceptor::HTTPSessionAcceptor( std::shared_ptr codecFactory) : HTTPAcceptor(accConfig), codecFactory_(codecFactory), - simpleController_(std::make_shared(this)) { + simpleController_(this) { if (!codecFactory_) { codecFactory_ = std::make_shared(accConfig_); @@ -98,7 +98,7 @@ void HTTPSessionAcceptor::onNewConnection(folly::AsyncTransport::UniquePtr sock, std::move(sock), localAddress, *peerAddress, - controller.get(), + controller, std::move(codec), tinfo, sessionInfoCb); diff --git a/proxygen/lib/http/session/HTTPSessionAcceptor.h b/proxygen/lib/http/session/HTTPSessionAcceptor.h index 9c5cadda54..b2c1415e43 100644 --- a/proxygen/lib/http/session/HTTPSessionAcceptor.h +++ b/proxygen/lib/http/session/HTTPSessionAcceptor.h @@ -100,8 +100,8 @@ class HTTPSessionAcceptor * override this function to provide their own more sophisticated * controller here. */ - virtual std::shared_ptr getController() { - return simpleController_; + virtual HTTPSessionController* getController() { + return &simpleController_; } HTTPSessionStats* downstreamSessionStats_{nullptr}; @@ -136,7 +136,7 @@ class HTTPSessionAcceptor std::shared_ptr codecFactory_{}; - std::shared_ptr simpleController_; + SimpleController simpleController_; HTTPSession::InfoCallback* sessionInfoCb_{nullptr};