mirror of
https://github.com/facebook/proxygen.git
synced 2026-10-24 01:33:54 +03:00
remove HttpTxn::Transport::newPushedTransaction
Summary: As per the previous diff, no one invokes newPushedTransaction on the underlying transport (http/2 or http/3). This removes all derived implementations as we continue work to deprecate http PUSH in proxygen/lib Reviewed By: rohilverma, Carl-Elkhoury Differential Revision: D124150150 fbshipit-source-id: 16f1d167a1c287cbec95aa798a4c2ca829f69cb4
This commit is contained in:
committed by
meta-codesync[bot]
parent
7456d757cf
commit
ffc10bcb6c
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<HTTPMessage>) {
|
||||
}
|
||||
|
||||
@@ -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<hq::PushId> /* pushId */,
|
||||
const HTTPMessage& /* headers */,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user