mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 19:11:10 +00:00
Process partial frame on end of connection
This commit is contained in:
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))).")
|
||||
|
||||
Reference in new issue
Block a user