Fix BLE stream crashes and gossip sync races (#663)

* Handle long BLE packets safely

* Keep BLE stream aligned after partial drops

---------

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
jack
2025-09-23 14:06:13 +02:00
committed by GitHub
co-authored by jack
parent f8f780d2d6
commit 3a94b57341
7 changed files with 424 additions and 59 deletions
+3 -1
View File
@@ -8,7 +8,9 @@ struct InputValidator {
struct Limits {
static let maxNicknameLength = 50
static let maxMessageLength = 10_000
// BinaryProtocol caps payload length at UInt16.max (65_535). Leave headroom
// for headers/padding by limiting user content to 60_000 bytes.
static let maxMessageLength = 60_000
static let maxReasonLength = 200
static let maxPeerIDLength = 64
static let hexPeerIDLength = 16 // 8 bytes = 16 hex chars