mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-07-30 14:43:05 +03:00
Introduce quic::Optional
Summary: The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size. For now there is no functional change and this is just a big aliasing diff. Reviewed By: sharmafb Differential Revision: D57633896 fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
This commit is contained in:
committed by
Facebook GitHub Bot
parent
faba3bdea7
commit
aefc9e369b
@ -39,8 +39,7 @@ bool cryptoHasWritableData(const quic::QuicConnectionStateBase& conn) {
|
||||
!conn.cryptoState->oneRttStream.lossBuffer.empty()));
|
||||
}
|
||||
|
||||
std::string optionalToString(
|
||||
const folly::Optional<quic::PacketNum>& packetNum) {
|
||||
std::string optionalToString(const quic::Optional<quic::PacketNum>& packetNum) {
|
||||
if (!packetNum) {
|
||||
return "-";
|
||||
}
|
||||
@ -54,12 +53,12 @@ std::string largestAckScheduledToString(
|
||||
optionalToString(
|
||||
conn.ackStates.initialAckState
|
||||
? conn.ackStates.initialAckState->largestAckScheduled
|
||||
: folly::none),
|
||||
: quic::none),
|
||||
",",
|
||||
optionalToString(
|
||||
conn.ackStates.handshakeAckState
|
||||
? conn.ackStates.handshakeAckState->largestAckScheduled
|
||||
: folly::none),
|
||||
: quic::none),
|
||||
",",
|
||||
optionalToString(conn.ackStates.appDataAckState.largestAckScheduled),
|
||||
"]");
|
||||
@ -72,12 +71,12 @@ std::string largestAckToSendToString(
|
||||
optionalToString(
|
||||
conn.ackStates.initialAckState
|
||||
? largestAckToSend(*conn.ackStates.initialAckState)
|
||||
: folly::none),
|
||||
: quic::none),
|
||||
",",
|
||||
optionalToString(
|
||||
conn.ackStates.handshakeAckState
|
||||
? largestAckToSend(*conn.ackStates.handshakeAckState)
|
||||
: folly::none),
|
||||
: quic::none),
|
||||
",",
|
||||
optionalToString(largestAckToSend(conn.ackStates.appDataAckState)),
|
||||
"]");
|
||||
@ -614,7 +613,7 @@ bool handleStreamBufMetaWritten(
|
||||
|
||||
void updateConnection(
|
||||
QuicConnectionStateBase& conn,
|
||||
folly::Optional<PacketEvent> packetEvent,
|
||||
Optional<PacketEvent> packetEvent,
|
||||
RegularQuicWritePacket packet,
|
||||
TimePoint sentTime,
|
||||
uint32_t encodedSize,
|
||||
@ -1198,7 +1197,7 @@ void writeCloseCommon(
|
||||
QuicAsyncUDPSocket& sock,
|
||||
QuicConnectionStateBase& connection,
|
||||
PacketHeader&& header,
|
||||
folly::Optional<QuicError> closeDetails,
|
||||
Optional<QuicError> closeDetails,
|
||||
const Aead& aead,
|
||||
const PacketNumberCipher& headerCipher) {
|
||||
// close is special, we're going to bypass all the packet sent logic for all
|
||||
@ -1303,7 +1302,7 @@ void writeLongClose(
|
||||
const ConnectionId& srcConnId,
|
||||
const ConnectionId& dstConnId,
|
||||
LongHeader::Types headerType,
|
||||
folly::Optional<QuicError> closeDetails,
|
||||
Optional<QuicError> closeDetails,
|
||||
const Aead& aead,
|
||||
const PacketNumberCipher& headerCipher,
|
||||
QuicVersion version) {
|
||||
@ -1332,7 +1331,7 @@ void writeShortClose(
|
||||
QuicAsyncUDPSocket& sock,
|
||||
QuicConnectionStateBase& connection,
|
||||
const ConnectionId& connId,
|
||||
folly::Optional<QuicError> closeDetails,
|
||||
Optional<QuicError> closeDetails,
|
||||
const Aead& aead,
|
||||
const PacketNumberCipher& headerCipher) {
|
||||
auto header = ShortHeader(
|
||||
|
Reference in New Issue
Block a user