diff options
| author | JJ <[email protected]> | 2022-06-13 11:34:31 -0400 |
|---|---|---|
| committer | JJ <[email protected]> | 2022-06-13 11:34:31 -0400 |
| commit | a32ace3c60721d1bae4ea77117ffd14a35b0f951 (patch) | |
| tree | 223491fac01200e49302b477e512b5f7ebccf2ae /extendedstats/unix.go | |
| parent | c8f9b3337ee493ea1ac56d70a1a53ab9442121b9 (diff) | |
| parent | c93a4dedc897f84992a6a34200fe954ba2ca435d (diff) | |
Merge branch 'main' into timeout-patch
Diffstat (limited to 'extendedstats/unix.go')
| -rw-r--r-- | extendedstats/unix.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extendedstats/unix.go b/extendedstats/unix.go index c4dc065..fb4a2c8 100644 --- a/extendedstats/unix.go +++ b/extendedstats/unix.go @@ -1,5 +1,5 @@ //go:build dragonfly || freebsd || linux || netbsd || openbsd -// +build dragonfly freebsd linux netbsd openbsd +// +build dragonfly freebsd linux netbsd openbsd package extendedstats @@ -24,17 +24,17 @@ func ExtendedStatsAvailable() bool { return true } -func (es *ExtendedStats) IncorporateConnectionStats(rawConn net.Conn) { +func (es *ExtendedStats) IncorporateConnectionStats(rawConn net.Conn) error { tlsConn, ok := rawConn.(*tls.Conn) if !ok { - fmt.Printf("OOPS: Could not get the TCP info for the connection (not a TLS connection)!\n") + return fmt.Errorf("OOPS: Could not get the TCP info for the connection (not a TLS connection)!\n") } tcpConn, ok := tlsConn.NetConn().(*net.TCPConn) if !ok { - fmt.Printf("OOPS: Could not get the TCP info for the connection (not a TCP connection)!\n") + return fmt.Errorf("OOPS: Could not get the TCP info for the connection (not a TCP connection)!\n") } if info, err := getTCPInfo(tcpConn); err != nil { - fmt.Printf("OOPS: Could not get the TCP info for the connection: %v!\n", err) + return fmt.Errorf("OOPS: Could not get the TCP info for the connection: %v!\n", err) } else { es.MaxPathMtu = utilities.Max(es.MaxPathMtu, uint64(info.Pmtu)) // https://lkml.iu.edu/hypermail/linux/kernel/1705.0/01790.html @@ -42,8 +42,8 @@ func (es *ExtendedStats) IncorporateConnectionStats(rawConn net.Conn) { es.total_rtt += float64(info.Rtt) es.rtt_measurements += 1 es.AverageRtt = es.total_rtt / float64(es.rtt_measurements) - } + return nil } func (es *ExtendedStats) Repr() string { |
