mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-08 09:07:44 +00:00
cmd/stunstamp: use measureFn more consistently in naming/signatures (#13360)
Updates #cleanup Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
6d6b1773ea
commit
1dd1798bfa
@ -499,7 +499,7 @@ func newConnAndMeasureFn(forDst netip.Addr, source timestampSource, protocol pro
|
|||||||
}
|
}
|
||||||
return &connAndMeasureFn{
|
return &connAndMeasureFn{
|
||||||
conn: conn,
|
conn: conn,
|
||||||
fn: mkICMPRTTFn(source),
|
fn: mkICMPMeasureFn(source),
|
||||||
}, nil
|
}, nil
|
||||||
case protocolHTTPS:
|
case protocolHTTPS:
|
||||||
localPort := 0
|
localPort := 0
|
||||||
|
@ -54,7 +54,7 @@ func getICMPConn(forDst netip.Addr, source timestampSource) (io.ReadWriteCloser,
|
|||||||
return nil, errors.New("platform unsupported")
|
return nil, errors.New("platform unsupported")
|
||||||
}
|
}
|
||||||
|
|
||||||
func mkICMPRTTFn(source timestampSource) func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
func mkICMPMeasureFn(source timestampSource) measureFn {
|
||||||
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
||||||
return 0, errors.New("platform unsupported")
|
return 0, errors.New("platform unsupported")
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func parseTimestampFromCmsgs(oob []byte) (time.Time, error) {
|
|||||||
return time.Time{}, errors.New("failed to parse timestamp from cmsgs")
|
return time.Time{}, errors.New("failed to parse timestamp from cmsgs")
|
||||||
}
|
}
|
||||||
|
|
||||||
func mkICMPRTTFn(source timestampSource) func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
func mkICMPMeasureFn(source timestampSource) measureFn {
|
||||||
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
return func(conn io.ReadWriteCloser, hostname string, dst netip.AddrPort) (rtt time.Duration, err error) {
|
||||||
return measureICMPRTT(source, conn, hostname, dst)
|
return measureICMPRTT(source, conn, hostname, dst)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user