From 0447b0359ef5f35ccd277892d9fe374e8c16b132 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 1 Apr 2025 15:29:54 +0100 Subject: [PATCH 1/5] Strict concurrency for NIOHTTPCompression (#257) --- Package.swift | 6 +- .../NIOHTTPCompression/HTTPCompression.swift | 2 +- .../HTTPDecompression.swift | 2 +- .../HTTPResponseCompressorTest.swift | 68 +++++++++++-------- 4 files changed, 44 insertions(+), 34 deletions(-) diff --git a/Package.swift b/Package.swift index 65729c4..0a17d0b 100644 --- a/Package.swift +++ b/Package.swift @@ -50,7 +50,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIO", package: "swift-nio"), .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .executableTarget( name: "HTTPServerWithQuiescingDemo", @@ -132,7 +133,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOEmbedded", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOSOCKSTests", diff --git a/Sources/NIOHTTPCompression/HTTPCompression.swift b/Sources/NIOHTTPCompression/HTTPCompression.swift index 69ad36b..f696871 100644 --- a/Sources/NIOHTTPCompression/HTTPCompression.swift +++ b/Sources/NIOHTTPCompression/HTTPCompression.swift @@ -16,7 +16,7 @@ import CNIOExtrasZlib import NIOCore /// Namespace for compression code. -public enum NIOCompression { +public enum NIOCompression: Sendable { /// Which algorithm should be used for compression. public struct Algorithm: CustomStringConvertible, Equatable, Sendable { diff --git a/Sources/NIOHTTPCompression/HTTPDecompression.swift b/Sources/NIOHTTPCompression/HTTPDecompression.swift index 4ff0d44..3acc1c5 100644 --- a/Sources/NIOHTTPCompression/HTTPDecompression.swift +++ b/Sources/NIOHTTPCompression/HTTPDecompression.swift @@ -16,7 +16,7 @@ import CNIOExtrasZlib import NIOCore /// Namespace for decompression code. -public enum NIOHTTPDecompression { +public enum NIOHTTPDecompression: Sendable { /// Specifies how to limit decompression inflation. public struct DecompressionLimit: Sendable { private enum Limit { diff --git a/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift b/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift index 75f6713..0b6d0b0 100644 --- a/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift +++ b/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift @@ -40,7 +40,7 @@ private class PromiseOrderer { let thisPromiseIndex = promiseArray.count promiseArray.append(promise) - promise.futureResult.whenComplete { (_: Result) in + promise.futureResult.hop(to: self.eventLoop).assumeIsolated().whenComplete { (_: Result) in let priorFutures = self.promiseArray[0.. Date: Tue, 1 Apr 2025 15:33:46 +0100 Subject: [PATCH 2/5] Strict concurrency for NIOSOCKS (#256) --- Package.swift | 6 ++++-- Sources/NIOSOCKS/Messages/Errors.swift | 4 ++-- .../NIOSOCKSTests/SOCKSServerHandshakeHandler+Tests.swift | 4 ++-- Tests/NIOSOCKSTests/SocksClientHandler+Tests.swift | 8 ++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Package.swift b/Package.swift index 0a17d0b..04ab9f9 100644 --- a/Package.swift +++ b/Package.swift @@ -95,7 +95,8 @@ var targets: [PackageDescription.Target] = [ dependencies: [ .product(name: "NIO", package: "swift-nio"), .product(name: "NIOCore", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .executableTarget( name: "NIOSOCKSClient", @@ -142,7 +143,8 @@ var targets: [PackageDescription.Target] = [ "NIOSOCKS", .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOEmbedded", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .target( name: "NIONFS3", diff --git a/Sources/NIOSOCKS/Messages/Errors.swift b/Sources/NIOSOCKS/Messages/Errors.swift index ddb8a1a..f914fa8 100644 --- a/Sources/NIOSOCKS/Messages/Errors.swift +++ b/Sources/NIOSOCKS/Messages/Errors.swift @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -/// Wrapper for SOCKS protcol error. -public enum SOCKSError { +/// Wrapper for SOCKS protocol error. +public enum SOCKSError: Sendable { /// The SOCKS client was in a different state to that required. public struct InvalidClientState: Error, Hashable { diff --git a/Tests/NIOSOCKSTests/SOCKSServerHandshakeHandler+Tests.swift b/Tests/NIOSOCKSTests/SOCKSServerHandshakeHandler+Tests.swift index e61d825..aa0f447 100644 --- a/Tests/NIOSOCKSTests/SOCKSServerHandshakeHandler+Tests.swift +++ b/Tests/NIOSOCKSTests/SOCKSServerHandshakeHandler+Tests.swift @@ -139,7 +139,7 @@ class SOCKSServerHandlerTests: XCTestCase { expectedRequest: expectedRequest, expectedData: expectedData ) - XCTAssertNoThrow(try self.channel.pipeline.addHandler(testHandler).wait()) + XCTAssertNoThrow(try self.channel.pipeline.syncOperations.addHandler(testHandler)) // wait for the greeting XCTAssertFalse(testHandler.hadGreeting) @@ -184,7 +184,7 @@ class SOCKSServerHandlerTests: XCTestCase { expectedRequest: expectedRequest, expectedData: expectedData ) - XCTAssertNoThrow(try self.channel.pipeline.addHandler(testHandler).wait()) + XCTAssertNoThrow(try self.channel.pipeline.syncOperations.addHandler(testHandler)) // wait for the greeting XCTAssertFalse(testHandler.hadGreeting) diff --git a/Tests/NIOSOCKSTests/SocksClientHandler+Tests.swift b/Tests/NIOSOCKSTests/SocksClientHandler+Tests.swift index 4e8d7e6..ba5ce67 100644 --- a/Tests/NIOSOCKSTests/SocksClientHandler+Tests.swift +++ b/Tests/NIOSOCKSTests/SocksClientHandler+Tests.swift @@ -173,7 +173,7 @@ class SocksClientHandlerTests: XCTestCase { // server requests an auth method we don't support let promise = self.channel.eventLoop.makePromise(of: Void.self) - try! self.channel.pipeline.addHandler(ErrorHandler(promise: promise), position: .last).wait() + try! self.channel.pipeline.syncOperations.addHandler(ErrorHandler(promise: promise), position: .last) self.writeInbound([0x05, 0x01]) XCTAssertThrowsError(try promise.futureResult.wait()) { e in XCTAssertTrue(e is SOCKSError.InvalidAuthenticationSelection) @@ -204,7 +204,7 @@ class SocksClientHandlerTests: XCTestCase { // server replies with an error let promise = self.channel.eventLoop.makePromise(of: Void.self) - try! self.channel.pipeline.addHandler(ErrorHandler(promise: promise), position: .last).wait() + try! self.channel.pipeline.syncOperations.addHandler(ErrorHandler(promise: promise), position: .last) self.writeInbound([0x05, 0x01, 0x00, 0x01, 192, 168, 1, 1, 0x00, 0x50]) XCTAssertThrowsError(try promise.futureResult.wait()) { e in XCTAssertEqual(e as? SOCKSError.ConnectionFailed, .init(reply: .serverFailure)) @@ -262,12 +262,12 @@ class SocksClientHandlerTests: XCTestCase { let establishPromise = self.channel.eventLoop.makePromise(of: Void.self) let removalPromise = self.channel.eventLoop.makePromise(of: Void.self) - establishPromise.futureResult.whenSuccess { _ in + establishPromise.futureResult.assumeIsolated().whenSuccess { _ in self.channel.pipeline.syncOperations.removeHandler(self.handler).cascade(to: removalPromise) } XCTAssertNoThrow( - try self.channel.pipeline.addHandler(SOCKSEventHandler(establishedPromise: establishPromise)).wait() + try self.channel.pipeline.syncOperations.addHandler(SOCKSEventHandler(establishedPromise: establishPromise)) ) self.connect() From dbfdade581ddd997c0769179d938537e58295980 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 1 Apr 2025 16:27:24 +0100 Subject: [PATCH 3/5] Strict concurrency for NIOWritePCAPDemo, NIOWritePartialPCAPDemo and NIOSOCKSClient (#260) --- Package.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 04ab9f9..ac5cda4 100644 --- a/Package.swift +++ b/Package.swift @@ -69,7 +69,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOPosix", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .executableTarget( name: "NIOWritePartialPCAPDemo", @@ -78,7 +79,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOPosix", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .executableTarget( name: "NIOExtrasPerformanceTester", @@ -104,7 +106,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOPosix", package: "swift-nio"), "NIOSOCKS", - ] + ], + swiftSettings: strictConcurrencySettings ), .target( name: "CNIOExtrasZlib", From 72410670791a023505ecd66f6981d89301c97e3a Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 1 Apr 2025 16:32:33 +0100 Subject: [PATCH 4/5] Strict concurrency for NIOHTTPResponsiveness and NIOHTTPResponsivenessTests (#261) --- Package.swift | 8 ++------ .../HTTPDrippingDownloadHandler.swift | 3 +++ .../HTTPReceiveDiscardHandler.swift | 3 +++ .../SimpleResponsivenessRequestMux.swift | 3 +++ Sources/NIOResumableUploadDemo/main.swift | 12 +++++++----- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Package.swift b/Package.swift index ac5cda4..89ce3e1 100644 --- a/Package.swift +++ b/Package.swift @@ -232,9 +232,7 @@ var targets: [PackageDescription.Target] = [ .product(name: "HTTPTypes", package: "swift-http-types"), .product(name: "Algorithms", package: "swift-algorithms"), ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOHTTPResponsivenessTests", @@ -245,9 +243,7 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOEmbedded", package: "swift-nio"), .product(name: "HTTPTypes", package: "swift-http-types"), ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + swiftSettings: strictConcurrencySettings ), ] diff --git a/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift b/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift index 76588e5..e466808 100644 --- a/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift +++ b/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift @@ -253,3 +253,6 @@ public final class HTTPDrippingDownloadHandler: ChannelDuplexHandler { } } } + +@available(*, unavailable) +extension HTTPDrippingDownloadHandler: Sendable {} diff --git a/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift b/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift index 8fba40d..5fea3cd 100644 --- a/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift +++ b/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift @@ -88,3 +88,6 @@ public final class HTTPReceiveDiscardHandler: ChannelInboundHandler { context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil) } } + +@available(*, unavailable) +extension HTTPReceiveDiscardHandler: Sendable {} diff --git a/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift b/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift index 6cc1ff2..7ccd499 100644 --- a/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift +++ b/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift @@ -143,3 +143,6 @@ public final class SimpleResponsivenessRequestMux: ChannelInboundHandler { context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil) } } + +@available(*, unavailable) +extension SimpleResponsivenessRequestMux: Sendable {} diff --git a/Sources/NIOResumableUploadDemo/main.swift b/Sources/NIOResumableUploadDemo/main.swift index 25373cc..b335e95 100644 --- a/Sources/NIOResumableUploadDemo/main.swift +++ b/Sources/NIOResumableUploadDemo/main.swift @@ -101,9 +101,11 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) { let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount) let server = try ServerBootstrap(group: group).childChannelInitializer { channel in - channel.pipeline.configureHTTPServerPipeline().flatMap { - channel.pipeline.addHandlers([ - HTTP1ToHTTPServerCodec(secure: false), + channel.eventLoop.makeCompletedFuture { + let sync = channel.pipeline.syncOperations + try sync.configureHTTPServerPipeline() + try sync.addHandler(HTTP1ToHTTPServerCodec(secure: false)) + try sync.addHandler( HTTPResumableUploadHandler( context: uploadContext, handlers: [ @@ -111,8 +113,8 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) { directory: URL(fileURLWithPath: CommandLine.arguments[1], isDirectory: true) ) ] - ), - ]) + ) + ) } } .bind(host: "0.0.0.0", port: 8080) From c92af9d4ef1adb181445f869962d11449d16d354 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Tue, 1 Apr 2025 16:44:08 +0100 Subject: [PATCH 5/5] Strict concurrency for HTTPTypes and friends (#259) --- Package.swift | 15 ++++++++++----- Sources/NIOHTTPTypesHTTP1/HTTP1ToHTTPCodec.swift | 4 ++-- Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift | 4 ++-- Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift | 6 ++++++ .../NIOHTTPTypesHTTP1Tests.swift | 8 ++++---- .../NIOHTTPTypesHTTP2Tests.swift | 4 ++-- 6 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Package.swift b/Package.swift index 89ce3e1..9fff710 100644 --- a/Package.swift +++ b/Package.swift @@ -169,33 +169,38 @@ var targets: [PackageDescription.Target] = [ dependencies: [ .product(name: "HTTPTypes", package: "swift-http-types"), .product(name: "NIOCore", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .target( name: "NIOHTTPTypesHTTP1", dependencies: [ "NIOHTTPTypes", .product(name: "NIOHTTP1", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .target( name: "NIOHTTPTypesHTTP2", dependencies: [ "NIOHTTPTypes", .product(name: "NIOHTTP2", package: "swift-nio-http2"), - ] + ], + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOHTTPTypesHTTP1Tests", dependencies: [ "NIOHTTPTypesHTTP1" - ] + ], + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOHTTPTypesHTTP2Tests", dependencies: [ "NIOHTTPTypesHTTP2" - ] + ], + swiftSettings: strictConcurrencySettings ), .target( name: "NIOResumableUpload", diff --git a/Sources/NIOHTTPTypesHTTP1/HTTP1ToHTTPCodec.swift b/Sources/NIOHTTPTypesHTTP1/HTTP1ToHTTPCodec.swift index 858864b..4c92406 100644 --- a/Sources/NIOHTTPTypesHTTP1/HTTP1ToHTTPCodec.swift +++ b/Sources/NIOHTTPTypesHTTP1/HTTP1ToHTTPCodec.swift @@ -19,7 +19,7 @@ import NIOHTTPTypes /// A simple channel handler that translates HTTP/1 messages into shared HTTP types, /// and vice versa, for use on the client side. -public final class HTTP1ToHTTPClientCodec: ChannelDuplexHandler, RemovableChannelHandler { +public final class HTTP1ToHTTPClientCodec: ChannelDuplexHandler, RemovableChannelHandler, Sendable { public typealias InboundIn = HTTPClientResponsePart public typealias InboundOut = HTTPResponsePart @@ -66,7 +66,7 @@ public final class HTTP1ToHTTPClientCodec: ChannelDuplexHandler, RemovableChanne /// A simple channel handler that translates HTTP/1 messages into shared HTTP types, /// and vice versa, for use on the server side. -public final class HTTP1ToHTTPServerCodec: ChannelDuplexHandler, RemovableChannelHandler { +public final class HTTP1ToHTTPServerCodec: ChannelDuplexHandler, RemovableChannelHandler, Sendable { public typealias InboundIn = HTTPServerRequestPart public typealias InboundOut = HTTPRequestPart diff --git a/Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift b/Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift index 56ca1d6..8f132d9 100644 --- a/Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift +++ b/Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift @@ -23,7 +23,7 @@ import NIOHTTPTypes /// This is intended for compatibility purposes where a channel handler working with /// HTTP/1 messages needs to work on top of the new version-independent HTTP types /// abstraction. -public final class HTTPToHTTP1ClientCodec: ChannelDuplexHandler, RemovableChannelHandler { +public final class HTTPToHTTP1ClientCodec: ChannelDuplexHandler, RemovableChannelHandler, Sendable { public typealias InboundIn = HTTPResponsePart public typealias InboundOut = HTTPClientResponsePart @@ -86,7 +86,7 @@ public final class HTTPToHTTP1ClientCodec: ChannelDuplexHandler, RemovableChanne /// This is intended for compatibility purposes where a channel handler working with /// HTTP/1 messages needs to work on top of the new version-independent HTTP types /// abstraction. -public final class HTTPToHTTP1ServerCodec: ChannelDuplexHandler, RemovableChannelHandler { +public final class HTTPToHTTP1ServerCodec: ChannelDuplexHandler, RemovableChannelHandler, Sendable { public typealias InboundIn = HTTPRequestPart public typealias InboundOut = HTTPServerRequestPart diff --git a/Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift b/Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift index 5157563..c43dbe9 100644 --- a/Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift +++ b/Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift @@ -162,6 +162,9 @@ public final class HTTP2FramePayloadToHTTPClientCodec: ChannelDuplexHandler, Rem } } +@available(*, unavailable) +extension HTTP2FramePayloadToHTTPClientCodec: Sendable {} + // MARK: - Server private struct BaseServerCodec { @@ -280,6 +283,9 @@ public final class HTTP2FramePayloadToHTTPServerCodec: ChannelDuplexHandler, Rem } } +@available(*, unavailable) +extension HTTP2FramePayloadToHTTPServerCodec: Sendable {} + /// Events that can be sent by the application to be handled by the `HTTP2StreamChannel` public struct NIOHTTP2FramePayloadToHTTPEvent: Hashable, Sendable { private enum Kind: Hashable, Sendable { diff --git a/Tests/NIOHTTPTypesHTTP1Tests/NIOHTTPTypesHTTP1Tests.swift b/Tests/NIOHTTPTypesHTTP1Tests/NIOHTTPTypesHTTP1Tests.swift index e4d8653..667bc71 100644 --- a/Tests/NIOHTTPTypesHTTP1Tests/NIOHTTPTypesHTTP1Tests.swift +++ b/Tests/NIOHTTPTypesHTTP1Tests/NIOHTTPTypesHTTP1Tests.swift @@ -115,7 +115,7 @@ final class NIOHTTPTypesHTTP1Tests: XCTestCase { func testClientHTTP1ToHTTP() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTP1ToHTTPClientCodec(), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTP1ToHTTPClientCodec(), recorder) try self.channel.writeOutbound(HTTPRequestPart.head(Self.request)) try self.channel.writeOutbound(HTTPRequestPart.end(Self.trailers)) @@ -135,7 +135,7 @@ final class NIOHTTPTypesHTTP1Tests: XCTestCase { func testServerHTTP1ToHTTP() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTP1ToHTTPServerCodec(secure: true), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTP1ToHTTPServerCodec(secure: true), recorder) try self.channel.writeInbound(HTTPServerRequestPart.head(Self.oldRequest)) try self.channel.writeInbound(HTTPServerRequestPart.end(Self.oldTrailers)) @@ -155,7 +155,7 @@ final class NIOHTTPTypesHTTP1Tests: XCTestCase { func testClientHTTPToHTTP1() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTPToHTTP1ClientCodec(secure: true), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTPToHTTP1ClientCodec(secure: true), recorder) try self.channel.writeOutbound(HTTPClientRequestPart.head(Self.oldRequest)) try self.channel.writeOutbound(HTTPClientRequestPart.end(Self.oldTrailers)) @@ -175,7 +175,7 @@ final class NIOHTTPTypesHTTP1Tests: XCTestCase { func testServerHTTPToHTTP1() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTPToHTTP1ServerCodec(), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTPToHTTP1ServerCodec(), recorder) try self.channel.writeInbound(HTTPRequestPart.head(Self.request)) try self.channel.writeInbound(HTTPRequestPart.end(Self.trailers)) diff --git a/Tests/NIOHTTPTypesHTTP2Tests/NIOHTTPTypesHTTP2Tests.swift b/Tests/NIOHTTPTypesHTTP2Tests/NIOHTTPTypesHTTP2Tests.swift index 8030ba5..c8c80a4 100644 --- a/Tests/NIOHTTPTypesHTTP2Tests/NIOHTTPTypesHTTP2Tests.swift +++ b/Tests/NIOHTTPTypesHTTP2Tests/NIOHTTPTypesHTTP2Tests.swift @@ -112,7 +112,7 @@ final class NIOHTTPTypesHTTP2Tests: XCTestCase { func testClientHTTP2ToHTTP() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTP2FramePayloadToHTTPClientCodec(), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTP2FramePayloadToHTTPClientCodec(), recorder) try self.channel.writeOutbound(HTTPRequestPart.head(Self.request)) try self.channel.writeOutbound(HTTPRequestPart.end(Self.trailers)) @@ -139,7 +139,7 @@ final class NIOHTTPTypesHTTP2Tests: XCTestCase { func testServerHTTP2ToHTTP() throws { let recorder = InboundRecorder() - try self.channel.pipeline.addHandlers(HTTP2FramePayloadToHTTPServerCodec(), recorder).wait() + try self.channel.pipeline.syncOperations.addHandlers(HTTP2FramePayloadToHTTPServerCodec(), recorder) try self.channel.writeInbound(HTTP2Frame.FramePayload(headers: Self.oldRequest)) try self.channel.writeInbound(HTTP2Frame.FramePayload(headers: Self.oldTrailers))