From ded8b91f5d3267be549a728cab5faffb08d04fc4 Mon Sep 17 00:00:00 2001 From: Hani Damlaj Date: Sun, 18 Oct 2026 10:36:38 -0700 Subject: [PATCH] remove `class HQEgressPushStream` & co Summary: removes HQDownstreamSession::HQEgressPushStream, continued efforts to remove all things http push related in proxygen/lib Reviewed By: Carl-Elkhoury, jbeshay Differential Revision: D124403386 fbshipit-source-id: e7f0a14d21df63022b1abe708c5c072f283851b9 --- .../lib/http/session/HQDownstreamSession.cpp | 24 ----- .../lib/http/session/HQDownstreamSession.h | 94 +------------------ 2 files changed, 1 insertion(+), 117 deletions(-) diff --git a/proxygen/lib/http/session/HQDownstreamSession.cpp b/proxygen/lib/http/session/HQDownstreamSession.cpp index 44d1a3809..2b9ff3188 100644 --- a/proxygen/lib/http/session/HQDownstreamSession.cpp +++ b/proxygen/lib/http/session/HQDownstreamSession.cpp @@ -80,30 +80,6 @@ void HQDownstreamSession::detachThreadLocals(bool) { LOG(FATAL) << __func__ << " is an upstream interface"; } -bool HQDownstreamSession::pushAllowedByGoaway(hq::PushId pushId) { - // TODO: This is always true since we ignore client sent GOAWAY right now - return pushId < peerMinUnseenId_; -} - -uint32_t HQDownstreamSession::numberOfEgressPushStreams() const { - return egressPushStreams_.size(); -} - -size_t HQDownstreamSession::HQEgressPushStream::generateStreamPushId() { - // reserve space for max quic interger len - auto result = hq::writeStreamPreface(writeBuf_, pushId_); - CHECK(result.has_value()) - << __func__ << " QUIC integer encoding error value=" << pushId_; - - return *result; -} - -// Return a new push id that can be used for outgoing transactions -hq::PushId HQDownstreamSession::createNewPushId() { - auto newPushId = nextAvailablePushId_++; - return newPushId; -} - folly::Optional HQDownstreamSession::getExtraHeaders( const HTTPMessage& headers, quic::StreamId streamId) { if (!sock_) { diff --git a/proxygen/lib/http/session/HQDownstreamSession.h b/proxygen/lib/http/session/HQDownstreamSession.h index f81f4cf6d..7bd5bb70a 100644 --- a/proxygen/lib/http/session/HQDownstreamSession.h +++ b/proxygen/lib/http/session/HQDownstreamSession.h @@ -68,8 +68,7 @@ class HQDownstreamSession : public HQSession { } uint32_t getNumOutgoingStreams() const override { - // need transport API - return static_cast(numberOfEgressPushStreams()); + return 0; } uint32_t getNumIncomingStreams() const override { @@ -85,103 +84,12 @@ class HQDownstreamSession : public HQSession { CHECK_EQ(getNumStreams(), 0); } -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4250) // inherits 'proxygen::detail::..' via dominance -#endif - - /** - * Server side representation of a push stream - * Does not support ingress - */ - class HQEgressPushStream - : public detail::singlestream::SSEgress - , public HQStreamTransportBase { - public: - HQEgressPushStream(HQSession& session, - quic::StreamId streamId, - hq::PushId pushId, - folly::Optional parentTxnId, - uint32_t seqNo, - std::unique_ptr codec, - const WheelTimerInstance& timeout, - HTTPSessionStats* stats = nullptr, - http2::PriorityUpdate priority = hqDefaultPriority) - : detail::singlestream::SSEgress(streamId), - HQStreamTransportBase(session, - TransportDirection::DOWNSTREAM, - streamId, - seqNo, - timeout, - stats, - priority, - parentTxnId, - hq::UnidirectionalStreamType::PUSH), - pushId_(pushId) { - // Request streams are eagerly initialized - initCodec(std::move(codec), __func__); - // DONT init ingress on egress-only stream - } - - hq::PushId getPushId() const { - return pushId_; - } - - // Unlike request streams and ingres push streams, - // the egress push stream does not have to flush - // ingress queues - void transactionTimeout(HTTPTransaction* txn) noexcept override { - VLOG(4) << __func__ << " txn=" << txn_; - DCHECK(txn == &txn_); - } - - /** - * Write the encoded push id to the egress stream. - */ - size_t generateStreamPushId(); - - // Egress only stream should not pause ingress - void pauseIngress(HTTPTransaction* /* txn */) noexcept override { - VLOG(4) << __func__ - << " Ingress function called on egress-only stream, ignoring"; - } - - // Egress only stream should not pause ingress - void resumeIngress(HTTPTransaction* /* txn */) noexcept override { - VLOG(4) << __func__ - << " Ingress function called on egress-only stream, ignoring"; - } - - folly::Expected sendWTMaxData( - uint64_t /* maxData */) override { - return folly::unit; - } - - private: - hq::PushId pushId_; // The push id in context of which this stream is sent - }; // HQEgressPushStream -#ifdef _MSC_VER -#pragma warning(pop) -#endif - - std::unordered_map egressPushStreams_; - - uint32_t numberOfEgressPushStreams() const; - void dispatchPushStream(quic::StreamId /* pushStreamId */, hq::PushId /* pushId */, size_t /* toConsume */) override { LOG(DFATAL) << "nope"; } - // This is the current method of creating new push IDs. - hq::PushId createNewPushId(); - - bool pushAllowedByGoaway(hq::PushId pushId); - - // Value of the next pushId, used for outgoing push transactions - hq::PushId nextAvailablePushId_{0}; - // Whether or not we have already received an onTransportReady callback. bool transportReadyNotified_{false}; };