@@ -1636,12 +1636,6 @@ final class RouteManager: ObservableObject {
16361636
16371637 /// Nonisolated DNS resolution - runs truly in parallel without MainActor serialization
16381638 private nonisolated static func resolveIPsParallel( for domain: String , userDNS: String ? , fallbackDNS: [ String ] ) async -> [ String ] ? {
1639- // Debug for specific domains
1640- let debugDomain = domain. contains ( " lynxprompt " ) || domain. contains ( " test.com " )
1641- if debugDomain {
1642- debugLog ( " [DNS] \( domain) : userDNS= \( userDNS ?? " nil " ) , fallbackDNS= \( fallbackDNS) " )
1643- }
1644-
16451639 // 1. Try detected non-VPN DNS first (user's original DNS before VPN)
16461640 if let userDNS = userDNS {
16471641 if let ips = await resolveWithDNSParallel ( domain, dns: userDNS) {
@@ -1656,30 +1650,9 @@ final class RouteManager: ObservableObject {
16561650 }
16571651 }
16581652
1659- if debugDomain {
1660- debugLog ( " [DNS] \( domain) : ALL DNS FAILED " )
1661- }
16621653 return nil
16631654 }
16641655
1665- /// Debug logging to file (for nonisolated contexts)
1666- private nonisolated static func debugLog( _ message: String ) {
1667- let timestamp = ISO8601DateFormatter ( ) . string ( from: Date ( ) )
1668- let line = " [ \( timestamp) ] \( message) \n "
1669- let path = " /tmp/vpnbypass-debug.log "
1670- if let data = line. data ( using: . utf8) {
1671- if FileManager . default. fileExists ( atPath: path) {
1672- if let handle = FileHandle ( forWritingAtPath: path) {
1673- handle. seekToEndOfFile ( )
1674- handle. write ( data)
1675- handle. closeFile ( )
1676- }
1677- } else {
1678- FileManager . default. createFile ( atPath: path, contents: data)
1679- }
1680- }
1681- }
1682-
16831656 private nonisolated static func resolveWithDNSParallel( _ domain: String , dns: String ) async -> [ String ] ? {
16841657 // Check protocol type
16851658 if dns. hasPrefix ( " https:// " ) {
@@ -1698,22 +1671,13 @@ final class RouteManager: ObservableObject {
16981671 // Regular DNS via dig - uses async dispatch to GCD for true parallelism
16991672 let args = [ " @ \( dns) " , " +short " , " +time=1 " , " +tries=1 " , domain]
17001673 guard let result = await runProcessParallel ( " /usr/bin/dig " , arguments: args, timeout: 2.0 ) else {
1701- // Debug: log timeout/failure for specific domains
1702- if domain. contains ( " lynxprompt " ) || domain. contains ( " test.com " ) {
1703- debugLog ( " [DNS] \( domain) @ \( dns) : process failed/timeout " )
1704- }
17051674 return nil
17061675 }
17071676
17081677 let ips = result. output. components ( separatedBy: " \n " )
17091678 . map { $0. trimmingCharacters ( in: . whitespaces) }
17101679 . filter { !$0. isEmpty && isValidIPStatic ( $0) }
17111680
1712- // Debug: log results for specific domains
1713- if domain. contains ( " lynxprompt " ) || domain. contains ( " test.com " ) {
1714- debugLog ( " [DNS] \( domain) @ \( dns) : output=' \( result. output. replacingOccurrences ( of: " \n " , with: " \\ n " ) ) ' -> ips= \( ips) " )
1715- }
1716-
17171681 return ips. isEmpty ? nil : ips
17181682 }
17191683
0 commit comments