mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +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
|
||||
}
|
||||
|
||||
if lastKeepAliveFrameSent.isOlderThan(seconds: ackInterval) {
|
||||
if encryptionDone && lastKeepAliveFrameSent.isOlderThan(seconds: ackInterval) {
|
||||
sendKeepAlive(ack: false)
|
||||
}
|
||||
|
||||
|
||||
@@ -307,10 +307,7 @@ class OutboundNearbyConnection: NearbyConnection {
|
||||
guard frame.hasV1, frame.v1.hasType else { throw NearbyError.requiredFieldMissing("offlineFrame.v1.type") }
|
||||
|
||||
if frame.v1.type == .keepAlive {
|
||||
log("[OutboundNearbyConnection \(self.id)] Received keep-alive while waiting for connection response")
|
||||
if frame.v1.hasKeepAlive, !frame.v1.keepAlive.ack {
|
||||
sendKeepAlive(ack: true)
|
||||
}
|
||||
log("[OutboundNearbyConnection \(self.id)] Ignoring keep-alive while waiting for connection response")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user