diff --git a/NearbyShare/NearbyConnection.swift b/NearbyShare/NearbyConnection.swift index 8296da1..a4ee167 100644 --- a/NearbyShare/NearbyConnection.swift +++ b/NearbyShare/NearbyConnection.swift @@ -298,9 +298,7 @@ class NearbyConnection{ try processFileChunk(frame: payloadTransfer) } }else if offlineFrame.hasV1 && offlineFrame.v1.hasType, case .keepAlive = offlineFrame.v1.type{ -#if DEBUG log("Sent keep-alive") -#endif sendKeepAlive(ack: true) }else{ log("Unhandled offline frame encrypted: \(offlineFrame)") diff --git a/NearbyShare/NearbyConnectionManager.swift b/NearbyShare/NearbyConnectionManager.swift index 93e2300..ed3ca8a 100644 --- a/NearbyShare/NearbyConnectionManager.swift +++ b/NearbyShare/NearbyConnectionManager.swift @@ -317,21 +317,15 @@ public class NearbyConnectionManager : NSObject, NetServiceDelegate, InboundNear } private func maybeAddFoundDevice(service:NWBrowser.Result){ - #if DEBUG log("found service \(service)") - #endif for interface in service.interfaces{ if case .loopback=interface.type{ - #if DEBUG log("ignoring localhost service") - #endif return } } guard let endpointID=endpointID(for: service) else {return} - #if DEBUG log("service name is valid, endpoint ID \(endpointID)") - #endif var foundService=FoundServiceInfo(service: service) guard case let NWBrowser.Result.Metadata.bonjour(txtRecord)=service.metadata else {return} diff --git a/NearbyShare/OutboundNearbyConnection.swift b/NearbyShare/OutboundNearbyConnection.swift index 95d8820..aee18ac 100644 --- a/NearbyShare/OutboundNearbyConnection.swift +++ b/NearbyShare/OutboundNearbyConnection.swift @@ -79,9 +79,7 @@ class OutboundNearbyConnection:NearbyConnection{ override func processReceivedFrame(frameData: Data) { do{ - #if DEBUG log("received \(frameData), state is \(currentState)") - #endif switch currentState { case .initial: protocolError() @@ -223,9 +221,7 @@ class OutboundNearbyConnection:NearbyConnection{ } private func processConnectionResponse(frame:Location_Nearby_Connections_OfflineFrame) throws{ - #if DEBUG log("connection response: \(frame)") - #endif guard frame.version == .v1 else {throw NearbyError.protocolError("Unexpected offline frame version \(frame.version)")} guard frame.v1.type == .connectionResponse else {throw NearbyError.protocolError("Unexpected frame type \(frame.v1.type)")} guard frame.v1.connectionResponse.response == .accept else {throw NearbyError.protocolError("Connection was rejected by recipient")} @@ -305,9 +301,7 @@ class OutboundNearbyConnection:NearbyConnection{ totalBytesToSend+=meta.size } } - #if DEBUG log("sent introduction: \(introduction)") - #endif try sendTransferSetupFrame(introduction) currentState = .sentIntroduction @@ -354,9 +348,7 @@ class OutboundNearbyConnection:NearbyConnection{ try currentTransfer?.handle?.close() } if queue.isEmpty{ - #if DEBUG log("Disconnecting because all files have been transferred") - #endif try sendDisconnectionAndDisconnect() delegate?.outboundConnectionTransferFinished(connection: self) return @@ -398,9 +390,7 @@ class OutboundNearbyConnection:NearbyConnection{ self.protocolError() } }) - #if DEBUG log("sent file chunk, current transfer: \(String(describing: currentTransfer))") - #endif totalBytesSent+=Int64(fileBuffer.count) delegate?.outboundConnection(connection: self, transferProgress: Double(totalBytesSent)/Double(totalBytesToSend)) @@ -421,9 +411,7 @@ class OutboundNearbyConnection:NearbyConnection{ wrapper.v1.type = .payloadTransfer wrapper.v1.payloadTransfer=transfer try encryptAndSendOfflineFrame(wrapper) - #if DEBUG log("sent EOF, current transfer: \(String(describing: currentTransfer))") - #endif } }