Remove a few prints, add some whitespace.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
bc279b1e79
commit
12e33681c1
|
@ -20,7 +20,6 @@ extension AppCoordinator: TunnelInfoTableViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func configure(tunnel: Tunnel, tunnelInfoTableViewController: TunnelInfoTableViewController) {
|
func configure(tunnel: Tunnel, tunnelInfoTableViewController: TunnelInfoTableViewController) {
|
||||||
print("configure tunnel \(tunnel)")
|
|
||||||
let editContext = persistentContainer.newBackgroundContext()
|
let editContext = persistentContainer.newBackgroundContext()
|
||||||
var backgroundTunnel: Tunnel?
|
var backgroundTunnel: Tunnel?
|
||||||
editContext.performAndWait {
|
editContext.performAndWait {
|
||||||
|
|
|
@ -63,14 +63,10 @@ extension AppCoordinator: TunnelsTableViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func info(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
func info(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
||||||
print("info tunnel \(tunnel)")
|
|
||||||
|
|
||||||
showTunnelInfoViewController(tunnel: tunnel, context: self.persistentContainer.viewContext)
|
showTunnelInfoViewController(tunnel: tunnel, context: self.persistentContainer.viewContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
func delete(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
func delete(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
||||||
print("delete tunnel \(tunnel)")
|
|
||||||
|
|
||||||
if let moc = tunnel.managedObjectContext {
|
if let moc = tunnel.managedObjectContext {
|
||||||
moc.perform {
|
moc.perform {
|
||||||
moc.delete(tunnel)
|
moc.delete(tunnel)
|
||||||
|
|
|
@ -71,8 +71,7 @@ class AppCoordinator: RootViewCoordinator { // swiftlint:disable:this type_body_
|
||||||
self.persistentContainer.viewContext.automaticallyMergesChangesFromParent = true
|
self.persistentContainer.viewContext.automaticallyMergesChangesFromParent = true
|
||||||
self.persistentContainer.loadPersistentStores { [weak self] (_, error) in
|
self.persistentContainer.loadPersistentStores { [weak self] (_, error) in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
print("Unable to Load Persistent Store. \(error), \(error.localizedDescription)")
|
os_log("Unable to load Persistent Store: %{public}@", log: Log.general, type: .error, error.localizedDescription)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
//start
|
//start
|
||||||
|
@ -81,13 +80,6 @@ class AppCoordinator: RootViewCoordinator { // swiftlint:disable:this type_body_
|
||||||
self?.tunnelsTableViewController.viewContext = self?.persistentContainer.viewContext
|
self?.tunnelsTableViewController.viewContext = self?.persistentContainer.viewContext
|
||||||
self?.tunnelsTableViewController.delegate = self
|
self?.tunnelsTableViewController.delegate = self
|
||||||
self?.navigationController.viewControllers = [tunnelsTableViewController]
|
self?.navigationController.viewControllers = [tunnelsTableViewController]
|
||||||
do {
|
|
||||||
if let context = self?.persistentContainer.viewContext, try Tunnel.countInContext(context) == 0 {
|
|
||||||
print("No tunnels ... yet")
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
self?.showError(error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
|
||||||
if validatedIPv6Addresses.count > 0 {
|
if validatedIPv6Addresses.count > 0 {
|
||||||
let ipv6Settings = NEIPv6Settings(addresses: validatedIPv6Addresses.map { $0.ipAddress }, networkPrefixLengths: validatedIPv6Addresses.map { NSNumber(value: $0.subnet) })
|
let ipv6Settings = NEIPv6Settings(addresses: validatedIPv6Addresses.map { $0.ipAddress }, networkPrefixLengths: validatedIPv6Addresses.map { NSNumber(value: $0.subnet) })
|
||||||
ipv6Settings.includedRoutes = [NEIPv6Route.default()]
|
ipv6Settings.includedRoutes = [NEIPv6Route.default()]
|
||||||
ipv6Settings.excludedRoutes = validatedEndpoints.filter { $0.addressType == .IPv6}.map { NEIPv6Route(destinationAddress: $0.ipAddress, networkPrefixLength: 128)}
|
ipv6Settings.excludedRoutes = validatedEndpoints.filter { $0.addressType == .IPv6 }.map { NEIPv6Route(destinationAddress: $0.ipAddress, networkPrefixLength: 128) }
|
||||||
|
|
||||||
newSettings.ipv6Settings = ipv6Settings
|
newSettings.ipv6Settings = ipv6Settings
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue