From 45e4365dcdaf2bba9147b60f6e0f8a1b4de135bd Mon Sep 17 00:00:00 2001 From: Hani Damlaj Date: Sun, 18 Oct 2026 10:36:38 -0700 Subject: [PATCH] remove `HQSession::cleanupUnboundPushStreams` Summary: removes `HQSession::cleanupUnboundPushStreams`, its override, and its caller, continued efforts to remove all things http push related in proxygen/lib Reviewed By: Carl-Elkhoury, jbeshay Differential Revision: D124393466 fbshipit-source-id: 48dad4045d102ff1ce7164e92845cab5d3c13bda --- proxygen/lib/http/session/HQSession.cpp | 15 +-------------- proxygen/lib/http/session/HQSession.h | 5 +---- proxygen/lib/http/session/HQUpstreamSession.cpp | 10 ---------- proxygen/lib/http/session/HQUpstreamSession.h | 2 -- 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/proxygen/lib/http/session/HQSession.cpp b/proxygen/lib/http/session/HQSession.cpp index dd65831a6..0052dd588 100644 --- a/proxygen/lib/http/session/HQSession.cpp +++ b/proxygen/lib/http/session/HQSession.cpp @@ -1427,30 +1427,17 @@ void HQSession::rejectStream(quic::StreamId id, HTTP3::ErrorCode err) { sock_->setPeekCallback(id, nullptr); } -size_t HQSession::cleanupPendingStreams() { - std::vector streamsToCleanup; - +void HQSession::cleanupPendingStreams() { // Cleanup pending streams in the dispatchers unidirectionalReadDispatcher_.cleanup(); bidirectionalReadDispatcher_.cleanup(); - // These streams have been dispatched as push streams but are missing their - // push promise - cleanupUnboundPushStreams(streamsToCleanup); - - // Clean up the streams by detaching all callbacks - for (auto pendingStreamId : streamsToCleanup) { - clearStreamCallbacks(pendingStreamId); - } - auto pending = std::move(pendingWTStreams_); for (const auto& [_, entry] : pending) { for (auto id : entry->streams) { rejectStream(id, kBufferedRejectedErr); } } - - return streamsToCleanup.size(); } void HQSession::clearStreamCallbacks(quic::StreamId id) { diff --git a/proxygen/lib/http/session/HQSession.h b/proxygen/lib/http/session/HQSession.h index ff4876f47..93356a52b 100644 --- a/proxygen/lib/http/session/HQSession.h +++ b/proxygen/lib/http/session/HQSession.h @@ -770,9 +770,6 @@ class HQSession HQControlStream* createIngressControlStream( quic::StreamId id, hq::UnidirectionalStreamType streamType); - virtual void cleanupUnboundPushStreams(std::vector&) { - } - // gets the ALPN from the transport and returns whether the protocol is // supported. Drops the connection if not supported bool getAndCheckApplicationProtocol(); @@ -1917,7 +1914,7 @@ class HQSession quic::HTTPPriorityQueue httpPriorityQueue_; // Cleanup all pending streams. Invoked in session timeout - size_t cleanupPendingStreams(); + void cleanupPendingStreams(); // Remove all callbacks from a stream during cleanup void clearStreamCallbacks(quic::StreamId /* id */); diff --git a/proxygen/lib/http/session/HQUpstreamSession.cpp b/proxygen/lib/http/session/HQUpstreamSession.cpp index 096381d5e..c08c4ba13 100644 --- a/proxygen/lib/http/session/HQUpstreamSession.cpp +++ b/proxygen/lib/http/session/HQUpstreamSession.cpp @@ -238,14 +238,4 @@ void HQUpstreamSession::eraseUnboundStream(HQStreamTransportBase* hqStream) { ingressPushStreams_.erase(pushId); } -void HQUpstreamSession::cleanupUnboundPushStreams( - std::vector& streamsToCleanup) { - for (auto& it : streamIdToPushId_) { - auto streamId = it.first; - auto pushId = it.second; - if (!ingressPushStreams_.contains(pushId)) { - streamsToCleanup.push_back(streamId); - } - } -} } // namespace proxygen diff --git a/proxygen/lib/http/session/HQUpstreamSession.h b/proxygen/lib/http/session/HQUpstreamSession.h index 061d607ac..80cc1723c 100644 --- a/proxygen/lib/http/session/HQUpstreamSession.h +++ b/proxygen/lib/http/session/HQUpstreamSession.h @@ -205,8 +205,6 @@ class HQUpstreamSession : public HQSession { void eraseUnboundStream(HQStreamTransportBase*) override; - void cleanupUnboundPushStreams(std::vector&) override; - void dispatchPushStream(quic::StreamId /* pushStreamId */, hq::PushId /* pushId */, size_t /* toConsume */) override;