fix #204 - throw error if sent message is too long

1.2-legacy
Kevin Hester 2020-11-21 08:41:26 +08:00
rodzic 6e2cb723ea
commit 5007019a2e
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -1458,6 +1458,11 @@ class MeshService : Service(), Logging {
// Keep a record of datapackets, so GUIs can show proper chat history
rememberDataPacket(p)
if(p.bytes.size >= MeshProtos.Constants.DATA_PAYLOAD_LEN.number) {
p.status = MessageStatus.ERROR
throw RemoteException("Message too long")
}
if (p.id != 0) { // If we have an ID we can wait for an ack or nak
deleteOldPackets()
sentPackets[p.id] = p

@ -1 +1 @@
Subproject commit a0b8d888961720d70ab7467c94d8fa0687e58020
Subproject commit a36b31a43c53cab8e62ba04dfbb1fdcc9ecfe821