1
0
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:
Andres Suarez
2024-04-14 11:28:32 -07:00
committed by Facebook GitHub Bot
parent 15a554300e
commit 71fac54812
17 changed files with 40 additions and 51 deletions

View File

@ -801,9 +801,8 @@ bool CryptoStreamScheduler::writeCryptoData(PacketBuilderInterface& builder) {
if (!res) {
return cryptoDataWritten;
}
VLOG(4) << "Wrote retransmitted crypto"
<< " offset=" << buffer.offset << " bytes=" << res->len << " "
<< conn_;
VLOG(4) << "Wrote retransmitted crypto" << " offset=" << buffer.offset
<< " bytes=" << res->len << " " << conn_;
cryptoDataWritten = true;
}

View File

@ -970,8 +970,8 @@ QuicTransportBase::setPeekCallbackInternal(
peekCbIt = peekCallbacks_.emplace(id, PeekCallbackData(cb)).first;
}
if (!cb) {
VLOG(10) << "Resetting the peek callback to nullptr "
<< "stream=" << id << " peekCb=" << peekCbIt->second.peekCb;
VLOG(10) << "Resetting the peek callback to nullptr " << "stream=" << id
<< " peekCb=" << peekCbIt->second.peekCb;
}
peekCbIt->second.peekCb = cb;
updatePeekLooper();
@ -2624,8 +2624,7 @@ folly::Expected<folly::Unit, LocalErrorCode> QuicTransportBase::setPingCallback(
if (closeState_ != CloseState::OPEN) {
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
}
VLOG(4) << "Setting ping callback "
<< " cb=" << cb << " " << *this;
VLOG(4) << "Setting ping callback " << " cb=" << cb << " " << *this;
pingCallback_ = cb;
return folly::unit;
@ -2763,8 +2762,8 @@ void QuicTransportBase::scheduleAckTimeout() {
timeMin(conn_->ackStates.maxAckDelay, factoredRtt));
auto timeoutMs = folly::chrono::ceil<std::chrono::milliseconds>(timeout);
VLOG(10) << __func__ << " timeout=" << timeoutMs.count() << "ms"
<< " factoredRtt=" << factoredRtt.count() << "us"
<< " " << *this;
<< " factoredRtt=" << factoredRtt.count() << "us" << " "
<< *this;
scheduleTimeout(&ackTimeout_, timeoutMs);
}
} else {
@ -2993,8 +2992,7 @@ QuicTransportBase::setDatagramCallback(DatagramCallback* cb) {
if (closeState_ != CloseState::OPEN) {
return folly::makeUnexpected(LocalErrorCode::CONNECTION_CLOSED);
}
VLOG(4) << "Setting datagram callback "
<< " cb=" << cb << " " << *this;
VLOG(4) << "Setting datagram callback " << " cb=" << cb << " " << *this;
datagramCallback_ = cb;
updateReadLooper();

View File

@ -1747,8 +1747,7 @@ bool hasAckDataToWrite(const QuicConnectionStateBase& conn) {
WriteDataReason hasNonAckDataToWrite(const QuicConnectionStateBase& conn) {
if (cryptoHasWritableData(conn)) {
VLOG(10) << nodeToString(conn.nodeType)
<< " needs write because of crypto stream"
<< " " << conn;
<< " needs write because of crypto stream" << " " << conn;
return WriteDataReason::CRYPTO_STREAM;
}
if (!conn.oneRttWriteCipher &&

View File

@ -616,8 +616,8 @@ void QuicClientTransport::processUdpPacketData(
}
case QuicFrame::Type::DatagramFrame: {
DatagramFrame& frame = *quicFrame.asDatagramFrame();
VLOG(10) << "Client received datagram data: "
<< "len=" << frame.length << " " << *this;
VLOG(10) << "Client received datagram data: " << "len=" << frame.length
<< " " << *this;
// Datagram isn't retransmittable. But we would like to ack them early.
// So, make Datagram frames count towards ack policy
pktHasRetransmittableData = true;

View File

@ -1424,8 +1424,8 @@ TEST_F(QuicReadCodecTest, KeyUpdateInitiate) {
// Initiate a key update
ASSERT_TRUE(codec->canInitiateKeyUpdate());
ASSERT_TRUE(codec->advanceOneRttReadPhase());
// Set a next read cipher to ensure that key updates are blocked by
// verification not by the lack of the next cipher
//  Set a next read cipher to ensure that key updates are blocked by
// verification not by the lack of the next cipher
codec->setNextOneRttReadCipher(std::make_unique<MockAead>());
// No further key update can be initiated until a packet is received in

View File

@ -244,8 +244,8 @@ TEST(FunctionLooperTest, TimerTickSize) {
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
QuicTimer::SharedPtr pacingTimer =
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
FunctionLooper::Ptr looper(new FunctionLooper(
evb, [&]() {}, LooperType::ReadLooper));
FunctionLooper::Ptr looper(
new FunctionLooper(evb, [&]() {}, LooperType::ReadLooper));
looper->setPacingTimer(std::move(pacingTimer));
EXPECT_EQ(123ms, looper->getTimerTickInterval());
}
@ -255,8 +255,8 @@ TEST(FunctionLooperTest, TimerTickSizeAfterNewEvb) {
auto evb = std::make_shared<FollyQuicEventBase>(&backingEvb);
QuicTimer::SharedPtr pacingTimer =
std::make_shared<HighResQuicTimer>(evb->getBackingEventBase(), 123ms);
FunctionLooper::Ptr looper(new FunctionLooper(
evb, [&]() {}, LooperType::ReadLooper));
FunctionLooper::Ptr looper(
new FunctionLooper(evb, [&]() {}, LooperType::ReadLooper));
looper->setPacingTimer(std::move(pacingTimer));
EXPECT_EQ(123ms, looper->getTimerTickInterval());
looper->detachEventBase();

View File

@ -63,7 +63,7 @@ struct MockAsyncUDPSocket : public FollyQuicAsyncUDPSocket {
MOCK_METHOD(
void,
setAdditionalCmsgsFunc,
(folly::Function<folly::Optional<folly::SocketCmsgMap>()> &&));
(folly::Function<folly::Optional<folly::SocketCmsgMap>()>&&));
MOCK_METHOD(void, setRcvBuf, (int));
MOCK_METHOD(void, setSndBuf, (int));
MOCK_METHOD(int, getTimestamping, ());

View File

@ -69,7 +69,7 @@ class QuicAsyncUDPSocketMock : public QuicAsyncUDPSocket {
MOCK_METHOD(
(void),
setAdditionalCmsgsFunc,
(folly::Function<folly::Optional<folly::SocketCmsgMap>()> &&));
(folly::Function<folly::Optional<folly::SocketCmsgMap>()>&&));
MOCK_METHOD((int), getTimestamping, ());
MOCK_METHOD((void), setReuseAddr, (bool));
MOCK_METHOD((void), setDFAndTurnOffPMTU, (bool));

View File

@ -238,8 +238,7 @@ void Copa::onPacketAcked(const AckEvent& ack) {
} else if (
ack.ackTime - lastCwndDoubleTime_.value() > conn_.lossState.srtt) {
VLOG(10) << __func__ << " doubling cwnd per RTT from=" << cwndBytes_
<< " due to slow start"
<< " " << conn_;
<< " due to slow start" << " " << conn_;
addAndCheckOverflow(cwndBytes_, cwndBytes_);
lastCwndDoubleTime_ = ack.ackTime;
}
@ -340,11 +339,9 @@ uint64_t Copa::getBytesInFlight() const noexcept {
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 {
return false; // not supported

View File

@ -177,11 +177,9 @@ uint64_t NewReno::getBytesInFlight() const noexcept {
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 {
return false; // unsupported

View File

@ -415,8 +415,8 @@ folly::Optional<CongestionController::LossEvent> detectLossPackets(
conn.transportSettings.timeReorderingThreshDivisor;
VLOG(10) << __func__ << " outstanding=" << conn.outstandings.numOutstanding()
<< " largestAcked=" << ackState.largestAckedByPeer.value_or(0)
<< " delayUntilLost=" << delayUntilLost.count() << "us"
<< " " << conn;
<< " delayUntilLost=" << delayUntilLost.count() << "us" << " "
<< conn;
CongestionController::LossEvent lossEvent(lossTime);
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.
VLOG(10) << __func__ << " early retransmit timer outstanding="
<< conn.outstandings.packets.empty() << " delayUntilLost"
<< delayUntilLost.count() << "us"
<< " " << conn;
<< delayUntilLost.count() << "us" << " " << conn;
getLossTime(conn, pnSpace) = delayUntilLost + earliest->metadata.time;
}
if (lossEvent.largestLostPacketNum.hasValue()) {

View File

@ -92,8 +92,7 @@ calculateAlarmDuration(const QuicConnectionStateBase& conn) {
<< " lastSentPacketTime="
<< lastSentPacketTime.time_since_epoch().count()
<< " now=" << now.time_since_epoch().count()
<< " alarm=" << alarmDuration.count() << "us"
<< " deadline="
<< " alarm=" << alarmDuration.count() << "us" << " deadline="
<< (lastSentPacketTime + alarmDuration).time_since_epoch().count()
<< " " << conn;
}

View File

@ -1257,8 +1257,8 @@ void onServerReadDataFromOpen(
}
case QuicFrame::Type::DatagramFrame: {
DatagramFrame& frame = *quicFrame.asDatagramFrame();
VLOG(10) << "Server received datagram data: "
<< " len=" << frame.length;
VLOG(10) << "Server received datagram data: " << " len="
<< frame.length;
// Datagram isn't retransmittable. But we would like to ack them
// early. So, make Datagram frames count towards ack policy
pktHasRetransmittableData = true;

View File

@ -112,8 +112,7 @@ AckEvent processAckFrame(
VLOG(10) << __func__ << " less than all outstanding packets outstanding="
<< conn.outstandings.numOutstanding() << " range=["
<< ackBlockIt->startPacket << ", " << ackBlockIt->endPacket
<< "]"
<< " " << conn;
<< "]" << " " << conn;
ackBlockIt++;
break;
}

View File

@ -37,9 +37,9 @@ struct CongestionControlConfig {
// haven't reached the drain target.
bool drainToTarget{false};
// Used by: Cubic
// If true, exiting hystart switches to additive increase rather than Cubic
// congestion avoidance, similar to Linux kernel behavior.
//  Used by: Cubic
// If true, exiting hystart switches to additive increase rather than Cubic
// congestion avoidance, similar to Linux kernel behavior.
bool additiveIncreaseAfterHystart{false};
// Used by: Cubic

View File

@ -43,8 +43,8 @@ void receiveReadStreamFrameSMHandler(
appendDataToReadBuffer(
stream, StreamBuffer(std::move(frame.data), frame.offset, frame.fin));
if (isAllDataReceived(stream)) {
VLOG(10) << "Open: Transition to Closed"
<< " stream=" << stream.id << " " << stream.conn;
VLOG(10) << "Open: Transition to Closed" << " stream=" << stream.id
<< " " << stream.conn;
stream.recvState = StreamRecvState::Closed;
if (stream.inTerminalStates()) {
stream.conn.streamManager->addClosed(stream.id);

View File

@ -108,7 +108,8 @@ void writeChecksum(
// This is going to point to the beginning of the UDP header
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;
@ -152,8 +153,8 @@ void writeChecksum(
checksum = 0xFFFF;
}
auto* upd_hdr =
(udphdr*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) + sizeof(ethhdr));
auto* upd_hdr = (udphdr*)(packet + (isV6 ? sizeof(ipv6hdr) : sizeof(iphdr)) +
sizeof(ethhdr));
upd_hdr->check = checksum;
}