Add hasReadCipher
Summary:
This is one of the pre-condition of starting d6d probing. Starting d6d once
hasWriterCipher() is too early becaue an overlarge PMTU could potentially
cause the server to send oversized handshake packet and disrupt handshake.
MODIFY
quic/server/QuicServerTransport.cpp
quic/server/QuicServerTransport.cpp
@@ -304,6 +304,11 @@ bool QuicServerTransport::hasWriteCipher() const {
return conn_->oneRttWriteCipher != nullptr;
}
+bool QuicServerTransport::hasReadCipher() const {
+ return conn_->readCodec != nullptr &&
+ conn_->readCodec->getOneRttReadCipher() != nullptr;
+}
+
std::shared_ptr<QuicTransportBase> QuicServerTransport::sharedGuard() {
return shared_from_this();
}

MODIFY
quic/server/QuicServerTransport.h
quic/server/QuicServerTransport.h
@@ -138,6 +138,7 @@ class QuicServerTransport
void maybeNotifyConnectionIdBound();
void maybeWriteNewSessionTicket();
void maybeIssueConnectionIds();
+ bool hasReadCipher() const;
private:
RoutingCallback* routingCb_{nullptr};

Add hasReadCipher

Summary:
This is one of the pre-condition of starting d6d probing. Starting d6d once
hasWriterCipher() is too early becaue an overlarge PMTU could potentially
cause the server to send oversized handshake packet and disrupt handshake.

Reviewed By: yangchi

Differential Revision: D23698784

fbshipit-source-id: f18824a8ef516421832d8cc769f4880a0841e492