Move connection policy out of ProAccess, keep terminal uploads with their session, and share question interaction and highlight editing operations. Consolidate CPU usage and settings snapshot handling, and remove obsolete terminal selection, theme helpers, and hard-coded latest-schema assertions. Fix draining connection-pool recovery and stale pane upload bindings. Keep screenshot matrices opt-in and retain behavioral migration coverage. Validation: 2468 macOS tests passed serially, 31 iOS tests passed, and both SSH forwarding regressions passed against the local OpenSSH fixture. Both app builds, Swift formatting, AppStrings, and Chinese localization checks passed. Parallel test runs still exhibit intermittent timeouts.
24 lines
922 B
Swift
24 lines
922 B
Swift
/// Resolves connection capabilities without changing saved preferences.
|
|
/// The caller determines availability; this policy knows nothing about purchases or UI.
|
|
public nonisolated struct MultiConnectionPolicy: Equatable, Sendable {
|
|
public var allowsMultipleConnections: Bool
|
|
|
|
public init(allowsMultipleConnections: Bool) {
|
|
self.allowsMultipleConnections = allowsMultipleConnections
|
|
}
|
|
|
|
public func sftpStrategy(_ saved: SFTPConcurrencyStrategy) -> SFTPConcurrencyStrategy {
|
|
allowsMultipleConnections ? saved : .channelsOnly
|
|
}
|
|
|
|
public func sftpPreferences(_ saved: SFTPPreferences) -> SFTPPreferences {
|
|
var effective = saved
|
|
effective.strategy = sftpStrategy(saved.strategy)
|
|
return effective
|
|
}
|
|
|
|
public func forwardingConnections(_ saved: Int) -> Int {
|
|
allowsMultipleConnections ? Host.normalizedPortForwardingMaxConnections(saved) : 1
|
|
}
|
|
}
|