diff --git a/Sources/NIOCore/AsyncChannel/AsyncChannelHandler.swift b/Sources/NIOCore/AsyncChannel/AsyncChannelHandler.swift index 993982124..2e18e01ae 100644 --- a/Sources/NIOCore/AsyncChannel/AsyncChannelHandler.swift +++ b/Sources/NIOCore/AsyncChannel/AsyncChannelHandler.swift @@ -175,7 +175,7 @@ extension NIOAsyncChannelHandler: ChannelInboundHandler { @inlinable func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let unwrapped = Self.unwrapInboundIn(data) + let unwrapped = NIOAsyncChannelHandler.unwrapInboundIn(data) switch self.transformation { case .syncWrapping(let transformation): @@ -477,7 +477,7 @@ extension NIOAsyncChannelHandler { @inlinable func _doOutboundWrites(context: ChannelHandlerContext, writes: Deque) { for write in writes { - context.write(Self.wrapOutboundOut(write), promise: nil) + context.write(NIOAsyncChannelHandler.wrapOutboundOut(write), promise: nil) } context.flush() @@ -485,7 +485,7 @@ extension NIOAsyncChannelHandler { @inlinable func _doOutboundWrite(context: ChannelHandlerContext, write: OutboundOut) { - context.write(Self.wrapOutboundOut(write), promise: nil) + context.write(NIOAsyncChannelHandler.wrapOutboundOut(write), promise: nil) context.flush() } } diff --git a/Sources/NIOCore/Codec.swift b/Sources/NIOCore/Codec.swift index f38f2eb9e..9947d3997 100644 --- a/Sources/NIOCore/Codec.swift +++ b/Sources/NIOCore/Codec.swift @@ -521,7 +521,7 @@ extension ByteToMessageHandler: CanDequeueWrites where Decoder: WriteObservingBy fileprivate func dequeueWrites() { while self.queuedWrites.count > 0 { // self.decoder can't be `nil`, this is only allowed to be called when we're not already on the stack - self.decoder!.write(data: Self.unwrapOutboundIn(self.queuedWrites.removeFirst())) + self.decoder!.write(data: ByteToMessageHandler.unwrapOutboundIn(self.queuedWrites.removeFirst())) } } } @@ -663,7 +663,7 @@ extension ByteToMessageHandler: ChannelInboundHandler { /// Calls `decode` until there is nothing left to decode. public func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let buffer = Self.unwrapInboundIn(data) + let buffer = ByteToMessageHandler.unwrapInboundIn(data) if case .error(let error) = self.state { context.fireErrorCaught(ByteToMessageDecoderError.dataReceivedInErrorState(error, buffer)) return @@ -721,7 +721,7 @@ where Decoder: WriteObservingByteToMessageDecoder { public typealias OutboundIn = Decoder.OutboundIn public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { if self.decoder != nil { - let data = Self.unwrapOutboundIn(data) + let data = ByteToMessageHandler.unwrapOutboundIn(data) assert(self.queuedWrites.isEmpty) self.decoder!.write(data: data) } else { @@ -839,12 +839,12 @@ extension MessageToByteHandler { // there's actually some work to do here break } - let data = Self.unwrapOutboundIn(data) + let data = MessageToByteHandler.unwrapOutboundIn(data) do { self.buffer!.clear() try self.encoder.encode(data: data, out: &self.buffer!) - context.write(Self.wrapOutboundOut(self.buffer!), promise: promise) + context.write(MessageToByteHandler.wrapOutboundOut(self.buffer!), promise: promise) } catch { self.state = .error(error) promise?.fail(error) diff --git a/Sources/NIOHTTP1/HTTPEncoder.swift b/Sources/NIOHTTP1/HTTPEncoder.swift index 19bc6109a..df953a18d 100644 --- a/Sources/NIOHTTP1/HTTPEncoder.swift +++ b/Sources/NIOHTTP1/HTTPEncoder.swift @@ -202,7 +202,7 @@ public final class HTTPRequestEncoder: ChannelOutboundHandler, RemovableChannelH } public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - switch Self.unwrapOutboundIn(data) { + switch HTTPRequestEncoder.unwrapOutboundIn(data) { case .head(var request): assert( !(request.headers.contains(name: "content-length") @@ -221,7 +221,7 @@ public final class HTTPRequestEncoder: ChannelOutboundHandler, RemovableChannelH } writeHead( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPRequestEncoder.wrapOutboundOut, writeStartLine: { buffer in buffer.write(request: request) }, @@ -231,7 +231,7 @@ public final class HTTPRequestEncoder: ChannelOutboundHandler, RemovableChannelH ) case .body(let bodyPart): writeChunk( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPRequestEncoder.wrapOutboundOut, context: context, isChunked: self.isChunked, chunk: bodyPart, @@ -239,7 +239,7 @@ public final class HTTPRequestEncoder: ChannelOutboundHandler, RemovableChannelH ) case .end(let trailers): writeTrailers( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPRequestEncoder.wrapOutboundOut, context: context, isChunked: self.isChunked, trailers: trailers, @@ -292,7 +292,7 @@ public final class HTTPResponseEncoder: ChannelOutboundHandler, RemovableChannel } public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - switch Self.unwrapOutboundIn(data) { + switch HTTPResponseEncoder.unwrapOutboundIn(data) { case .head(var response): assert( !(response.headers.contains(name: "content-length") @@ -312,7 +312,7 @@ public final class HTTPResponseEncoder: ChannelOutboundHandler, RemovableChannel } writeHead( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPResponseEncoder.wrapOutboundOut, writeStartLine: { buffer in buffer.write(response: response) }, @@ -322,7 +322,7 @@ public final class HTTPResponseEncoder: ChannelOutboundHandler, RemovableChannel ) case .body(let bodyPart): writeChunk( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPResponseEncoder.wrapOutboundOut, context: context, isChunked: self.isChunked, chunk: bodyPart, @@ -330,7 +330,7 @@ public final class HTTPResponseEncoder: ChannelOutboundHandler, RemovableChannel ) case .end(let trailers): writeTrailers( - wrapOutboundOut: Self.wrapOutboundOut, + wrapOutboundOut: HTTPResponseEncoder.wrapOutboundOut, context: context, isChunked: self.isChunked, trailers: trailers, diff --git a/Sources/NIOHTTP1/HTTPHeaderValidator.swift b/Sources/NIOHTTP1/HTTPHeaderValidator.swift index 11eeb8b30..2ce5d07dd 100644 --- a/Sources/NIOHTTP1/HTTPHeaderValidator.swift +++ b/Sources/NIOHTTP1/HTTPHeaderValidator.swift @@ -29,7 +29,7 @@ public final class NIOHTTPRequestHeadersValidator: ChannelOutboundHandler, Remov public init() {} public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - switch Self.unwrapOutboundIn(data) { + switch NIOHTTPRequestHeadersValidator.unwrapOutboundIn(data) { case .head(let head): guard head.headers.areValidToSend else { promise?.fail(HTTPParserError.invalidHeaderToken) @@ -77,7 +77,7 @@ public final class NIOHTTPResponseHeadersValidator: ChannelOutboundHandler, Remo } public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - switch (Self.unwrapOutboundIn(data), self.state) { + switch (NIOHTTPResponseHeadersValidator.unwrapOutboundIn(data), self.state) { case (.head(let head), .validating): if head.headers.areValidToSend { context.write(data, promise: promise) diff --git a/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift b/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift index 1272adc1f..c89ccb3a9 100644 --- a/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift +++ b/Sources/NIOHTTP1/HTTPServerPipelineHandler.swift @@ -408,7 +408,7 @@ public final class HTTPServerPipelineHandler: ChannelDuplexHandler, RemovableCha "Received second response while waiting for first one to complete" ) debugOnly { - let res = Self.unwrapOutboundIn(data) + let res = HTTPServerPipelineHandler.unwrapOutboundIn(data) switch res { case .head(let head) where head.isInformational: self.checkAssertion(self.nextExpectedOutboundMessage == .head) @@ -425,12 +425,12 @@ public final class HTTPServerPipelineHandler: ChannelDuplexHandler, RemovableCha var startReadingAgain = false - switch Self.unwrapOutboundIn(data) { + switch HTTPServerPipelineHandler.unwrapOutboundIn(data) { case .head(var head) where self.lifecycleState != .acceptingEvents: if head.isKeepAlive { head.headers.replaceOrAdd(name: "connection", value: "close") } - context.write(Self.wrapOutboundOut(.head(head)), promise: promise) + context.write(HTTPServerPipelineHandler.wrapOutboundOut(.head(head)), promise: promise) case .end: startReadingAgain = true @@ -650,7 +650,7 @@ public final class HTTPServerPipelineHandler: ChannelDuplexHandler, RemovableCha let maybeFirstHead = self.eventBuffer.firstIndex(where: { element in switch element { case .channelRead(let read): - switch Self.unwrapInboundIn(read) { + switch HTTPServerPipelineHandler.unwrapInboundIn(read) { case .head: return true case .body, .end: diff --git a/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift b/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift index e3ad13741..fb52baf7e 100644 --- a/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift +++ b/Sources/NIOHTTP1/HTTPServerProtocolErrorHandler.swift @@ -46,8 +46,8 @@ public final class HTTPServerProtocolErrorHandler: ChannelDuplexHandler, Removab if !self.hasUnterminatedResponse { let headers = HTTPHeaders([("Connection", "close"), ("Content-Length", "0")]) let head = HTTPResponseHead(version: .http1_1, status: .badRequest, headers: headers) - context.write(Self.wrapOutboundOut(.head(head)), promise: nil) - context.writeAndFlush(Self.wrapOutboundOut(.end(nil)), promise: nil) + context.write(HTTPServerProtocolErrorHandler.wrapOutboundOut(.head(head)), promise: nil) + context.writeAndFlush(HTTPServerProtocolErrorHandler.wrapOutboundOut(.end(nil)), promise: nil) } // Now pass the error on in case someone else wants to see it. @@ -55,7 +55,7 @@ public final class HTTPServerProtocolErrorHandler: ChannelDuplexHandler, Removab } public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - let res = Self.unwrapOutboundIn(data) + let res = HTTPServerProtocolErrorHandler.unwrapOutboundIn(data) switch res { case .head(let head) where head.isInformational: precondition(!self.hasUnterminatedResponse) diff --git a/Sources/NIOHTTP1/HTTPServerUpgradeHandler.swift b/Sources/NIOHTTP1/HTTPServerUpgradeHandler.swift index 75fea7d04..a0edfda3b 100644 --- a/Sources/NIOHTTP1/HTTPServerUpgradeHandler.swift +++ b/Sources/NIOHTTP1/HTTPServerUpgradeHandler.swift @@ -113,7 +113,7 @@ public final class HTTPServerUpgradeHandler: ChannelInboundHandler, RemovableCha return } - let requestPart = Self.unwrapInboundIn(data) + let requestPart = HTTPServerUpgradeHandler.unwrapInboundIn(data) switch self.upgradeState { case .idle: @@ -353,14 +353,14 @@ public final class HTTPServerUpgradeHandler: ChannelInboundHandler, RemovableCha // We haven't seen the first request .end. That means we're not buffering anything, and we can // just deliver data. assert(self.receivedMessages.isEmpty) - context.fireChannelRead(Self.wrapInboundOut(data)) + context.fireChannelRead(HTTPServerUpgradeHandler.wrapInboundOut(data)) } else { // This is trickier. We've seen the first request .end, so we now need to deliver the .head we // got passed, as well as the .end we swallowed, and any buffered parts. While we're doing this // we may be re-entrantly called, which will cause us to buffer new parts. To make that safe, we // must ensure we aren't holding the buffer mutably, so no for loop for us. - context.fireChannelRead(Self.wrapInboundOut(data)) - context.fireChannelRead(Self.wrapInboundOut(.end(nil))) + context.fireChannelRead(HTTPServerUpgradeHandler.wrapInboundOut(data)) + context.fireChannelRead(HTTPServerUpgradeHandler.wrapInboundOut(.end(nil))) } context.fireChannelReadComplete() diff --git a/Sources/NIOHTTP1/NIOHTTPClientUpgradeHandler.swift b/Sources/NIOHTTP1/NIOHTTPClientUpgradeHandler.swift index 0d886e2dd..621cddb15 100644 --- a/Sources/NIOHTTP1/NIOHTTPClientUpgradeHandler.swift +++ b/Sources/NIOHTTP1/NIOHTTPClientUpgradeHandler.swift @@ -175,7 +175,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC private func addHeadersToOutboundOut(data: NIOAny) -> NIOAny { - let interceptedOutgoingRequest = Self.unwrapOutboundIn(data) + let interceptedOutgoingRequest = NIOHTTPClientUpgradeHandler.unwrapOutboundIn(data) if case .head(var requestHead) = interceptedOutgoingRequest { @@ -183,7 +183,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC self.addConnectionHeaders(to: &requestHead) self.addUpgradeHeaders(to: &requestHead) - return Self.wrapOutboundOut(.head(requestHead)) + return NIOHTTPClientUpgradeHandler.wrapOutboundOut(.head(requestHead)) } return data @@ -214,7 +214,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC return } - let responsePart = Self.unwrapInboundIn(data) + let responsePart = NIOHTTPClientUpgradeHandler.unwrapInboundIn(data) switch self.upgradeState { case .awaitingConfirmationResponse: @@ -395,7 +395,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC } assert(self.receivedMessages.isEmpty) - context.fireChannelRead(Self.wrapInboundOut(data)) + context.fireChannelRead(NIOHTTPClientUpgradeHandler.wrapInboundOut(data)) // We've delivered the data. We can now remove ourselves, which should happen synchronously. context.pipeline.syncOperations.removeHandler(context: context, promise: nil) diff --git a/Sources/NIOHTTP1/NIOHTTPObjectAggregator.swift b/Sources/NIOHTTP1/NIOHTTPObjectAggregator.swift index 3821e6e2b..8b79744fe 100644 --- a/Sources/NIOHTTP1/NIOHTTPObjectAggregator.swift +++ b/Sources/NIOHTTP1/NIOHTTPObjectAggregator.swift @@ -198,7 +198,7 @@ public final class NIOHTTPServerRequestAggregator: ChannelInboundHandler, Remova } public func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let msg = Self.unwrapInboundIn(data) + let msg = NIOHTTPServerRequestAggregator.unwrapInboundIn(data) var serverResponse: HTTPResponseHead? = nil do { @@ -224,8 +224,8 @@ public final class NIOHTTPServerRequestAggregator: ChannelInboundHandler, Remova // Generated a server response to send back if let response = serverResponse { - context.write(Self.wrapOutboundOut(.head(response)), promise: nil) - context.writeAndFlush(Self.wrapOutboundOut(.end(nil)), promise: nil) + context.write(NIOHTTPServerRequestAggregator.wrapOutboundOut(.head(response)), promise: nil) + context.writeAndFlush(NIOHTTPServerRequestAggregator.wrapOutboundOut(.end(nil)), promise: nil) if response.status == .payloadTooLarge { // If indicated content length is too large self.state.handlingOversizeMessage() @@ -345,7 +345,7 @@ public final class NIOHTTPClientResponseAggregator: ChannelInboundHandler, Remov } public func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let msg = Self.unwrapInboundIn(data) + let msg = NIOHTTPClientResponseAggregator.unwrapInboundIn(data) do { switch msg { diff --git a/Sources/NIOHTTP1/NIOTypedHTTPClientUpgradeHandler.swift b/Sources/NIOHTTP1/NIOTypedHTTPClientUpgradeHandler.swift index 44f4240f9..a7d43b403 100644 --- a/Sources/NIOHTTP1/NIOTypedHTTPClientUpgradeHandler.swift +++ b/Sources/NIOHTTP1/NIOTypedHTTPClientUpgradeHandler.swift @@ -141,9 +141,12 @@ public final class NIOTypedHTTPClientUpgradeHandler: Ch public func channelActive(context: ChannelHandlerContext) { switch self.stateMachine.channelActive() { case .writeUpgradeRequest: - context.write(Self.wrapOutboundOut(.head(self.upgradeRequestHead)), promise: nil) - context.write(Self.wrapOutboundOut(.body(.byteBuffer(.init()))), promise: nil) - context.writeAndFlush(Self.wrapOutboundOut(.end(nil)), promise: nil) + context.write( + NIOTypedHTTPClientUpgradeHandler.wrapOutboundOut(.head(self.upgradeRequestHead)), + promise: nil + ) + context.write(NIOTypedHTTPClientUpgradeHandler.wrapOutboundOut(.body(.byteBuffer(.init()))), promise: nil) + context.writeAndFlush(NIOTypedHTTPClientUpgradeHandler.wrapOutboundOut(.end(nil)), promise: nil) case .none: break @@ -179,7 +182,7 @@ public final class NIOTypedHTTPClientUpgradeHandler: Ch public func channelRead(context: ChannelHandlerContext, data: NIOAny) { switch self.stateMachine.channelReadData(data) { case .unwrapData: - let responsePart = Self.unwrapInboundIn(data) + let responsePart = NIOTypedHTTPClientUpgradeHandler.unwrapInboundIn(data) self.channelRead(context: context, responsePart: responsePart) case .fireChannelRead: diff --git a/Sources/NIOHTTP1/NIOTypedHTTPServerUpgradeHandler.swift b/Sources/NIOHTTP1/NIOTypedHTTPServerUpgradeHandler.swift index 147146c31..4582cd046 100644 --- a/Sources/NIOHTTP1/NIOTypedHTTPServerUpgradeHandler.swift +++ b/Sources/NIOHTTP1/NIOTypedHTTPServerUpgradeHandler.swift @@ -143,7 +143,7 @@ public final class NIOTypedHTTPServerUpgradeHandler: Ch public func channelRead(context: ChannelHandlerContext, data: NIOAny) { switch self.stateMachine.channelReadData(data) { case .unwrapData: - let requestPart = Self.unwrapInboundIn(data) + let requestPart = NIOTypedHTTPServerUpgradeHandler.unwrapInboundIn(data) self.channelRead(context: context, requestPart: requestPart) case .fireChannelRead: diff --git a/Sources/NIOPosix/Bootstrap.swift b/Sources/NIOPosix/Bootstrap.swift index 6768b1a72..ba20564cc 100644 --- a/Sources/NIOPosix/Bootstrap.swift +++ b/Sources/NIOPosix/Bootstrap.swift @@ -460,7 +460,7 @@ public final class ServerBootstrap { } func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let accepted = Self.unwrapInboundIn(data) + let accepted = AcceptHandler.unwrapInboundIn(data) let ctxEventLoop = context.eventLoop let childEventLoop = accepted.eventLoop let childChannelInit = self.childChannelInit ?? { (_: Channel) in childEventLoop.makeSucceededFuture(()) } @@ -485,7 +485,7 @@ public final class ServerBootstrap { guard context.channel.isActive else { return ctxEventLoop.makeFailedFuture(ChannelError._ioOnClosedChannel) } - context.fireChannelRead(Self.wrapInboundOut(accepted)) + context.fireChannelRead(AcceptHandler.wrapInboundOut(accepted)) return context.eventLoop.makeSucceededFuture(()) }.whenFailure { error in self.closeAndFire(context: context, accepted: accepted, err: error) diff --git a/Sources/NIOWebSocket/NIOWebSocketFrameAggregator.swift b/Sources/NIOWebSocket/NIOWebSocketFrameAggregator.swift index 1f929e8ca..a5748a02f 100644 --- a/Sources/NIOWebSocket/NIOWebSocketFrameAggregator.swift +++ b/Sources/NIOWebSocket/NIOWebSocketFrameAggregator.swift @@ -53,7 +53,7 @@ public final class NIOWebSocketFrameAggregator: ChannelInboundHandler { } public func channelRead(context: ChannelHandlerContext, data: NIOAny) { - let frame = Self.unwrapInboundIn(data) + let frame = NIOWebSocketFrameAggregator.unwrapInboundIn(data) do { switch frame.opcode { case .continuation: diff --git a/Sources/NIOWebSocket/WebSocketFrameDecoder.swift b/Sources/NIOWebSocket/WebSocketFrameDecoder.swift index ebd4030bf..b3d245641 100644 --- a/Sources/NIOWebSocket/WebSocketFrameDecoder.swift +++ b/Sources/NIOWebSocket/WebSocketFrameDecoder.swift @@ -263,7 +263,7 @@ public final class WebSocketFrameDecoder: ByteToMessageDecoder { while true { switch parser.parseStep(&buffer) { case .result(let frame): - context.fireChannelRead(Self.wrapInboundOut(frame)) + context.fireChannelRead(WebSocketFrameDecoder.wrapInboundOut(frame)) return .continue case .continueParsing: try self.parser.validateState(maxFrameSize: self.maxFrameSize) diff --git a/Sources/NIOWebSocket/WebSocketFrameEncoder.swift b/Sources/NIOWebSocket/WebSocketFrameEncoder.swift index 5d3ca1594..8c726997a 100644 --- a/Sources/NIOWebSocket/WebSocketFrameEncoder.swift +++ b/Sources/NIOWebSocket/WebSocketFrameEncoder.swift @@ -59,7 +59,7 @@ public final class WebSocketFrameEncoder: ChannelOutboundHandler { } public func write(context: ChannelHandlerContext, data: NIOAny, promise: EventLoopPromise?) { - let data = Self.unwrapOutboundIn(data) + let data = WebSocketFrameEncoder.unwrapOutboundIn(data) // First, we explode the frame structure and apply the mask. let frameHeader = FrameHeader(frame: data) @@ -77,13 +77,13 @@ public final class WebSocketFrameEncoder: ChannelOutboundHandler { if !unwrappedExtensionData.prependFrameHeaderIfPossible(frameHeader) { self.writeSeparateHeaderBuffer(frameHeader, context: context) } - context.write(Self.wrapOutboundOut(unwrappedExtensionData), promise: nil) + context.write(WebSocketFrameEncoder.wrapOutboundOut(unwrappedExtensionData), promise: nil) } else if !applicationData.prependFrameHeaderIfPossible(frameHeader) { self.writeSeparateHeaderBuffer(frameHeader, context: context) } // Ok, now we need to write the application data buffer. - context.write(Self.wrapOutboundOut(applicationData), promise: promise) + context.write(WebSocketFrameEncoder.wrapOutboundOut(applicationData), promise: promise) } /// Applies the websocket masking operation based on the passed byte buffers. @@ -119,7 +119,7 @@ public final class WebSocketFrameEncoder: ChannelOutboundHandler { // Ok, frame header away! Before we send it we save it back onto ourselves in case we get recursively called. self.headerBuffer = buffer - context.write(Self.wrapOutboundOut(buffer), promise: nil) + context.write(WebSocketFrameEncoder.wrapOutboundOut(buffer), promise: nil) } } diff --git a/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift b/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift index 6c63126e9..812bfdea8 100644 --- a/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift +++ b/Sources/NIOWebSocket/WebSocketProtocolErrorHandler.swift @@ -48,7 +48,9 @@ public final class WebSocketProtocolErrorHandler: ChannelInboundHandler { maskKey: self.makeMaskingKey(), data: data ) - context.writeAndFlush(Self.wrapOutboundOut(frame)).whenComplete { (_: Result) in + context.writeAndFlush( + WebSocketProtocolErrorHandler.wrapOutboundOut(frame) + ).whenComplete { (_: Result) in let context = loopBoundContext.value context.close(promise: nil) }