diff --git a/Package.swift b/Package.swift index d3f1357..c8ec5a0 100644 --- a/Package.swift +++ b/Package.swift @@ -16,11 +16,12 @@ let package = Package( // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), .package(url: "https://github.com/OperatorFoundation/Chord", from: "0.0.15"), - .package(url: "https://github.com/OperatorFoundation/Datable", from: "3.1.2"), + .package(url: "https://github.com/OperatorFoundation/Datable", from: "3.1.4"), .package(name: "Socket", url: "https://github.com/OperatorFoundation/BlueSocket", from: "1.1.0"), .package(url: "https://github.com/OperatorFoundation/Net", from: "0.0.1"), .package(url: "https://github.com/OperatorFoundation/Transport", from: "2.3.11"), - .package(url: "https://github.com/apple/swift-log.git", from: "1.4.2") + .package(url: "https://github.com/apple/swift-log.git", from: "1.4.2"), + .package(url: "https://github.com/OperatorFoundation/SwiftHexTools.git", from: "1.2.5") ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -28,7 +29,7 @@ let package = Package( .target( name: "TransmissionLinux", dependencies: [ - "Chord", "Socket", "Datable", "Transport", "Net", + "Chord", "Socket", "Datable", "Transport", "Net", "SwiftHexTools", .product(name: "Logging", package: "swift-log") ] ), diff --git a/Sources/TransmissionLinux/TransmissionConnection.swift b/Sources/TransmissionLinux/TransmissionConnection.swift index 44cc849..cc62072 100644 --- a/Sources/TransmissionLinux/TransmissionConnection.swift +++ b/Sources/TransmissionLinux/TransmissionConnection.swift @@ -3,6 +3,7 @@ import Datable import Transport import Logging import SwiftQueue +import SwiftHexTools import Chord import Socket @@ -117,6 +118,7 @@ public class TransmissionConnection: Connection if size == 0 { + if let log = self.log {log.error("transmission read size was zero")} readLock.leave() return nil } @@ -127,11 +129,13 @@ public class TransmissionConnection: Connection buffer = Data(buffer[size..