Skip to content

Commit 0535919

Browse files
author
Scott Powell
committed
* Mesh: reciprocal path send now with slightly less priority and 500ms delay
1 parent 75503ed commit 0535919

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Mesh.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
142142
if (pkt->isRouteFlood()) {
143143
// send a reciprocal return path to sender, but send DIRECTLY!
144144
mesh::Packet* rpath = createPathReturn(&src_hash, secret, pkt->path, pkt->path_len, 0, NULL, 0);
145-
if (rpath) sendDirect(rpath, path, path_len);
145+
if (rpath) sendDirect(rpath, path, path_len, 500);
146146
}
147147
}
148148
} else {
@@ -518,7 +518,11 @@ void Mesh::sendDirect(Packet* packet, const uint8_t* path, uint8_t path_len, uin
518518
pri = 5; // maybe make this configurable
519519
} else {
520520
memcpy(packet->path, path, packet->path_len = path_len);
521-
pri = 0;
521+
if (packet->getPayloadType() == PAYLOAD_TYPE_PATH) {
522+
pri = 1; // slightly less priority
523+
} else {
524+
pri = 0;
525+
}
522526
}
523527
_tables->hasSeen(packet); // mark this packet as already sent in case it is rebroadcast back to us
524528
sendPacket(packet, pri, delay_millis);

0 commit comments

Comments
 (0)