Skip to content

Commit

Permalink
Retain WireGuardAdapterDelegate (#1064)
Browse files Browse the repository at this point in the history
The delegate was lost due to not being retained anywhere, and the
WireGuard adapter was therefore not finalizing the connection (i.e. set
tunnel settings).

Regression in #1057
  • Loading branch information
keeshux authored Jan 15, 2025
1 parent 8492348 commit e87128e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Packages/PassepartoutKit-Framework/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ enum Environment {
case .onlineDevelopment:
targets.append(.binaryTarget(
name: "Target",
url: "https://github.com/passepartoutvpn/passepartoutkit/releases/download/0.99.2/PassepartoutKit.xcframework.zip",
checksum: "9fd6db5de77af9e8fe7aa425c1baf434ad54ca8bf2370946899ab344fd03eacc"
url: "https://github.com/passepartoutvpn/passepartoutkit/releases/download/0.99.3/PassepartoutKit.xcframework.zip",
checksum: "6da09eca9fe26504ac7aa416dcdbccc65c57090f6809c547b3641a3712540041"
))
case .production:
targets.append(.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ public final class WireGuardConnection: Connection {
private var dataCountTimer: AnyCancellable?

private lazy var adapter: WireGuardAdapter = {
WireGuardAdapter(with: AdapterDelegate(connection: self), backend: WireGuardBackendGo()) { logLevel, message in
WireGuardAdapter(with: delegate, backend: WireGuardBackendGo()) { logLevel, message in
pp_log(.wireguard, osLogLevel: logLevel.osLogLevel, message)
}
}()

private lazy var delegate: WireGuardAdapterDelegate = AdapterDelegate(connection: self)

public init(
parameters: ConnectionParameters,
module: WireGuardModule
Expand Down

0 comments on commit e87128e

Please sign in to comment.