diff --git a/proxygen/lib/http/session/HQDownstreamSession.cpp b/proxygen/lib/http/session/HQDownstreamSession.cpp index e9d6e52c5..7fc8ba67f 100644 --- a/proxygen/lib/http/session/HQDownstreamSession.cpp +++ b/proxygen/lib/http/session/HQDownstreamSession.cpp @@ -139,60 +139,6 @@ HQDownstreamSession::createEgressPushStream(hq::PushId pushId, return &matchPair.first->second; } -// this is the creation of outgoing pushed transaction -HTTPTransaction* FOLLY_NULLABLE HQDownstreamSession::newPushedTransaction( - HTTPCodec::StreamID parentRequestStreamId, - HTTPTransaction::PushHandler* handler, - ProxygenError* error) { - - if (isClosing()) { - VLOG(3) << __func__ << " Not creating transaction - draining "; - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorTransportIsDraining); - return nullptr; - } - - auto parentRequestStream = findNonDetachedStream(parentRequestStreamId); - if (!parentRequestStream) { - VLOG(3) << __func__ - << " Not creating transaction - request stream StreamID=" - << parentRequestStreamId << " not found"; - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorParentStreamNotExist); - return nullptr; - } - - // Allocate a new egress unidirectional stream from the socket - // this method will throw exception on failure - auto pushStreamId = sock_->createUnidirectionalStream(); - - // Record the newly created push transaction in the session - // NOTE: should be stored in the transaction - // NOTE: should be cleaned up when the transaction is closed - if (!pushStreamId) { - VLOG(2) << __func__ << " failed to create new unidirectional stream"; - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorCreatingStream); - return nullptr; - } - - auto pushId = createNewPushId(); - - // Create the actual outgoing Egress Push stream. - auto pushStream = createEgressPushStream( - pushId, pushStreamId.value(), parentRequestStreamId); - - if (!pushStream) { - LOG(ERROR) << "Creation of the push stream failed, pushID=" << pushId; - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorCreatingStream); - return nullptr; - } - - VLOG(4) << "New pushed transaction: pushId=" << pushId - << "; pushStreamId=" << pushStreamId.value() - << "; assocStreamId=" << parentRequestStreamId; - - pushStream->txn_.setHandler(handler); - return &pushStream->txn_; -} - HQSession::HQStreamTransportBase* HQDownstreamSession::findPushStream( quic::StreamId streamId) { return findEgressPushStream(streamId); diff --git a/proxygen/lib/http/session/HQDownstreamSession.h b/proxygen/lib/http/session/HQDownstreamSession.h index fd949b16d..a72f88d80 100644 --- a/proxygen/lib/http/session/HQDownstreamSession.h +++ b/proxygen/lib/http/session/HQDownstreamSession.h @@ -58,11 +58,6 @@ class HQDownstreamSession : public HQSession { bool isReplaySafe() const override { LOG(FATAL) << __func__ << " is an upstream interface"; } - // Create a new pushed transaction. - HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID, /* parentRequestStreamId */ - HTTPTransaction::PushHandler*, /* handler */ - ProxygenError* error = nullptr) override; /** * Returns true iff a new outgoing transaction can be made on this session diff --git a/proxygen/lib/http/session/HQSession.cpp b/proxygen/lib/http/session/HQSession.cpp index 4a9531097..82e0046b7 100644 --- a/proxygen/lib/http/session/HQSession.cpp +++ b/proxygen/lib/http/session/HQSession.cpp @@ -3785,20 +3785,6 @@ void HQSession::HQStreamTransport::sendPushPromise( } } -HTTPTransaction* FOLLY_NULLABLE -HQSession::HQStreamTransport::newPushedTransaction( - HTTPCodec::StreamID parentRequestStreamId, - HTTPTransaction::PushHandler* handler, - ProxygenError* error) noexcept { - - CHECK_EQ(parentRequestStreamId, txn_.getID()); - - return session_.newPushedTransaction( - parentRequestStreamId, // stream id of the egress push stream - handler, - error); -} - void HQSession::HQStreamTransport::onPushPromiseHeadersComplete( hq::PushId, HTTPCodec::StreamID, std::unique_ptr) { } diff --git a/proxygen/lib/http/session/HQSession.h b/proxygen/lib/http/session/HQSession.h index d224f3ce9..3029a8fb5 100644 --- a/proxygen/lib/http/session/HQSession.h +++ b/proxygen/lib/http/session/HQSession.h @@ -635,13 +635,6 @@ class HQSession virtual void eraseUnboundStream(HQStreamTransportBase*) { } - virtual HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID, /* parentRequestStreamId */ - HTTPTransaction::PushHandler*, /* handler */ - ProxygenError*) { - return nullptr; - } - // Callback methods that are invoked by the stream dispatchers void dispatchControlStream(quic::StreamId /* id */, hq::UnidirectionalStreamType /* type */, @@ -1433,14 +1426,6 @@ class HQSession return false; } - HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID /* parentTxnId */, - HTTPTransaction::PushHandler* /* handler */, - ProxygenError* /* error */ = nullptr) noexcept override { - LOG(FATAL) << __func__ << " Only available via request stream"; - folly::assume_unreachable(); - } - std::string getSecurityProtocol() const override { VLOG(4) << __func__ << " txn=" << txn_; return "quic/tls1.3"; @@ -1876,11 +1861,6 @@ class HQSession initIngress(__func__); } - HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID /* parentTxnId */, - HTTPTransaction::PushHandler* /* handler */, - ProxygenError* error = nullptr) noexcept override; - void sendPushPromise(HTTPTransaction* /* txn */, folly::Optional /* pushId */, const HTTPMessage& /* headers */, diff --git a/proxygen/lib/http/session/HTTPSession.cpp b/proxygen/lib/http/session/HTTPSession.cpp index 02889acbc..d0aa99355 100644 --- a/proxygen/lib/http/session/HTTPSession.cpp +++ b/proxygen/lib/http/session/HTTPSession.cpp @@ -555,39 +555,6 @@ void HTTPSession::readErr(const AsyncSocketException& ex) noexcept { shutdownTransport(true, transactions_.empty(), ex.what()); } -HTTPTransaction* HTTPSession::newPushedTransaction( - HTTPCodec::StreamID assocStreamId, - HTTPTransaction::PushHandler* handler, - ProxygenError* error) noexcept { - if (!codec_.supportsPushTransactions()) { - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorPushNotSupported); - return nullptr; - } - CHECK(isDownstream()); - CHECK_NOTNULL(handler); - if (draining_) { - // This session doesn't support any more push transactions - SET_PROXYGEN_ERROR_IF(error, ProxygenError::kErrorTransportIsDraining); - return nullptr; - } - - if (outgoingStreams_ >= maxConcurrentOutgoingStreamsRemote_) { - // This session doesn't support any more push transactions - SET_PROXYGEN_ERROR_IF( - error, ProxygenError::kErrorMaxConcurrentOutgoingStreamLimitReached); - return nullptr; - } - - HTTPTransaction* txn = createTransaction( - codec_.createStream(), assocStreamId, http2::DefaultPriority, error); - if (!txn) { - return nullptr; - } - DestructorGuard dg(this); - txn->setHandler(handler); - return txn; -} - size_t HTTPSession::getCodecSendWindowSize() const { const HTTPSettings* settings = codec_.getIngressSettings(); if (settings) { diff --git a/proxygen/lib/http/session/HTTPSession.h b/proxygen/lib/http/session/HTTPSession.h index f345d0deb..8253d7444 100644 --- a/proxygen/lib/http/session/HTTPSession.h +++ b/proxygen/lib/http/session/HTTPSession.h @@ -461,10 +461,6 @@ class HTTPSession void notifyPendingEgress() noexcept override; void notifyIngressBodyProcessed(uint32_t bytes) noexcept override; void notifyEgressBodyBuffered(int64_t bytes) noexcept override; - HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID assocStreamId, - HTTPTransaction::PushHandler* handler, - ProxygenError* error = nullptr) noexcept override; bool serverEarlyResponseEnabled() const noexcept override { return HTTPSessionBase::getServerEarlyResponseEnabled(); } diff --git a/proxygen/lib/http/session/HTTPTransaction.h b/proxygen/lib/http/session/HTTPTransaction.h index b3718dfcb..ebafa408f 100644 --- a/proxygen/lib/http/session/HTTPTransaction.h +++ b/proxygen/lib/http/session/HTTPTransaction.h @@ -519,11 +519,6 @@ class HTTPTransaction [[nodiscard]] virtual bool isDraining() const = 0; - virtual HTTPTransaction* newPushedTransaction( - HTTPCodec::StreamID assocStreamId, - HTTPTransaction::PushHandler* handler, - ProxygenError* error = nullptr) noexcept = 0; - [[nodiscard]] virtual std::string getSecurityProtocol() const = 0; virtual void addWaitingForReplaySafety(