diff --git a/quic/api/QuicPacketScheduler.cpp b/quic/api/QuicPacketScheduler.cpp index 689f45d16..32ea0efc8 100644 --- a/quic/api/QuicPacketScheduler.cpp +++ b/quic/api/QuicPacketScheduler.cpp @@ -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; } diff --git a/quic/api/QuicTransportBase.cpp b/quic/api/QuicTransportBase.cpp index d182c9508..259826ba1 100644 --- a/quic/api/QuicTransportBase.cpp +++ b/quic/api/QuicTransportBase.cpp @@ -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 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(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(); diff --git a/quic/api/QuicTransportFunctions.cpp b/quic/api/QuicTransportFunctions.cpp index b48bd49a8..865066e2b 100644 --- a/quic/api/QuicTransportFunctions.cpp +++ b/quic/api/QuicTransportFunctions.cpp @@ -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 && diff --git a/quic/client/QuicClientTransport.cpp b/quic/client/QuicClientTransport.cpp index 567c9c6b9..332e9e1a9 100644 --- a/quic/client/QuicClientTransport.cpp +++ b/quic/client/QuicClientTransport.cpp @@ -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; diff --git a/quic/codec/test/QuicReadCodecTest.cpp b/quic/codec/test/QuicReadCodecTest.cpp index 18e64de38..d8dee6f3f 100644 --- a/quic/codec/test/QuicReadCodecTest.cpp +++ b/quic/codec/test/QuicReadCodecTest.cpp @@ -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()); // No further key update can be initiated until a packet is received in diff --git a/quic/common/test/FunctionLooperTest.cpp b/quic/common/test/FunctionLooperTest.cpp index b11720857..fbd9c122e 100644 --- a/quic/common/test/FunctionLooperTest.cpp +++ b/quic/common/test/FunctionLooperTest.cpp @@ -244,8 +244,8 @@ TEST(FunctionLooperTest, TimerTickSize) { auto evb = std::make_shared(&backingEvb); QuicTimer::SharedPtr pacingTimer = std::make_shared(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(&backingEvb); QuicTimer::SharedPtr pacingTimer = std::make_shared(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(); diff --git a/quic/common/testutil/MockAsyncUDPSocket.h b/quic/common/testutil/MockAsyncUDPSocket.h index 9bdbbed67..8757aeb0c 100644 --- a/quic/common/testutil/MockAsyncUDPSocket.h +++ b/quic/common/testutil/MockAsyncUDPSocket.h @@ -63,7 +63,7 @@ struct MockAsyncUDPSocket : public FollyQuicAsyncUDPSocket { MOCK_METHOD( void, setAdditionalCmsgsFunc, - (folly::Function()> &&)); + (folly::Function()>&&)); MOCK_METHOD(void, setRcvBuf, (int)); MOCK_METHOD(void, setSndBuf, (int)); MOCK_METHOD(int, getTimestamping, ()); diff --git a/quic/common/udpsocket/test/QuicAsyncUDPSocketMock.h b/quic/common/udpsocket/test/QuicAsyncUDPSocketMock.h index 9fd290576..564207083 100644 --- a/quic/common/udpsocket/test/QuicAsyncUDPSocketMock.h +++ b/quic/common/udpsocket/test/QuicAsyncUDPSocketMock.h @@ -69,7 +69,7 @@ class QuicAsyncUDPSocketMock : public QuicAsyncUDPSocket { MOCK_METHOD( (void), setAdditionalCmsgsFunc, - (folly::Function()> &&)); + (folly::Function()>&&)); MOCK_METHOD((int), getTimestamping, ()); MOCK_METHOD((void), setReuseAddr, (bool)); MOCK_METHOD((void), setDFAndTurnOffPMTU, (bool)); diff --git a/quic/congestion_control/Copa.cpp b/quic/congestion_control/Copa.cpp index 41feac169..aca207940 100644 --- a/quic/congestion_control/Copa.cpp +++ b/quic/congestion_control/Copa.cpp @@ -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 diff --git a/quic/congestion_control/NewReno.cpp b/quic/congestion_control/NewReno.cpp index 269202c55..adc963176 100644 --- a/quic/congestion_control/NewReno.cpp +++ b/quic/congestion_control/NewReno.cpp @@ -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 diff --git a/quic/loss/QuicLossFunctions.cpp b/quic/loss/QuicLossFunctions.cpp index d935f8251..5a8da7b8c 100644 --- a/quic/loss/QuicLossFunctions.cpp +++ b/quic/loss/QuicLossFunctions.cpp @@ -415,8 +415,8 @@ folly::Optional 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 observerLossEvent; { @@ -511,8 +511,7 @@ folly::Optional 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()) { diff --git a/quic/loss/QuicLossFunctions.h b/quic/loss/QuicLossFunctions.h index 4542217fb..0a548ba76 100644 --- a/quic/loss/QuicLossFunctions.h +++ b/quic/loss/QuicLossFunctions.h @@ -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; } diff --git a/quic/server/state/ServerStateMachine.cpp b/quic/server/state/ServerStateMachine.cpp index d7f08f4d0..510b6b924 100644 --- a/quic/server/state/ServerStateMachine.cpp +++ b/quic/server/state/ServerStateMachine.cpp @@ -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; diff --git a/quic/state/AckHandlers.cpp b/quic/state/AckHandlers.cpp index bab3ffe02..a10061224 100644 --- a/quic/state/AckHandlers.cpp +++ b/quic/state/AckHandlers.cpp @@ -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; } diff --git a/quic/state/TransportSettings.h b/quic/state/TransportSettings.h index 783f33fec..a928becb7 100644 --- a/quic/state/TransportSettings.h +++ b/quic/state/TransportSettings.h @@ -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 diff --git a/quic/state/stream/StreamReceiveHandlers.cpp b/quic/state/stream/StreamReceiveHandlers.cpp index 405bf2b6b..131f722e2 100644 --- a/quic/state/stream/StreamReceiveHandlers.cpp +++ b/quic/state/stream/StreamReceiveHandlers.cpp @@ -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); diff --git a/quic/xsk/packet_utils.cpp b/quic/xsk/packet_utils.cpp index e95ef5201..3b156a014 100644 --- a/quic/xsk/packet_utils.cpp +++ b/quic/xsk/packet_utils.cpp @@ -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; }