* check for 'early receive' ACK

This commit is contained in:
Scott Powell
2025-12-27 20:46:28 +11:00
parent 0c3fb918b2
commit 90d1e87ba1

View File

@@ -78,6 +78,16 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
}
if (pkt->isRouteDirect() && pkt->path_len >= PATH_HASH_SIZE) {
// check for 'early received' ACK
if (pkt->getPayloadType() == PAYLOAD_TYPE_ACK) {
int i = 0;
uint32_t ack_crc;
memcpy(&ack_crc, &pkt->payload[i], 4); i += 4;
if (i <= pkt->payload_len) {
onAckRecv(pkt, ack_crc);
}
}
if (self_id.isHashMatch(pkt->path) && allowPacketForward(pkt)) {
if (pkt->getPayloadType() == PAYLOAD_TYPE_MULTIPART) {
return forwardMultipartDirect(pkt);