1
0
mirror of https://github.com/facebook/proxygen.git synced 2026-10-24 01:33:54 +03:00

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
This commit is contained in:
Hani Damlaj
2026-10-18 10:36:38 -07:00
committed by meta-codesync[bot]
parent afe4041c30
commit ded8b91f5d
2 changed files with 1 additions and 117 deletions

View File

@@ -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<HTTPHeaders> HQDownstreamSession::getExtraHeaders(
const HTTPMessage& headers, quic::StreamId streamId) {
if (!sock_) {

View File

@@ -68,8 +68,7 @@ class HQDownstreamSession : public HQSession {
}
uint32_t getNumOutgoingStreams() const override {
// need transport API
return static_cast<uint32_t>(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<HTTPCodec::StreamID> parentTxnId,
uint32_t seqNo,
std::unique_ptr<HTTPCodec> 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<folly::Unit, WebTransport::ErrorCode> 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<quic::StreamId, HQEgressPushStream> 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};
};