mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 14:55:46 +00:00
* simple_secure_chat: bug fixes
This commit is contained in:
@@ -70,6 +70,7 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
|
||||
// scan contacts DB, for all matching hashes of 'src_hash' (max 4 matches supported ATM)
|
||||
int num = searchPeersByHash(&src_hash);
|
||||
// for each matching contact, try to decrypt data
|
||||
bool found = false;
|
||||
for (int j = 0; j < num; j++) {
|
||||
uint8_t secret[PUB_KEY_SIZE];
|
||||
getPeerSharedSecret(secret, j);
|
||||
@@ -89,9 +90,13 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
|
||||
} else {
|
||||
onPeerDataRecv(pkt, pkt->getPayloadType(), j, data, len);
|
||||
}
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
MESH_DEBUG_PRINTLN("recv matches no peers, src_hash=%02X", (uint32_t)src_hash);
|
||||
}
|
||||
}
|
||||
action = routeRecvPacket(pkt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user