mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 22:05:59 +00:00
Don't send keepalive too early
This commit is contained in:
1 parent
04e056da02
commit
429069f372
2 files changed
+2
-5
No files matched your search
@@ -657,7 +657,7 @@ class NearbyConnection {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if lastKeepAliveFrameSent.isOlderThan(seconds: ackInterval) {
|
if encryptionDone && lastKeepAliveFrameSent.isOlderThan(seconds: ackInterval) {
|
||||||
sendKeepAlive(ack: false)
|
sendKeepAlive(ack: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -307,10 +307,7 @@ class OutboundNearbyConnection: NearbyConnection {
|
|||||||
guard frame.hasV1, frame.v1.hasType else { throw NearbyError.requiredFieldMissing("offlineFrame.v1.type") }
|
guard frame.hasV1, frame.v1.hasType else { throw NearbyError.requiredFieldMissing("offlineFrame.v1.type") }
|
||||||
|
|
||||||
if frame.v1.type == .keepAlive {
|
if frame.v1.type == .keepAlive {
|
||||||
log("[OutboundNearbyConnection \(self.id)] Received keep-alive while waiting for connection response")
|
log("[OutboundNearbyConnection \(self.id)] Ignoring keep-alive while waiting for connection response")
|
||||||
if frame.v1.hasKeepAlive, !frame.v1.keepAlive.ack {
|
|
||||||
sendKeepAlive(ack: true)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user