1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-08-08 09:42:06 +03:00

Rename ConnectionCallbackNew back to ConnectionCallback

Summary: Rename ConnectionCallbackNew back to ConnectionCallback

Reviewed By: mjoras

Differential Revision: D33979956

fbshipit-source-id: 6c133a406c4bf6799838ffc36701267a938cb4a3
This commit is contained in:
Konstantin Tsoy
2022-02-23 12:57:31 -08:00
committed by Facebook GitHub Bot
parent 7142abb164
commit a70ffbeb29
24 changed files with 59 additions and 60 deletions

View File

@@ -69,9 +69,9 @@ class QuicSocket {
* Callback for connection level events once connection is set up. * Callback for connection level events once connection is set up.
* The name is temporary until we phase out the old monolithic callback. * The name is temporary until we phase out the old monolithic callback.
*/ */
class ConnectionCallbackNew { class ConnectionCallback {
public: public:
virtual ~ConnectionCallbackNew() = default; virtual ~ConnectionCallback() = default;
/** /**
* Invoked when stream id's flow control state changes. This is an edge * Invoked when stream id's flow control state changes. This is an edge
@@ -223,7 +223,7 @@ class QuicSocket {
* Sets connection streams callback. This callback must be set after * Sets connection streams callback. This callback must be set after
* connection set up is finished and is ready for streams processing. * connection set up is finished and is ready for streams processing.
*/ */
virtual void setConnectionCallbackNew(ConnectionCallbackNew* callback) = 0; virtual void setConnectionCallback(ConnectionCallback* callback) = 0;
/** /**
* Sets the functions that mvfst will invoke to validate early data params * Sets the functions that mvfst will invoke to validate early data params

View File

@@ -2705,8 +2705,7 @@ void QuicTransportBase::setConnectionSetupCallback(
connSetupCallback_ = callback; connSetupCallback_ = callback;
} }
void QuicTransportBase::setConnectionCallbackNew( void QuicTransportBase::setConnectionCallback(ConnectionCallback* callback) {
ConnectionCallbackNew* callback) {
connCallback_ = callback; connCallback_ = callback;
} }

View File

@@ -225,7 +225,7 @@ class QuicTransportBase : public QuicSocket, QuicStreamPrioritiesObserver {
void setConnectionSetupCallback(ConnectionSetupCallback* callback) final; void setConnectionSetupCallback(ConnectionSetupCallback* callback) final;
void setConnectionCallbackNew(ConnectionCallbackNew* callback) final; void setConnectionCallback(ConnectionCallback* callback) final;
void setEarlyDataAppParamsFunctions( void setEarlyDataAppParamsFunctions(
folly::Function<bool(const folly::Optional<std::string>&, const Buf&) folly::Function<bool(const folly::Optional<std::string>&, const Buf&)
@@ -866,7 +866,7 @@ class QuicTransportBase : public QuicSocket, QuicStreamPrioritiesObserver {
std::atomic<folly::EventBase*> evb_; std::atomic<folly::EventBase*> evb_;
std::unique_ptr<folly::AsyncUDPSocket> socket_; std::unique_ptr<folly::AsyncUDPSocket> socket_;
ConnectionSetupCallback* connSetupCallback_{nullptr}; ConnectionSetupCallback* connSetupCallback_{nullptr};
ConnectionCallbackNew* connCallback_{nullptr}; ConnectionCallback* connCallback_{nullptr};
// A flag telling transport if the new onConnectionEnd(error) cb must be used. // A flag telling transport if the new onConnectionEnd(error) cb must be used.
bool useConnectionEndWithErrorCallback_{false}; bool useConnectionEndWithErrorCallback_{false};

View File

@@ -20,7 +20,7 @@ class MockQuicSocket : public QuicSocket {
MockQuicSocket( MockQuicSocket(
folly::EventBase* /*eventBase*/, folly::EventBase* /*eventBase*/,
ConnectionSetupCallback* setupCb, ConnectionSetupCallback* setupCb,
ConnectionCallbackNew* connCb) ConnectionCallback* connCb)
: setupCb_(setupCb), connCb_(connCb) {} : setupCb_(setupCb), connCb_(connCb) {}
MOCK_CONST_METHOD0(good, bool()); MOCK_CONST_METHOD0(good, bool());
@@ -109,7 +109,7 @@ class MockQuicSocket : public QuicSocket {
ReadCallback*, ReadCallback*,
folly::Optional<ApplicationErrorCode> err)); folly::Optional<ApplicationErrorCode> err));
MOCK_METHOD1(setConnectionSetupCallback, void(ConnectionSetupCallback*)); MOCK_METHOD1(setConnectionSetupCallback, void(ConnectionSetupCallback*));
MOCK_METHOD1(setConnectionCallbackNew, void(ConnectionCallbackNew*)); MOCK_METHOD1(setConnectionCallback, void(ConnectionCallback*));
void setEarlyDataAppParamsFunctions( void setEarlyDataAppParamsFunctions(
folly::Function<bool(const folly::Optional<std::string>&, const Buf&) folly::Function<bool(const folly::Optional<std::string>&, const Buf&)
const> validator, const> validator,
@@ -292,7 +292,7 @@ class MockQuicSocket : public QuicSocket {
MOCK_METHOD1(setCongestionControl, void(CongestionControlType)); MOCK_METHOD1(setCongestionControl, void(CongestionControlType));
ConnectionSetupCallback* setupCb_; ConnectionSetupCallback* setupCb_;
ConnectionCallbackNew* connCb_; ConnectionCallback* connCb_;
folly::Function<bool(const folly::Optional<std::string>&, const Buf&)> folly::Function<bool(const folly::Optional<std::string>&, const Buf&)>
earlyDataAppParamsValidator_; earlyDataAppParamsValidator_;

View File

@@ -120,9 +120,9 @@ class MockConnectionSetupCallback : public QuicSocket::ConnectionSetupCallback {
#endif #endif
}; };
class MockConnectionCallbackNew : public QuicSocket::ConnectionCallbackNew { class MockConnectionCallback : public QuicSocket::ConnectionCallback {
public: public:
~MockConnectionCallbackNew() override = default; ~MockConnectionCallback() override = default;
#if defined(MOCK_METHOD) #if defined(MOCK_METHOD)
MOCK_METHOD((void), onFlowControlUpdate, (StreamId), (noexcept)); MOCK_METHOD((void), onFlowControlUpdate, (StreamId), (noexcept));
@@ -240,7 +240,7 @@ class MockQuicTransport : public QuicServerTransport {
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb, ConnectionCallback* connCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx) std::shared_ptr<const fizz::server::FizzServerContext> ctx)
: QuicServerTransport(evb, std::move(sock), connSetupCb, connCb, ctx) {} : QuicServerTransport(evb, std::move(sock), connSetupCb, connCb, ctx) {}

View File

@@ -158,7 +158,7 @@ class QuicStreamAsyncTransportTest : public Test {
std::shared_ptr<QuicServer> server_; std::shared_ptr<QuicServer> server_;
folly::SocketAddress serverAddr_; folly::SocketAddress serverAddr_;
NiceMock<MockConnectionSetupCallback> serverConnectionSetupCB_; NiceMock<MockConnectionSetupCallback> serverConnectionSetupCB_;
NiceMock<MockConnectionCallbackNew> serverConnectionCB_; NiceMock<MockConnectionCallback> serverConnectionCB_;
std::shared_ptr<quic::QuicSocket> serverSocket_; std::shared_ptr<quic::QuicSocket> serverSocket_;
QuicStreamAsyncTransport::UniquePtr serverAsyncWrapper_; QuicStreamAsyncTransport::UniquePtr serverAsyncWrapper_;
folly::test::MockWriteCallback serverWriteCB_; folly::test::MockWriteCallback serverWriteCB_;
@@ -169,7 +169,7 @@ class QuicStreamAsyncTransportTest : public Test {
folly::EventBase clientEvb_; folly::EventBase clientEvb_;
std::thread clientEvbThread_; std::thread clientEvbThread_;
NiceMock<MockConnectionSetupCallback> clientConnectionSetupCB_; NiceMock<MockConnectionSetupCallback> clientConnectionSetupCB_;
NiceMock<MockConnectionCallbackNew> clientConnectionCB_; NiceMock<MockConnectionCallback> clientConnectionCB_;
QuicStreamAsyncTransport::UniquePtr clientAsyncWrapper_; QuicStreamAsyncTransport::UniquePtr clientAsyncWrapper_;
folly::Promise<folly::Unit> startPromise_; folly::Promise<folly::Unit> startPromise_;
folly::test::MockWriteCallback clientWriteCB_; folly::test::MockWriteCallback clientWriteCB_;

View File

@@ -199,10 +199,10 @@ class TestQuicTransport
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> socket, std::unique_ptr<folly::AsyncUDPSocket> socket,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb) ConnectionCallback* connCb)
: QuicTransportBase(evb, std::move(socket)) { : QuicTransportBase(evb, std::move(socket)) {
setConnectionSetupCallback(connSetupCb); setConnectionSetupCallback(connSetupCb);
setConnectionCallbackNew(connCb); setConnectionCallback(connCb);
auto conn = std::make_unique<QuicServerConnectionState>( auto conn = std::make_unique<QuicServerConnectionState>(
FizzServerQuicHandshakeContext::Builder().build()); FizzServerQuicHandshakeContext::Builder().build());
conn->clientConnectionId = ConnectionId({10, 9, 8, 7}); conn->clientConnectionId = ConnectionId({10, 9, 8, 7});
@@ -533,7 +533,7 @@ class QuicTransportImplTest : public Test {
protected: protected:
std::unique_ptr<folly::EventBase> evb; std::unique_ptr<folly::EventBase> evb;
NiceMock<MockConnectionSetupCallback> connSetupCallback; NiceMock<MockConnectionSetupCallback> connSetupCallback;
NiceMock<MockConnectionCallbackNew> connCallback; NiceMock<MockConnectionCallback> connCallback;
TestByteEventCallback byteEventCallback; TestByteEventCallback byteEventCallback;
std::shared_ptr<TestQuicTransport> transport; std::shared_ptr<TestQuicTransport> transport;
folly::test::MockAsyncUDPSocket* socketPtr; folly::test::MockAsyncUDPSocket* socketPtr;

View File

@@ -115,7 +115,7 @@ class QuicTransportTest : public Test {
folly::EventBase evb_; folly::EventBase evb_;
MockAsyncUDPSocket* socket_; MockAsyncUDPSocket* socket_;
NiceMock<MockConnectionSetupCallback> connSetupCallback_; NiceMock<MockConnectionSetupCallback> connSetupCallback_;
NiceMock<MockConnectionCallbackNew> connCallback_; NiceMock<MockConnectionCallback> connCallback_;
NiceMock<MockWriteCallback> writeCallback_; NiceMock<MockWriteCallback> writeCallback_;
MockAead* aead_; MockAead* aead_;
std::unique_ptr<PacketNumberCipher> headerCipher_; std::unique_ptr<PacketNumberCipher> headerCipher_;

View File

@@ -22,10 +22,10 @@ class TestQuicTransport
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> socket, std::unique_ptr<folly::AsyncUDPSocket> socket,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb) ConnectionCallback* connCb)
: QuicTransportBase(evb, std::move(socket)) { : QuicTransportBase(evb, std::move(socket)) {
setConnectionSetupCallback(connSetupCb); setConnectionSetupCallback(connSetupCb);
setConnectionCallbackNew(connCb); setConnectionCallback(connCb);
conn_.reset(new QuicServerConnectionState( conn_.reset(new QuicServerConnectionState(
FizzServerQuicHandshakeContext::Builder().build())); FizzServerQuicHandshakeContext::Builder().build()));
conn_->clientConnectionId = ConnectionId({9, 8, 7, 6}); conn_->clientConnectionId = ConnectionId({9, 8, 7, 6});

View File

@@ -18,7 +18,7 @@ namespace quic {
*/ */
class QuicClientAsyncTransport : public QuicStreamAsyncTransport, class QuicClientAsyncTransport : public QuicStreamAsyncTransport,
public QuicSocket::ConnectionSetupCallback, public QuicSocket::ConnectionSetupCallback,
public QuicSocket::ConnectionCallbackNew { public QuicSocket::ConnectionCallback {
public: public:
using UniquePtr = std::unique_ptr< using UniquePtr = std::unique_ptr<
QuicClientAsyncTransport, QuicClientAsyncTransport,

View File

@@ -1522,7 +1522,7 @@ void QuicClientTransport::
void QuicClientTransport::start( void QuicClientTransport::start(
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb) { ConnectionCallback* connCb) {
if (happyEyeballsEnabled_) { if (happyEyeballsEnabled_) {
// TODO Supply v4 delay amount from somewhere when we want to tune this // TODO Supply v4 delay amount from somewhere when we want to tune this
startHappyEyeballs( startHappyEyeballs(
@@ -1545,7 +1545,7 @@ void QuicClientTransport::start(
} }
setConnectionSetupCallback(connSetupCb); setConnectionSetupCallback(connSetupCb);
setConnectionCallbackNew(connCb); setConnectionCallback(connCb);
clientConn_->pendingOneRttData.reserve( clientConn_->pendingOneRttData.reserve(
conn_->transportSettings.maxPacketsToBuffer); conn_->transportSettings.maxPacketsToBuffer);

View File

@@ -97,7 +97,7 @@ class QuicClientTransport
*/ */
virtual void start( virtual void start(
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb); ConnectionCallback* connCb);
/** /**
* Returns whether or not TLS is resumed. * Returns whether or not TLS is resumed.

View File

@@ -95,7 +95,7 @@ class MockQuicClientTransport : public quic::QuicClientTransport {
std::move(handshakeFactory)), std::move(handshakeFactory)),
testType_(testType) {} testType_(testType) {}
void start(ConnectionSetupCallback* connSetupCb, ConnectionCallbackNew*) void start(ConnectionSetupCallback* connSetupCb, ConnectionCallback*)
override { override {
auto cancelCode = QuicError( auto cancelCode = QuicError(
QuicErrorCode(LocalErrorCode::NO_ERROR), QuicErrorCode(LocalErrorCode::NO_ERROR),

View File

@@ -244,7 +244,7 @@ class QuicClientTransportIntegrationTest : public TestWithParam<TestingParams> {
folly::EventBase eventbase_; folly::EventBase eventbase_;
folly::SocketAddress serverAddr; folly::SocketAddress serverAddr;
NiceMock<MockConnectionSetupCallback> clientConnSetupCallback; NiceMock<MockConnectionSetupCallback> clientConnSetupCallback;
NiceMock<MockConnectionCallbackNew> clientConnCallback; NiceMock<MockConnectionCallback> clientConnCallback;
NiceMock<MockReadCallback> readCb; NiceMock<MockReadCallback> readCb;
std::shared_ptr<TestingQuicClientTransport> client; std::shared_ptr<TestingQuicClientTransport> client;
std::shared_ptr<fizz::server::FizzServerContext> serverCtx; std::shared_ptr<fizz::server::FizzServerContext> serverCtx;
@@ -1052,7 +1052,7 @@ TEST_F(QuicClientTransportTest, onNetworkSwitchReplaceNoHandshake) {
TEST_F(QuicClientTransportTest, SocketClosedDuringOnTransportReady) { TEST_F(QuicClientTransportTest, SocketClosedDuringOnTransportReady) {
class ConnectionCallbackThatWritesOnTransportReady class ConnectionCallbackThatWritesOnTransportReady
: public QuicSocket::ConnectionSetupCallback, : public QuicSocket::ConnectionSetupCallback,
public QuicSocket::ConnectionCallbackNew { public QuicSocket::ConnectionCallback {
public: public:
explicit ConnectionCallbackThatWritesOnTransportReady( explicit ConnectionCallbackThatWritesOnTransportReady(
std::shared_ptr<QuicSocket> socket) std::shared_ptr<QuicSocket> socket)

View File

@@ -540,7 +540,7 @@ class QuicClientTransportTestBase : public virtual testing::Test {
return clientConnSetupCallback; return clientConnSetupCallback;
} }
MockConnectionCallbackNew& getConnCallback() { MockConnectionCallback& getConnCallback() {
return clientConnCallback; return clientConnCallback;
} }
@@ -882,7 +882,7 @@ class QuicClientTransportTestBase : public virtual testing::Test {
testing::NiceMock<MockDeliveryCallback> deliveryCallback; testing::NiceMock<MockDeliveryCallback> deliveryCallback;
testing::NiceMock<MockReadCallback> readCb; testing::NiceMock<MockReadCallback> readCb;
testing::NiceMock<MockConnectionSetupCallback> clientConnSetupCallback; testing::NiceMock<MockConnectionSetupCallback> clientConnSetupCallback;
testing::NiceMock<MockConnectionCallbackNew> clientConnCallback; testing::NiceMock<MockConnectionCallback> clientConnCallback;
folly::test::MockAsyncUDPSocket* sock; folly::test::MockAsyncUDPSocket* sock;
std::shared_ptr<TestingQuicClientTransport::DestructionCallback> std::shared_ptr<TestingQuicClientTransport::DestructionCallback>
destructionCallback; destructionCallback;

View File

@@ -27,7 +27,7 @@
namespace quic { namespace quic {
namespace samples { namespace samples {
class EchoClient : public quic::QuicSocket::ConnectionSetupCallback, class EchoClient : public quic::QuicSocket::ConnectionSetupCallback,
public quic::QuicSocket::ConnectionCallbackNew, public quic::QuicSocket::ConnectionCallback,
public quic::QuicSocket::ReadCallback, public quic::QuicSocket::ReadCallback,
public quic::QuicSocket::WriteCallback { public quic::QuicSocket::WriteCallback {
public: public:

View File

@@ -15,7 +15,7 @@
namespace quic { namespace quic {
namespace samples { namespace samples {
class EchoHandler : public quic::QuicSocket::ConnectionSetupCallback, class EchoHandler : public quic::QuicSocket::ConnectionSetupCallback,
public quic::QuicSocket::ConnectionCallbackNew, public quic::QuicSocket::ConnectionCallback,
public quic::QuicSocket::ReadCallback, public quic::QuicSocket::ReadCallback,
public quic::QuicSocket::WriteCallback { public quic::QuicSocket::WriteCallback {
public: public:

View File

@@ -24,7 +24,7 @@ QuicServerTransport::QuicServerTransport(
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
std::unique_ptr<CryptoFactory> cryptoFactory, std::unique_ptr<CryptoFactory> cryptoFactory,
PacketNum startingPacketNum) PacketNum startingPacketNum)
@@ -42,7 +42,7 @@ QuicServerTransport::QuicServerTransport(
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
std::unique_ptr<CryptoFactory> cryptoFactory, std::unique_ptr<CryptoFactory> cryptoFactory,
bool useConnectionEndWithErrorCallback) bool useConnectionEndWithErrorCallback)
@@ -62,7 +62,7 @@ QuicServerTransport::QuicServerTransport(
conn_->observers = observers_; conn_->observers = observers_;
setConnectionSetupCallback(connSetupCb); setConnectionSetupCallback(connSetupCb);
setConnectionCallbackNew(connStreamsCb); setConnectionCallback(connStreamsCb);
registerAllTransportKnobParamHandlers(); registerAllTransportKnobParamHandlers();
} }
@@ -82,7 +82,7 @@ QuicServerTransport::Ptr QuicServerTransport::make(
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
bool useConnectionEndWithErrorCallback) { bool useConnectionEndWithErrorCallback) {
return std::make_shared<QuicServerTransport>( return std::make_shared<QuicServerTransport>(

View File

@@ -62,7 +62,7 @@ class QuicServerTransport
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
bool useConnectionEndWithErrorCallback = false); bool useConnectionEndWithErrorCallback = false);
@@ -70,7 +70,7 @@ class QuicServerTransport
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
std::unique_ptr<CryptoFactory> cryptoFactory = nullptr, std::unique_ptr<CryptoFactory> cryptoFactory = nullptr,
bool useConnectionEndWithErrorCallback = false); bool useConnectionEndWithErrorCallback = false);
@@ -80,7 +80,7 @@ class QuicServerTransport
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connStreamsCb, ConnectionCallback* connStreamsCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx, std::shared_ptr<const fizz::server::FizzServerContext> ctx,
std::unique_ptr<CryptoFactory> cryptoFactory, std::unique_ptr<CryptoFactory> cryptoFactory,
PacketNum startingPacketNum); PacketNum startingPacketNum);

View File

@@ -13,7 +13,7 @@ namespace quic {
class QuicServerAsyncTransport : public QuicStreamAsyncTransport, class QuicServerAsyncTransport : public QuicStreamAsyncTransport,
public QuicSocket::ConnectionSetupCallback, public QuicSocket::ConnectionSetupCallback,
public QuicSocket::ConnectionCallbackNew { public QuicSocket::ConnectionCallback {
public: public:
using UniquePtr = std::unique_ptr< using UniquePtr = std::unique_ptr<
QuicServerAsyncTransport, QuicServerAsyncTransport,

View File

@@ -314,7 +314,7 @@ TEST(DefaultAppTokenValidatorTest, TestInvalidAppParams) {
conn.statsCallback = quicStats.get(); conn.statsCallback = quicStats.get();
MockConnectionSetupCallback connSetupCallback; MockConnectionSetupCallback connSetupCallback;
MockConnectionCallbackNew connCallback; MockConnectionCallback connCallback;
AppToken appToken; AppToken appToken;
appToken.transportParams = createTicketTransportParameters( appToken.transportParams = createTicketTransportParameters(

View File

@@ -72,7 +72,7 @@ TEST_F(SimpleQuicServerWorkerTest, RejectCid) {
std::make_unique<folly::test::MockAsyncUDPSocket>(&eventbase_); std::make_unique<folly::test::MockAsyncUDPSocket>(&eventbase_);
EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(addr)); EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(addr));
MockConnectionSetupCallback mockConnectionSetupCallback; MockConnectionSetupCallback mockConnectionSetupCallback;
MockConnectionCallbackNew mockConnectionCallback; MockConnectionCallback mockConnectionCallback;
MockQuicTransport::Ptr transportPtr = std::make_shared<MockQuicTransport>( MockQuicTransport::Ptr transportPtr = std::make_shared<MockQuicTransport>(
&eventbase_, &eventbase_,
std::move(mockSock), std::move(mockSock),
@@ -170,7 +170,7 @@ class QuicServerWorkerTest : public Test {
EXPECT_CALL(*socketFactory_, _make(_, _)).WillRepeatedly(Return(nullptr)); EXPECT_CALL(*socketFactory_, _make(_, _)).WillRepeatedly(Return(nullptr));
worker_->setNewConnectionSocketFactory(socketFactory_.get()); worker_->setNewConnectionSocketFactory(socketFactory_.get());
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
std::unique_ptr<folly::test::MockAsyncUDPSocket> mockSock = std::unique_ptr<folly::test::MockAsyncUDPSocket> mockSock =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>( std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(
&eventbase_); &eventbase_);
@@ -547,7 +547,7 @@ TEST_F(QuicServerWorkerTest, RateLimit) {
EXPECT_CALL(*quicStats_, onConnectionRateLimited()).Times(1); EXPECT_CALL(*quicStats_, onConnectionRateLimited()).Times(1);
NiceMock<MockConnectionSetupCallback> connSetupCb1; NiceMock<MockConnectionSetupCallback> connSetupCb1;
NiceMock<MockConnectionCallbackNew> connCb1; NiceMock<MockConnectionCallback> connCb1;
auto mockSock1 = auto mockSock1 =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock1, address()).WillRepeatedly(ReturnRef(fakeAddress_)); EXPECT_CALL(*mockSock1, address()).WillRepeatedly(ReturnRef(fakeAddress_));
@@ -584,7 +584,7 @@ TEST_F(QuicServerWorkerTest, RateLimit) {
auto caddr2 = folly::SocketAddress("2.3.4.5", 1234); auto caddr2 = folly::SocketAddress("2.3.4.5", 1234);
NiceMock<MockConnectionSetupCallback> connSetupCb2; NiceMock<MockConnectionSetupCallback> connSetupCb2;
NiceMock<MockConnectionCallbackNew> connCb2; NiceMock<MockConnectionCallback> connCb2;
auto mockSock2 = auto mockSock2 =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock2, address()).WillRepeatedly(ReturnRef(caddr2)); EXPECT_CALL(*mockSock2, address()).WillRepeatedly(ReturnRef(caddr2));
@@ -643,7 +643,7 @@ TEST_F(QuicServerWorkerTest, UnfinishedHandshakeLimit) {
EXPECT_CALL(*quicStats_, onConnectionRateLimited()).Times(1); EXPECT_CALL(*quicStats_, onConnectionRateLimited()).Times(1);
NiceMock<MockConnectionSetupCallback> connSetupCb1; NiceMock<MockConnectionSetupCallback> connSetupCb1;
NiceMock<MockConnectionCallbackNew> connCb1; NiceMock<MockConnectionCallback> connCb1;
auto mockSock1 = auto mockSock1 =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock1, address()).WillRepeatedly(ReturnRef(fakeAddress_)); EXPECT_CALL(*mockSock1, address()).WillRepeatedly(ReturnRef(fakeAddress_));
@@ -679,7 +679,7 @@ TEST_F(QuicServerWorkerTest, UnfinishedHandshakeLimit) {
auto caddr2 = folly::SocketAddress("2.3.4.5", 1234); auto caddr2 = folly::SocketAddress("2.3.4.5", 1234);
NiceMock<MockConnectionSetupCallback> connSetupCb2; NiceMock<MockConnectionSetupCallback> connSetupCb2;
NiceMock<MockConnectionCallbackNew> connCb2; NiceMock<MockConnectionCallback> connCb2;
auto mockSock2 = auto mockSock2 =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock2, address()).WillRepeatedly(ReturnRef(caddr2)); EXPECT_CALL(*mockSock2, address()).WillRepeatedly(ReturnRef(caddr2));
@@ -734,7 +734,7 @@ TEST_F(QuicServerWorkerTest, UnfinishedHandshakeLimit) {
worker_->onHandshakeFinished(); worker_->onHandshakeFinished();
auto caddr4 = folly::SocketAddress("4.3.4.5", 1234); auto caddr4 = folly::SocketAddress("4.3.4.5", 1234);
NiceMock<MockConnectionSetupCallback> connSetupCb4; NiceMock<MockConnectionSetupCallback> connSetupCb4;
NiceMock<MockConnectionCallbackNew> connCb4; NiceMock<MockConnectionCallback> connCb4;
auto mockSock4 = auto mockSock4 =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock4, address()).WillRepeatedly(ReturnRef(caddr4)); EXPECT_CALL(*mockSock4, address()).WillRepeatedly(ReturnRef(caddr4));
@@ -860,7 +860,7 @@ TEST_F(QuicServerWorkerTest, TestRetryInvalidInitialDstConnId) {
TEST_F(QuicServerWorkerTest, QuicServerWorkerUnbindBeforeCidAvailable) { TEST_F(QuicServerWorkerTest, QuicServerWorkerUnbindBeforeCidAvailable) {
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
auto mockSock = auto mockSock =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(fakeAddress_)); EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(fakeAddress_));
@@ -1041,7 +1041,7 @@ TEST_F(QuicServerWorkerTest, QuicServerNewConnection) {
ConnectionId connId2({2, 4, 5, 6}); ConnectionId connId2({2, 4, 5, 6});
folly::SocketAddress clientAddr2("2.3.4.5", 2345); folly::SocketAddress clientAddr2("2.3.4.5", 2345);
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
auto mockSock = auto mockSock =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_); std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(&eventbase_);
@@ -1430,7 +1430,7 @@ TEST_F(QuicServerWorkerTest, AcceptObserver) {
auto initTestSocketAndTransport = [this]() { auto initTestSocketAndTransport = [this]() {
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
auto mockSock = std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>( auto mockSock = std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(
&eventbase_); &eventbase_);
EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(fakeAddress_)); EXPECT_CALL(*mockSock, address()).WillRepeatedly(ReturnRef(fakeAddress_));
@@ -2092,7 +2092,7 @@ class QuicServerTest : public Test {
std::shared_ptr<MockQuicTransport> transport; std::shared_ptr<MockQuicTransport> transport;
eventBase->runInEventBaseThreadAndWait([&] { eventBase->runInEventBaseThreadAndWait([&] {
NiceMock<MockConnectionSetupCallback> connSetupcb; NiceMock<MockConnectionSetupCallback> connSetupcb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
std::unique_ptr<folly::test::MockAsyncUDPSocket> mockSock = std::unique_ptr<folly::test::MockAsyncUDPSocket> mockSock =
std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>( std::make_unique<NiceMock<folly::test::MockAsyncUDPSocket>>(
eventBase); eventBase);
@@ -2371,7 +2371,7 @@ class QuicServerTakeoverTest : public Test {
folly::Baton<>& baton) { folly::Baton<>& baton) {
std::shared_ptr<MockQuicTransport> transport; std::shared_ptr<MockQuicTransport> transport;
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
auto makeTransport = auto makeTransport =
[&](folly::EventBase* eventBase, [&](folly::EventBase* eventBase,
std::unique_ptr<folly::AsyncUDPSocket>& socket, std::unique_ptr<folly::AsyncUDPSocket>& socket,
@@ -2939,7 +2939,7 @@ TEST_F(QuicServerTest, ZeroRttPacketRoute) {
setUpTransportFactoryForWorkers(evbs); setUpTransportFactoryForWorkers(evbs);
std::shared_ptr<MockQuicTransport> transport; std::shared_ptr<MockQuicTransport> transport;
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
folly::Baton<> b; folly::Baton<> b;
// create payload // create payload
StreamId id = 1; StreamId id = 1;
@@ -3034,7 +3034,7 @@ TEST_F(QuicServerTest, ZeroRttBeforeInitial) {
setUpTransportFactoryForWorkers(evbs); setUpTransportFactoryForWorkers(evbs);
std::shared_ptr<MockQuicTransport> transport; std::shared_ptr<MockQuicTransport> transport;
NiceMock<MockConnectionSetupCallback> connSetupCb; NiceMock<MockConnectionSetupCallback> connSetupCb;
NiceMock<MockConnectionCallbackNew> connCb; NiceMock<MockConnectionCallback> connCb;
folly::Baton<> b; folly::Baton<> b;
// create payload // create payload
StreamId id = 1; StreamId id = 1;

View File

@@ -32,7 +32,7 @@ class TestingQuicServerTransport : public QuicServerTransport {
folly::EventBase* evb, folly::EventBase* evb,
std::unique_ptr<folly::AsyncUDPSocket> sock, std::unique_ptr<folly::AsyncUDPSocket> sock,
ConnectionSetupCallback* connSetupCb, ConnectionSetupCallback* connSetupCb,
ConnectionCallbackNew* connCb, ConnectionCallback* connCb,
std::shared_ptr<const fizz::server::FizzServerContext> ctx) std::shared_ptr<const fizz::server::FizzServerContext> ctx)
: QuicServerTransport( : QuicServerTransport(
evb, evb,
@@ -202,7 +202,7 @@ class QuicServerTransportTestBase : public virtual testing::Test {
return connSetupCallback; return connSetupCallback;
} }
MockConnectionCallbackNew& getConnCallback() { MockConnectionCallback& getConnCallback() {
return connCallback; return connCallback;
} }
@@ -559,7 +559,7 @@ class QuicServerTransportTestBase : public virtual testing::Test {
folly::SocketAddress serverAddr; folly::SocketAddress serverAddr;
folly::SocketAddress clientAddr; folly::SocketAddress clientAddr;
testing::NiceMock<MockConnectionSetupCallback> connSetupCallback; testing::NiceMock<MockConnectionSetupCallback> connSetupCallback;
testing::NiceMock<MockConnectionCallbackNew> connCallback; testing::NiceMock<MockConnectionCallback> connCallback;
testing::NiceMock<MockRoutingCallback> routingCallback; testing::NiceMock<MockRoutingCallback> routingCallback;
testing::NiceMock<MockHandshakeFinishedCallback> handshakeFinishedCallback; testing::NiceMock<MockHandshakeFinishedCallback> handshakeFinishedCallback;
folly::Optional<ConnectionId> clientConnectionId; folly::Optional<ConnectionId> clientConnectionId;

View File

@@ -231,7 +231,7 @@ class TPerfAcceptObserver : public AcceptObserver {
} // namespace } // namespace
class ServerStreamHandler : public quic::QuicSocket::ConnectionSetupCallback, class ServerStreamHandler : public quic::QuicSocket::ConnectionSetupCallback,
public quic::QuicSocket::ConnectionCallbackNew, public quic::QuicSocket::ConnectionCallback,
public quic::QuicSocket::ReadCallback, public quic::QuicSocket::ReadCallback,
public quic::QuicSocket::WriteCallback { public quic::QuicSocket::WriteCallback {
public: public:
@@ -568,7 +568,7 @@ class TPerfServer {
}; };
class TPerfClient : public quic::QuicSocket::ConnectionSetupCallback, class TPerfClient : public quic::QuicSocket::ConnectionSetupCallback,
public quic::QuicSocket::ConnectionCallbackNew, public quic::QuicSocket::ConnectionCallback,
public quic::QuicSocket::ReadCallback, public quic::QuicSocket::ReadCallback,
public quic::QuicSocket::WriteCallback, public quic::QuicSocket::WriteCallback,
public folly::HHWheelTimer::Callback { public folly::HHWheelTimer::Callback {