diff --git a/NearbyShare/Connection/InboundNearbyConnection.swift b/NearbyShare/Connection/InboundNearbyConnection.swift index 0c858bb..9008348 100644 --- a/NearbyShare/Connection/InboundNearbyConnection.swift +++ b/NearbyShare/Connection/InboundNearbyConnection.swift @@ -115,6 +115,14 @@ class InboundNearbyConnection: NearbyConnection { case .receivedPairedKeyResult: try processIntroductionFrame(frame) default: + if frame.hasV1, frame.v1.hasType, frame.v1.type == .progressUpdate { + // ignore progress updates + return + } + if frame.hasV1, frame.v1.hasType, frame.v1.type == .response, case .accept = frame.v1.connectionResponse.status { + // ignore accept response frame, it is inferred since the other device set up the connection + return + } log("[InboundNearbyConnection \(self.id)] Unexpected connection state in processTransferSetupFrame: \(currentState)") log(frame.debugDescription) } diff --git a/NearbyShare/Connection/NearbyConnection.swift b/NearbyShare/Connection/NearbyConnection.swift index e71bd0b..c3c257b 100644 --- a/NearbyShare/Connection/NearbyConnection.swift +++ b/NearbyShare/Connection/NearbyConnection.swift @@ -65,6 +65,9 @@ class NearbyConnection { func start() { + + log("[NearbyConnection \(self.id)] Starting connection.") + connection.stateUpdateHandler = { state in if !self.connectionClosed { @@ -425,6 +428,11 @@ class NearbyConnection { sendKeepAlive(ack: true) } else { + if offlineFrame.hasV1, offlineFrame.v1.hasType, offlineFrame.v1.type == .bandwidthUpgradeRetry { + // only supporting WiFi for now, ignore upgrade request to other mediums + return + } + log("[NearbyConnection \(self.id)] Unhandled offline frame encrypted: \(offlineFrame)") } }