Process partial frame on end of connection

This commit is contained in:
Leon Böttger authored and Leon Böttger committed 2026-03-08 14:07:48 +01:00
1 parent 48eb5be4a5
commit e68167788a
1 file changed
+7
@@ -217,6 +217,13 @@ class NearbyConnection {
if let content = content, !content.isEmpty {
log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync(length:), and frame not empty. Frame length: \(content.count)")
if content.count == Int(length) {
self.processReceivedFrame(frameData: content)
}
else {
log("[NearbyConnection \(self.id)] Dropping trailing partial frame during connection close. Expected \(length) bytes, got \(content.count)")
}
}
else {
log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync(length:), but no content received anymore (\(String(describing: content))).")