mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
ChannelHandler: provide static (un)wrap(In|Out)bound(In|Out) (#2791)
This commit is contained in:
1 parent
223b0e8eac
commit
7948ed2104
72 files changed
+369
-343
No files matched your search
@@ -169,7 +169,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC
|
||||
|
||||
private func addHeadersToOutboundOut(data: NIOAny) -> NIOAny {
|
||||
|
||||
let interceptedOutgoingRequest = self.unwrapOutboundIn(data)
|
||||
let interceptedOutgoingRequest = Self.unwrapOutboundIn(data)
|
||||
|
||||
if case .head(var requestHead) = interceptedOutgoingRequest {
|
||||
|
||||
@@ -177,7 +177,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC
|
||||
|
||||
self.addConnectionHeaders(to: &requestHead)
|
||||
self.addUpgradeHeaders(to: &requestHead)
|
||||
return self.wrapOutboundOut(.head(requestHead))
|
||||
return Self.wrapOutboundOut(.head(requestHead))
|
||||
}
|
||||
|
||||
return data
|
||||
@@ -207,9 +207,9 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC
|
||||
self.receivedMessages.append(data)
|
||||
return
|
||||
}
|
||||
|
||||
let responsePart = unwrapInboundIn(data)
|
||||
|
||||
|
||||
let responsePart = Self.unwrapInboundIn(data)
|
||||
|
||||
switch self.upgradeState {
|
||||
case .awaitingConfirmationResponse:
|
||||
self.firstResponseHeadReceived(context: context, responsePart: responsePart)
|
||||
@@ -371,7 +371,7 @@ public final class NIOHTTPClientUpgradeHandler: ChannelDuplexHandler, RemovableC
|
||||
}
|
||||
|
||||
assert(self.receivedMessages.isEmpty)
|
||||
context.fireChannelRead(self.wrapInboundOut(data))
|
||||
context.fireChannelRead(Self.wrapInboundOut(data))
|
||||
|
||||
// We've delivered the data. We can now remove ourselves, which should happen synchronously.
|
||||
context.pipeline.removeHandler(context: context, promise: nil)
|
||||
|
||||
Reference in new issue
Block a user