mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-20 13:26:03 +00:00
Improve logging
This commit is contained in:
1 parent
89a0569ffe
commit
e33f16f048
2 files changed
+16
No files matched your search
@@ -115,6 +115,14 @@ class InboundNearbyConnection: NearbyConnection {
|
|||||||
case .receivedPairedKeyResult:
|
case .receivedPairedKeyResult:
|
||||||
try processIntroductionFrame(frame)
|
try processIntroductionFrame(frame)
|
||||||
default:
|
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("[InboundNearbyConnection \(self.id)] Unexpected connection state in processTransferSetupFrame: \(currentState)")
|
||||||
log(frame.debugDescription)
|
log(frame.debugDescription)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ class NearbyConnection {
|
|||||||
|
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
|
|
||||||
|
log("[NearbyConnection \(self.id)] Starting connection.")
|
||||||
|
|
||||||
connection.stateUpdateHandler = { state in
|
connection.stateUpdateHandler = { state in
|
||||||
|
|
||||||
if !self.connectionClosed {
|
if !self.connectionClosed {
|
||||||
@@ -425,6 +428,11 @@ class NearbyConnection {
|
|||||||
sendKeepAlive(ack: true)
|
sendKeepAlive(ack: true)
|
||||||
} else {
|
} 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)")
|
log("[NearbyConnection \(self.id)] Unhandled offline frame encrypted: \(offlineFrame)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user