diff options
author | Jeff Bean <jeffreyrobertbean@gmail.com> | 2018-06-14 08:24:14 -0700 |
---|---|---|
committer | Jeff Bean <jeffreyrobertbean@gmail.com> | 2018-06-14 08:25:20 -0700 |
commit | b73933c4b20e15f468944edd7012a7cc90adf0e7 (patch) | |
tree | 12eea924430fce2ac2c0921fdf013ccec02d662e /server | |
parent | 0d64c69d136d6a49a11c820604ba1dde0cd60799 (diff) |
simple staticcheck issues
Diffstat (limited to 'server')
-rw-r--r-- | server/server_test.go | 2 | ||||
-rw-r--r-- | server/sockopt_darwin.go | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/server/server_test.go b/server/server_test.go index 7f854e73..c75003ed 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -169,7 +169,7 @@ func TestMonitor(test *testing.T) { if len(rib.GetKnownPathList("", 0)) > 0 { break } - time.Sleep(1) + time.Sleep(100 * time.Millisecond) } // Test WatchUpdate with "current" flag. diff --git a/server/sockopt_darwin.go b/server/sockopt_darwin.go index 47cebe44..4bad54ff 100644 --- a/server/sockopt_darwin.go +++ b/server/sockopt_darwin.go @@ -39,19 +39,23 @@ func setsockoptIpTtl(fd int, family int, value int) error { func setListenTcpTTLSockopt(l *net.TCPListener, ttl int) error { fi, family, err := extractFileAndFamilyFromTCPListener(l) - defer fi.Close() if err != nil { return err } + + defer fi.Close() + return setsockoptIpTtl(int(fi.Fd()), family, ttl) } func setTcpTTLSockopt(conn *net.TCPConn, ttl int) error { fi, family, err := extractFileAndFamilyFromTCPConn(conn) - defer fi.Close() if err != nil { return err } + + defer fi.Close() + return setsockoptIpTtl(int(fi.Fd()), family, ttl) } |