clang-format for Switch.cpp
Some checks failed
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled

This commit is contained in:
Lennon Day Reynolds 2025-07-15 15:46:18 -07:00
parent 4e0174cebb
commit 92af3bf7dd

View file

@ -145,12 +145,14 @@ void Switch::onRemotePacket(void* tPtr, const int64_t localSocket, const InetAdd
if (rq->frag0.tryDecode(RR, tPtr, flowId)) { if (rq->frag0.tryDecode(RR, tPtr, flowId)) {
rq->timestamp = 0; // packet decoded, free entry rq->timestamp = 0; // packet decoded, free entry
} else { }
else {
rq->complete = true; // set complete flag but leave entry since it probably needs WHOIS or something rq->complete = true; // set complete flag but leave entry since it probably needs WHOIS or something
Metrics::vl1_reassembly_failed_rx++; Metrics::vl1_reassembly_failed_rx++;
} }
} }
} else { }
else {
// This is a duplicate fragment, ignore // This is a duplicate fragment, ignore
Metrics::vl1_duplicate_fragment_rx++; Metrics::vl1_duplicate_fragment_rx++;
} }
@ -234,7 +236,8 @@ void Switch::onRemotePacket(void* tPtr, const int64_t localSocket, const InetAdd
if (rq->frag0.tryDecode(RR, tPtr, flowId)) { if (rq->frag0.tryDecode(RR, tPtr, flowId)) {
rq->timestamp = 0; // packet decoded, free entry rq->timestamp = 0; // packet decoded, free entry
} else { }
else {
rq->complete = true; // set complete flag but leave entry since it probably needs WHOIS or something rq->complete = true; // set complete flag but leave entry since it probably needs WHOIS or something
Metrics::vl1_reassembly_failed_rx++; Metrics::vl1_reassembly_failed_rx++;
} }
@ -243,11 +246,13 @@ void Switch::onRemotePacket(void* tPtr, const int64_t localSocket, const InetAdd
// Still waiting on more fragments, but keep the head // Still waiting on more fragments, but keep the head
rq->frag0.init(data, len, path, now); rq->frag0.init(data, len, path, now);
} }
} else { }
else {
// This is a duplicate head, ignore // This is a duplicate head, ignore
Metrics::vl1_duplicate_head_rx++; Metrics::vl1_duplicate_head_rx++;
} }
} else { }
else {
// Packet is unfragmented, so just process it // Packet is unfragmented, so just process it
IncomingPacket packet(data, len, path, now); IncomingPacket packet(data, len, path, now);
if (! packet.tryDecode(RR, tPtr, flowId)) { if (! packet.tryDecode(RR, tPtr, flowId)) {
@ -978,7 +983,8 @@ void Switch::doAnythingWaitingForPeer(void* tPtr, const SharedPtr<Peer>& peer)
if ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT) { if ((now - rq->timestamp) > ZT_RECEIVE_QUEUE_TIMEOUT) {
Metrics::vl1_incomplete_reassembly_rx++; Metrics::vl1_incomplete_reassembly_rx++;
} }
} else { }
else {
const Address src(rq->frag0.source()); const Address src(rq->frag0.source());
if (! RR->topology->getPeer(tPtr, src)) { if (! RR->topology->getPeer(tPtr, src)) {
requestWhois(tPtr, now, src); requestWhois(tPtr, now, src);