diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-01-06 09:33:39 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-01-06 09:33:51 -0800 |
| commit | 4349f50167f50b30d7cd71854882ab33ac6ea5ea (patch) | |
| tree | b140885499c0097c20d83d2596bc2d624d5fea0d /Hotline | |
| parent | 6189e2d4114f8113898fe65a49fc7bf6b52648ce (diff) | |
Disable fast open on TCP connection. Fix some build issues in iOS build.
Diffstat (limited to 'Hotline')
| -rw-r--r-- | Hotline/Hotline/HotlineClient.swift | 5 | ||||
| -rw-r--r-- | Hotline/Models/FilePreview.swift | 4 | ||||
| -rw-r--r-- | Hotline/iOS/TrackerView.swift | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/Hotline/Hotline/HotlineClient.swift b/Hotline/Hotline/HotlineClient.swift index 3e45321..6a487cb 100644 --- a/Hotline/Hotline/HotlineClient.swift +++ b/Hotline/Hotline/HotlineClient.swift @@ -114,12 +114,9 @@ class HotlineClient { self.serverAddress = address self.serverPort = port -// let serverAddress = NWEndpoint.Host(address) -// let serverPort = NWEndpoint.Port(rawValue: port)! - let tcpOptions = NWProtocolTCP.Options() tcpOptions.enableKeepalive = true - tcpOptions.enableFastOpen = true +// tcpOptions.enableFastOpen = true tcpOptions.keepaliveInterval = 30 tcpOptions.connectionTimeout = 30 let connectionParameters: NWParameters diff --git a/Hotline/Models/FilePreview.swift b/Hotline/Models/FilePreview.swift index a7b183f..3a1d225 100644 --- a/Hotline/Models/FilePreview.swift +++ b/Hotline/Models/FilePreview.swift @@ -66,7 +66,11 @@ final class FilePreview: HotlineFileClientDelegate { let fileExtension = (info.name as NSString).pathExtension if let fileType = UTType(filenameExtension: fileExtension) { if fileType.isSubtype(of: .image) { + #if os(iOS) +// self.image = UIImage(data: data) + #elseif os(macOS) self.image = NSImage(data: data) + #endif } } } diff --git a/Hotline/iOS/TrackerView.swift b/Hotline/iOS/TrackerView.swift index 8359468..a40ab03 100644 --- a/Hotline/iOS/TrackerView.swift +++ b/Hotline/iOS/TrackerView.swift @@ -292,7 +292,7 @@ struct TrackerView: View { } else { Button("Connect") { - self.model.login(server: server, login: "", password: "", username: "bolt", iconID: 128) { success in + self.model.login(server: server, username: "bolt", iconID: 128) { success in if !success { print("FAILED LOGIN??") } @@ -391,7 +391,7 @@ struct TrackerView: View { self.model.disconnect() - let tempServer = Server(name: nil, description: nil, address: address, port: port, users: 0) + let tempServer = Server(name: nil, description: nil, address: address, port: port, users: 0, login: login, password: password) self.model.login(server: tempServer, username: "bolt", iconID: 128) { success in if !success { print("FAILED LOGIN??") |