diff --git a/Package.swift b/Package.swift index 03f0a9f..3e6859e 100644 --- a/Package.swift +++ b/Package.swift @@ -33,8 +33,6 @@ let package = Package( .package(url: "https://github.com/IBM-Swift/BlueCryptor.git", from: "1.0.0"), ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. .systemLibrary( name: "CZlib", pkgConfig: "libz", diff --git a/Sources/KituraWebSocket/PermessageDeflateCompressor.swift b/Sources/KituraWebSocket/PermessageDeflateCompressor.swift index 9644837..4e38641 100644 --- a/Sources/KituraWebSocket/PermessageDeflateCompressor.swift +++ b/Sources/KituraWebSocket/PermessageDeflateCompressor.swift @@ -16,7 +16,11 @@ import NIO import NIOWebSocket +#if os(Linux) import CZlib +#else +import zlib +#endif // Implementation of a deflater using zlib. This ChannelOutboundHandler acts like an interceptor, consuming original frames written by // WebSocketConnection, compressing the payload and writing the new frames with a compressed payload onto the channel. diff --git a/Sources/KituraWebSocket/PermessageDeflateDecompressor.swift b/Sources/KituraWebSocket/PermessageDeflateDecompressor.swift index 8af6363..1dca4db 100644 --- a/Sources/KituraWebSocket/PermessageDeflateDecompressor.swift +++ b/Sources/KituraWebSocket/PermessageDeflateDecompressor.swift @@ -15,8 +15,12 @@ */ import NIO -import CZlib import NIOWebSocket +#if os(Linux) +import CZlib +#else +import zlib +#endif // Implementation of `PermessageDeflateDecompressor` a `ChannelInboundHandler` that intercepts incoming WebSocket frames, inflating the payload and // writing the new frames back to the channel, to be eventually received by WebSocketConnection. diff --git a/Tests/KituraWebSocketTests/InflaterDeflaterTests.swift b/Tests/KituraWebSocketTests/InflaterDeflaterTests.swift index ce1fdd6..0264524 100644 --- a/Tests/KituraWebSocketTests/InflaterDeflaterTests.swift +++ b/Tests/KituraWebSocketTests/InflaterDeflaterTests.swift @@ -17,7 +17,11 @@ import XCTest import Foundation import NIO +#if os(Linux) import CZlib +#else +import zlib +#endif @testable import KituraWebSocket