From ded5853026a30188c68aaace5c279922830397c5 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 20 Nov 2025 21:24:58 -0600 Subject: [PATCH] move platformGetRTT implementation to tcp_common.go for non-Linux platforms --- pkg/interfaces/tcp_common.go | 10 ++++++++++ pkg/interfaces/tcp_darwin.go | 5 ----- pkg/interfaces/tcp_freebsd.go | 4 ---- pkg/interfaces/tcp_windows.go | 3 --- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pkg/interfaces/tcp_common.go b/pkg/interfaces/tcp_common.go index 1763e27..622cceb 100644 --- a/pkg/interfaces/tcp_common.go +++ b/pkg/interfaces/tcp_common.go @@ -2,3 +2,13 @@ // +build !linux package interfaces + +import ( + "time" +) + +// platformGetRTT is defined in OS-specific files +// Default implementation for non-Linux platforms +func platformGetRTT(fd uintptr) time.Duration { + return 0 +} diff --git a/pkg/interfaces/tcp_darwin.go b/pkg/interfaces/tcp_darwin.go index 88273e3..c02d867 100644 --- a/pkg/interfaces/tcp_darwin.go +++ b/pkg/interfaces/tcp_darwin.go @@ -6,7 +6,6 @@ import ( "fmt" "net" "syscall" - "time" "github.com/Sudo-Ivan/reticulum-go/pkg/debug" ) @@ -58,7 +57,3 @@ func (tc *TCPClientInterface) setTimeoutsOSX() error { return nil } -func platformGetRTT(fd uintptr) time.Duration { - return 0 -} - diff --git a/pkg/interfaces/tcp_freebsd.go b/pkg/interfaces/tcp_freebsd.go index b5920c1..caabd8b 100644 --- a/pkg/interfaces/tcp_freebsd.go +++ b/pkg/interfaces/tcp_freebsd.go @@ -37,7 +37,3 @@ func (tc *TCPClientInterface) setTimeoutsOSX() error { return tc.setTimeoutsLinux() } -func platformGetRTT(fd uintptr) time.Duration { - return 0 -} - diff --git a/pkg/interfaces/tcp_windows.go b/pkg/interfaces/tcp_windows.go index 489f0d6..c81f001 100644 --- a/pkg/interfaces/tcp_windows.go +++ b/pkg/interfaces/tcp_windows.go @@ -39,7 +39,4 @@ func (tc *TCPClientInterface) setTimeoutsWindows() error { return nil } -func platformGetRTT(fd uintptr) time.Duration { - return 0 -}