Skip to content

Commit

Permalink
fixes compilation warning (#90)
Browse files Browse the repository at this point in the history
Motivation:
Method Channel.removeHandlers(channel: Channel) was deprecated in 2.32,
we should use recommended method instead.

Modifications:
 - Bump swift-nio version to 2.32 to ensue that new methods are
   available
 - Use new method to remove all handlers
  • Loading branch information
artemredkin committed Aug 24, 2021
1 parent bc1a91d commit 5a28f0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
.library(name: "NIOSSH", targets: ["NIOSSH"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.30.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "1.0.0"),
],
targets: [
Expand Down
4 changes: 2 additions & 2 deletions Sources/NIOSSH/Child Channels/SSHChildChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ extension SSHChildChannel: Channel, ChannelCore {
self.notifyChannelInactive()

self.eventLoop.execute {
self.removeHandlers(channel: self)
self.removeHandlers(pipeline: self.pipeline)
self.closePromise.succeed(())
self.multiplexer.childChannelClosed(channelID: self.state.localChannelIdentifier)
}
Expand Down Expand Up @@ -581,7 +581,7 @@ extension SSHChildChannel: Channel, ChannelCore {
}

self.eventLoop.execute {
self.removeHandlers(channel: self)
self.removeHandlers(pipeline: self.pipeline)
self.closePromise.fail(error)
self.multiplexer.childChannelErrored(channelID: self.state.localChannelIdentifier, expectClose: !self.state.isClosed)
}
Expand Down

0 comments on commit 5a28f0d

Please sign in to comment.