mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 14:26:01 +00:00
Fix: Connection not cleaned up after FIN was sent
This commit is contained in:
1 parent
4ae1663779
commit
dda001cb1a
5 files changed
+6
-2
No files matched your search
@@ -164,6 +164,8 @@ class NearbyConnection {
|
||||
private func receiveFrameAsync() {
|
||||
connection.receive(minimumIncompleteLength: 4, maximumLength: 4) { content, _, isComplete, error in
|
||||
if self.connectionClosed {
|
||||
log("[NearbyConnection \(self.id)] Received FIN from peer, connection closed.")
|
||||
self.connection.cancel()
|
||||
return
|
||||
}
|
||||
if isComplete {
|
||||
@@ -201,6 +203,8 @@ class NearbyConnection {
|
||||
private func receiveFrameAsync(length: UInt32) {
|
||||
connection.receive(minimumIncompleteLength: Int(length), maximumLength: Int(length)) { [self] content, _, isComplete, _ in
|
||||
if self.connectionClosed {
|
||||
log("[NearbyConnection \(self.id)] Received FIN from peer, connection closed.")
|
||||
connection.cancel()
|
||||
return
|
||||
}
|
||||
if isComplete {
|
||||
|
||||
Reference in new issue
Block a user