diff --git a/Sources/SwiftlyCore/HTTPClient.swift b/Sources/SwiftlyCore/HTTPClient.swift index e2486ca8..244afedc 100644 --- a/Sources/SwiftlyCore/HTTPClient.swift +++ b/Sources/SwiftlyCore/HTTPClient.swift @@ -166,9 +166,7 @@ public struct SwiftlyHTTPClient { for try await buffer in response.body { receivedBytes += buffer.readableBytes - try buffer.withUnsafeReadableBytes { bufferPtr in - try fileHandle.write(contentsOf: bufferPtr) - } + try fileHandle.write(contentsOf: buffer.readableBytesView) let now = Date() if let reportProgress, lastUpdate.distance(to: now) > 0.25 || receivedBytes == expectedBytes { @@ -185,5 +183,9 @@ public struct SwiftlyHTTPClient { } private class HTTPClientWrapper { - fileprivate let inner = HTTPClient.shared + fileprivate let inner = HTTPClient(eventLoopGroupProvider: .singleton) + + deinit { + try? self.inner.syncShutdown() + } } diff --git a/scripts/install-libarchive.sh b/scripts/install-libarchive.sh index b6c492f9..728f59ef 100755 --- a/scripts/install-libarchive.sh +++ b/scripts/install-libarchive.sh @@ -3,7 +3,7 @@ set -o errexit # TODO detect platform -LIBARCHIVE_VERSION=3.6.1 +LIBARCHIVE_VERSION=3.7.4 mkdir /tmp/archive-build pushd /tmp/archive-build