mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-07-30 14:43:05 +03:00
Apply clang-format 18
Summary: Previously this code conformed from clang-format 12. Reviewed By: igorsugak Differential Revision: D56065247 fbshipit-source-id: f5a985dd8f8b84f2f9e1818b3719b43c5a1b05b3
This commit is contained in:
committed by
Facebook GitHub Bot
parent
15a554300e
commit
71fac54812
@ -801,9 +801,8 @@ bool CryptoStreamScheduler::writeCryptoData(PacketBuilderInterface& builder) {
|
|||||||
if (!res) {
|
if (!res) {
|
||||||
return cryptoDataWritten;
|
return cryptoDataWritten;
|
||||||
}
|
}
|
||||||
VLOG(4) << "Wrote retransmitted crypto"
|
VLOG(4) << "Wrote retransmitted crypto" << " offset=" << buffer.offset
|
||||||
<< " offset=" << buffer.offset << " bytes=" << res->len << " "
|
<< " bytes=" << res->len << " " << conn_;
|
||||||
<< conn_;
|
|
||||||
cryptoDataWritten = true;
|
cryptoDataWritten = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -970,8 +970,8 @@ QuicTransportBase::setPeekCallbackInternal(
|
|||||||
peekCbIt = peekCallbacks_.emplace(id, PeekCallbackData(cb)).first;
|
peekCbIt = peekCallbacks_.emplace(id, PeekCallbackData(cb)).first;
|
||||||
}
|
}
|
||||||
if (!cb) {
|
if (!cb) {
|
||||||
VLOG(10) << "Resetting the peek callback to nullptr "
|
VLOG(10) << "Resetting the peek callback to nullptr " << "stream=" << id
|
||||||
<< "stream=" << id << " peekCb=" << peekCbIt->second.peekCb;
|
<< " peekCb=" << peekCbIt->second.peekCb;
|
||||||
}
|
}
|
||||||
peekCbIt->second.peekCb = cb;
|
peekCbIt->second.peekCb = cb;
|
||||||
updatePeekLooper();
|
updatePeekLooper();
|
||||||
@ -2624,8 +2624,7 @@ folly::Expected<folly::Unit, LocalErrorCode> QuicTransportBase::setPingCallback(
|
|||||||
if (closeState_ != CloseState::OPEN) {
|
if (closeState_ != CloseState::OPEN) {
|
||||||
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
|
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
|
||||||
}
|
}
|
||||||
VLOG(4) << "Setting ping callback "
|
VLOG(4) << "Setting ping callback " << " cb=" << cb << " " << *this;
|
||||||
<< " cb=" << cb << " " << *this;
|
|
||||||
|
|
||||||
pingCallback_ = cb;
|
pingCallback_ = cb;
|
||||||
return folly::unit;
|
return folly::unit;
|
||||||
@ -2763,8 +2762,8 @@ void QuicTransportBase::scheduleAckTimeout() {
|
|||||||
timeMin(conn_->ackStates.maxAckDelay, factoredRtt));
|
timeMin(conn_->ackStates.maxAckDelay, factoredRtt));
|
||||||
auto timeoutMs = folly::chrono::ceil<std::chrono::milliseconds>(timeout);
|
auto timeoutMs = folly::chrono::ceil<std::chrono::milliseconds>(timeout);
|
||||||
VLOG(10) << __func__ << " timeout=" << timeoutMs.count() << "ms"
|
VLOG(10) << __func__ << " timeout=" << timeoutMs.count() << "ms"
|
||||||
<< " factoredRtt=" << factoredRtt.count() << "us"
|
<< " factoredRtt=" << factoredRtt.count() << "us" << " "
|
||||||
<< " " << *this;
|
<< *this;
|
||||||
scheduleTimeout(&ackTimeout_, timeoutMs);
|
scheduleTimeout(&ackTimeout_, timeoutMs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -2993,8 +2992,7 @@ QuicTransportBase::setDatagramCallback(DatagramCallback* cb) {
|
|||||||
if (closeState_ != CloseState::OPEN) {
|
if (closeState_ != CloseState::OPEN) {
|
||||||
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
|
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
|
||||||
}
|
}
|
||||||
VLOG(4) << "Setting datagram callback "
|
VLOG(4) << "Setting datagram callback " << " cb=" << cb << " " << *this;
|
||||||
<< " cb=" << cb << " " << *this;
|
|
||||||
|
|
||||||
datagramCallback_ = cb;
|
datagramCallback_ = cb;
|
||||||
updateReadLooper();
|
updateReadLooper();
|
||||||
|
@ -1747,8 +1747,7 @@ bool hasAckDataToWrite(const QuicConnectionStateBase& conn) {
|
|||||||
WriteDataReason hasNonAckDataToWrite(const QuicConnectionStateBase& conn) {
|
WriteDataReason hasNonAckDataToWrite(const QuicConnectionStateBase& conn) {
|
||||||
if (cryptoHasWritableData(conn)) {
|
if (cryptoHasWritableData(conn)) {
|
||||||
VLOG(10) << nodeToString(conn.nodeType)
|
VLOG(10) << nodeToString(conn.nodeType)
|
||||||
<< " needs write because of crypto stream"
|
<< " needs write because of crypto stream" << " " << conn;
|
||||||
<< " " << conn;
|
|
||||||
return WriteDataReason::CRYPTO_STREAM;
|
return WriteDataReason::CRYPTO_STREAM;
|
||||||
}
|
}
|
||||||
if (!conn.oneRttWriteCipher &&
|
if (!conn.oneRttWriteCipher &&
|
||||||
|
@ -616,8 +616,8 @@ void QuicClientTransport::processUdpPacketData(
|
|||||||
}
|
}
|
||||||
case QuicFrame::Type::DatagramFrame: {
|
case QuicFrame::Type::DatagramFrame: {
|
||||||
DatagramFrame& frame = *quicFrame.asDatagramFrame();
|
DatagramFrame& frame = *quicFrame.asDatagramFrame();
|
||||||
VLOG(10) << "Client received datagram data: "
|
VLOG(10) << "Client received datagram data: " << "len=" << frame.length
|
||||||
<< "len=" << frame.length << " " << *this;
|
<< " " << *this;
|
||||||
// Datagram isn't retransmittable. But we would like to ack them early.
|
// Datagram isn't retransmittable. But we would like to ack them early.
|
||||||
// So, make Datagram frames count towards ack policy
|
// So, make Datagram frames count towards ack policy
|
||||||
pktHasRetransmittableData = true;
|
pktHasRetransmittableData = true;
|
||||||
|
@ -1424,8 +1424,8 @@ TEST_F(QuicReadCodecTest, KeyUpdateInitiate) {
|
|||||||
// Initiate a key update
|
// Initiate a key update
|
||||||
ASSERT_TRUE(codec->canInitiateKeyUpdate());
|
ASSERT_TRUE(codec->canInitiateKeyUpdate());
|
||||||
ASSERT_TRUE(codec->advanceOneRttReadPhase());
|
ASSERT_TRUE(codec->advanceOneRttReadPhase());
|
||||||
// Set a next read cipher to ensure that key updates are blocked by
|
// Set a next read cipher to ensure that key updates are blocked by
|
||||||
// verification not by the lack of the next cipher
|
// verification not by the lack of the next cipher
|
||||||
codec->setNextOneRttReadCipher(std::make_unique<MockAead>());
|
codec->setNextOneRttReadCipher(std::make_unique<MockAead>());
|
||||||
|
|
||||||
// No further key update can be initiated until a packet is received in
|
// No further key update can be initiated until a packet is received in
|
||||||
|
@ -244,8 +244,8 @@ TEST(FunctionLooperTest, TimerTickSize) {
|
|||||||
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
|
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
|
||||||
QuicTimer::SharedPtr pacingTimer =
|
QuicTimer::SharedPtr pacingTimer =
|
||||||
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
|
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
|
||||||
FunctionLooper::Ptr looper(new FunctionLooper(
|
FunctionLooper::Ptr looper(
|
||||||
evb, [&]() {}, LooperType::ReadLooper));
|
new FunctionLooper(evb, [&]() {}, LooperType::ReadLooper));
|
||||||
looper->setPacingTimer(std::move(pacingTimer));
|
looper->setPacingTimer(std::move(pacingTimer));
|
||||||
EXPECT_EQ(123ms, looper->getTimerTickInterval());
|
EXPECT_EQ(123ms, looper->getTimerTickInterval());
|
||||||
}
|
}
|
||||||
@ -255,8 +255,8 @@ TEST(FunctionLooperTest, TimerTickSizeAfterNewEvb) {
|
|||||||
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
|
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
|
||||||
QuicTimer::SharedPtr pacingTimer =
|
QuicTimer::SharedPtr pacingTimer =
|
||||||
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
|
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
|
||||||
FunctionLooper::Ptr looper(new FunctionLooper(
|
FunctionLooper::Ptr looper(
|
||||||
evb, [&]() {}, LooperType::ReadLooper));
|
new FunctionLooper(evb, [&]() {}, LooperType::ReadLooper));
|
||||||
looper->setPacingTimer(std::move(pacingTimer));
|
looper->setPacingTimer(std::move(pacingTimer));
|
||||||
EXPECT_EQ(123ms, looper->getTimerTickInterval());
|
EXPECT_EQ(123ms, looper->getTimerTickInterval());
|
||||||
looper->detachEventBase();
|
looper->detachEventBase();
|
||||||
|
@ -63,7 +63,7 @@ struct MockAsyncUDPSocket : public FollyQuicAsyncUDPSocket {
|
|||||||
MOCK_METHOD(
|
MOCK_METHOD(
|
||||||
void,
|
void,
|
||||||
setAdditionalCmsgsFunc,
|
setAdditionalCmsgsFunc,
|
||||||
(folly::Function<folly::Optional<folly::SocketCmsgMap>()> &&));
|
(folly::Function<folly::Optional<folly::SocketCmsgMap>()>&&));
|
||||||
MOCK_METHOD(void, setRcvBuf, (int));
|
MOCK_METHOD(void, setRcvBuf, (int));
|
||||||
MOCK_METHOD(void, setSndBuf, (int));
|
MOCK_METHOD(void, setSndBuf, (int));
|
||||||
MOCK_METHOD(int, getTimestamping, ());
|
MOCK_METHOD(int, getTimestamping, ());
|
||||||
|
@ -69,7 +69,7 @@ class QuicAsyncUDPSocketMock : public QuicAsyncUDPSocket {
|
|||||||
MOCK_METHOD(
|
MOCK_METHOD(
|
||||||
(void),
|
(void),
|
||||||
setAdditionalCmsgsFunc,
|
setAdditionalCmsgsFunc,
|
||||||
(folly::Function<folly::Optional<folly::SocketCmsgMap>()> &&));
|
(folly::Function<folly::Optional<folly::SocketCmsgMap>()>&&));
|
||||||
MOCK_METHOD((int), getTimestamping, ());
|
MOCK_METHOD((int), getTimestamping, ());
|
||||||
MOCK_METHOD((void), setReuseAddr, (bool));
|
MOCK_METHOD((void), setReuseAddr, (bool));
|
||||||
MOCK_METHOD((void), setDFAndTurnOffPMTU, (bool));
|
MOCK_METHOD((void), setDFAndTurnOffPMTU, (bool));
|
||||||
|
@ -238,8 +238,7 @@ void Copa::onPacketAcked(const AckEvent& ack) {
|
|||||||
} else if (
|
} else if (
|
||||||
ack.ackTime - lastCwndDoubleTime_.value() > conn_.lossState.srtt) {
|
ack.ackTime - lastCwndDoubleTime_.value() > conn_.lossState.srtt) {
|
||||||
VLOG(10) << __func__ << " doubling cwnd per RTT from=" << cwndBytes_
|
VLOG(10) << __func__ << " doubling cwnd per RTT from=" << cwndBytes_
|
||||||
<< " due to slow start"
|
<< " due to slow start" << " " << conn_;
|
||||||
<< " " << conn_;
|
|
||||||
addAndCheckOverflow(cwndBytes_, cwndBytes_);
|
addAndCheckOverflow(cwndBytes_, cwndBytes_);
|
||||||
lastCwndDoubleTime_ = ack.ackTime;
|
lastCwndDoubleTime_ = ack.ackTime;
|
||||||
}
|
}
|
||||||
@ -340,11 +339,9 @@ uint64_t Copa::getBytesInFlight() const noexcept {
|
|||||||
return conn_.lossState.inflightBytes;
|
return conn_.lossState.inflightBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Copa::setAppIdle(bool, TimePoint) noexcept { /* unsupported */
|
void Copa::setAppIdle(bool, TimePoint) noexcept { /* unsupported */ }
|
||||||
}
|
|
||||||
|
|
||||||
void Copa::setAppLimited() { /* unsupported */
|
void Copa::setAppLimited() { /* unsupported */ }
|
||||||
}
|
|
||||||
|
|
||||||
bool Copa::isAppLimited() const noexcept {
|
bool Copa::isAppLimited() const noexcept {
|
||||||
return false; // not supported
|
return false; // not supported
|
||||||
|
@ -177,11 +177,9 @@ uint64_t NewReno::getBytesInFlight() const noexcept {
|
|||||||
return conn_.lossState.inflightBytes;
|
return conn_.lossState.inflightBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewReno::setAppIdle(bool, TimePoint) noexcept { /* unsupported */
|
void NewReno::setAppIdle(bool, TimePoint) noexcept { /* unsupported */ }
|
||||||
}
|
|
||||||
|
|
||||||
void NewReno::setAppLimited() { /* unsupported */
|
void NewReno::setAppLimited() { /* unsupported */ }
|
||||||
}
|
|
||||||
|
|
||||||
bool NewReno::isAppLimited() const noexcept {
|
bool NewReno::isAppLimited() const noexcept {
|
||||||
return false; // unsupported
|
return false; // unsupported
|
||||||
|
@ -415,8 +415,8 @@ folly::Optional<CongestionController::LossEvent> detectLossPackets(
|
|||||||
conn.transportSettings.timeReorderingThreshDivisor;
|
conn.transportSettings.timeReorderingThreshDivisor;
|
||||||
VLOG(10) << __func__ << " outstanding=" << conn.outstandings.numOutstanding()
|
VLOG(10) << __func__ << " outstanding=" << conn.outstandings.numOutstanding()
|
||||||
<< " largestAcked=" << ackState.largestAckedByPeer.value_or(0)
|
<< " largestAcked=" << ackState.largestAckedByPeer.value_or(0)
|
||||||
<< " delayUntilLost=" << delayUntilLost.count() << "us"
|
<< " delayUntilLost=" << delayUntilLost.count() << "us" << " "
|
||||||
<< " " << conn;
|
<< conn;
|
||||||
CongestionController::LossEvent lossEvent(lossTime);
|
CongestionController::LossEvent lossEvent(lossTime);
|
||||||
folly::Optional<SocketObserverInterface::LossEvent> observerLossEvent;
|
folly::Optional<SocketObserverInterface::LossEvent> observerLossEvent;
|
||||||
{
|
{
|
||||||
@ -511,8 +511,7 @@ folly::Optional<CongestionController::LossEvent> detectLossPackets(
|
|||||||
// are unacked, so we can set the early retransmit timer for them.
|
// are unacked, so we can set the early retransmit timer for them.
|
||||||
VLOG(10) << __func__ << " early retransmit timer outstanding="
|
VLOG(10) << __func__ << " early retransmit timer outstanding="
|
||||||
<< conn.outstandings.packets.empty() << " delayUntilLost"
|
<< conn.outstandings.packets.empty() << " delayUntilLost"
|
||||||
<< delayUntilLost.count() << "us"
|
<< delayUntilLost.count() << "us" << " " << conn;
|
||||||
<< " " << conn;
|
|
||||||
getLossTime(conn, pnSpace) = delayUntilLost + earliest->metadata.time;
|
getLossTime(conn, pnSpace) = delayUntilLost + earliest->metadata.time;
|
||||||
}
|
}
|
||||||
if (lossEvent.largestLostPacketNum.hasValue()) {
|
if (lossEvent.largestLostPacketNum.hasValue()) {
|
||||||
|
@ -92,8 +92,7 @@ calculateAlarmDuration(const QuicConnectionStateBase& conn) {
|
|||||||
<< " lastSentPacketTime="
|
<< " lastSentPacketTime="
|
||||||
<< lastSentPacketTime.time_since_epoch().count()
|
<< lastSentPacketTime.time_since_epoch().count()
|
||||||
<< " now=" << now.time_since_epoch().count()
|
<< " now=" << now.time_since_epoch().count()
|
||||||
<< " alarm=" << alarmDuration.count() << "us"
|
<< " alarm=" << alarmDuration.count() << "us" << " deadline="
|
||||||
<< " deadline="
|
|
||||||
<< (lastSentPacketTime + alarmDuration).time_since_epoch().count()
|
<< (lastSentPacketTime + alarmDuration).time_since_epoch().count()
|
||||||
<< " " << conn;
|
<< " " << conn;
|
||||||
}
|
}
|
||||||
|
@ -1257,8 +1257,8 @@ void onServerReadDataFromOpen(
|
|||||||
}
|
}
|
||||||
case QuicFrame::Type::DatagramFrame: {
|
case QuicFrame::Type::DatagramFrame: {
|
||||||
DatagramFrame& frame = *quicFrame.asDatagramFrame();
|
DatagramFrame& frame = *quicFrame.asDatagramFrame();
|
||||||
VLOG(10) << "Server received datagram data: "
|
VLOG(10) << "Server received datagram data: " << " len="
|
||||||
<< " len=" << frame.length;
|
<< frame.length;
|
||||||
// Datagram isn't retransmittable. But we would like to ack them
|
// Datagram isn't retransmittable. But we would like to ack them
|
||||||
// early. So, make Datagram frames count towards ack policy
|
// early. So, make Datagram frames count towards ack policy
|
||||||
pktHasRetransmittableData = true;
|
pktHasRetransmittableData = true;
|
||||||
|
@ -112,8 +112,7 @@ AckEvent processAckFrame(
|
|||||||
VLOG(10) << __func__ << " less than all outstanding packets outstanding="
|
VLOG(10) << __func__ << " less than all outstanding packets outstanding="
|
||||||
<< conn.outstandings.numOutstanding() << " range=["
|
<< conn.outstandings.numOutstanding() << " range=["
|
||||||
<< ackBlockIt->startPacket << ", " << ackBlockIt->endPacket
|
<< ackBlockIt->startPacket << ", " << ackBlockIt->endPacket
|
||||||
<< "]"
|
<< "]" << " " << conn;
|
||||||
<< " " << conn;
|
|
||||||
ackBlockIt++;
|
ackBlockIt++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ struct CongestionControlConfig {
|
|||||||
// haven't reached the drain target.
|
// haven't reached the drain target.
|
||||||
bool drainToTarget{false};
|
bool drainToTarget{false};
|
||||||
|
|
||||||
// Used by: Cubic
|
// Used by: Cubic
|
||||||
// If true, exiting hystart switches to additive increase rather than Cubic
|
// If true, exiting hystart switches to additive increase rather than Cubic
|
||||||
// congestion avoidance, similar to Linux kernel behavior.
|
// congestion avoidance, similar to Linux kernel behavior.
|
||||||
bool additiveIncreaseAfterHystart{false};
|
bool additiveIncreaseAfterHystart{false};
|
||||||
|
|
||||||
// Used by: Cubic
|
// Used by: Cubic
|
||||||
|
@ -43,8 +43,8 @@ void receiveReadStreamFrameSMHandler(
|
|||||||
appendDataToReadBuffer(
|
appendDataToReadBuffer(
|
||||||
stream, StreamBuffer(std::move(frame.data), frame.offset, frame.fin));
|
stream, StreamBuffer(std::move(frame.data), frame.offset, frame.fin));
|
||||||
if (isAllDataReceived(stream)) {
|
if (isAllDataReceived(stream)) {
|
||||||
VLOG(10) << "Open: Transition to Closed"
|
VLOG(10) << "Open: Transition to Closed" << " stream=" << stream.id
|
||||||
<< " stream=" << stream.id << " " << stream.conn;
|
<< " " << stream.conn;
|
||||||
stream.recvState = StreamRecvState::Closed;
|
stream.recvState = StreamRecvState::Closed;
|
||||||
if (stream.inTerminalStates()) {
|
if (stream.inTerminalStates()) {
|
||||||
stream.conn.streamManager->addClosed(stream.id);
|
stream.conn.streamManager->addClosed(stream.id);
|
||||||
|
@ -108,7 +108,8 @@ void writeChecksum(
|
|||||||
|
|
||||||
// This is going to point to the beginning of the UDP header
|
// This is going to point to the beginning of the UDP header
|
||||||
auto* payload =
|
auto* payload =
|
||||||
(uint32_t*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) + sizeof(ethhdr));
|
(uint32_t*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) +
|
||||||
|
sizeof(ethhdr));
|
||||||
|
|
||||||
uint64_t sum = (len + 17) << 8;
|
uint64_t sum = (len + 17) << 8;
|
||||||
|
|
||||||
@ -152,8 +153,8 @@ void writeChecksum(
|
|||||||
checksum = 0xFFFF;
|
checksum = 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* upd_hdr =
|
auto* upd_hdr = (udphdr*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) +
|
||||||
(udphdr*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) + sizeof(ethhdr));
|
sizeof(ethhdr));
|
||||||
upd_hdr->check = checksum;
|
upd_hdr->check = checksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user