Skip to content

Commit

Permalink
dialers: m log duration as str
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Oct 31, 2023
1 parent 009c81d commit 624208b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions intra/dialers/ndial.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ func netdial(d *net.Dialer, network, addr string, connect netConnectFunc) (net.C
log.W("ndial: ip %s for %s failed with err %v", ip, addr, err)
}

dur := time.Since(start).Seconds()
log.D("ndial: duration: %ds; failed %s", dur*1000, addr)
dur := time.Since(start)
log.D("ndial: duration: %s; failed %s", dur, addr)
// xxx: return nil, errNoIps?
return d.Dial(network, addr)
}
Expand Down
4 changes: 2 additions & 2 deletions intra/dialers/pdial.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func proxydial(d proxy.Dialer, network, addr string, connect proxyConnectFunc) (
log.W("pdial: ip %s for %s failed with err %v", ip, addr, err)
}

dur := time.Since(start).Seconds()
log.D("pdial: duration: %ds; failed %s", dur*1000, addr)
dur := time.Since(start)
log.D("pdial: duration: %s; failed %s", dur, addr)

// for example, socks5 proxy does not support dialing hostnames
return nil, errNoIps
Expand Down
4 changes: 2 additions & 2 deletions intra/dialers/rdial.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func commondial(d *protect.RDial, network, addr string, connect connectFunc) (ne
log.W("rdial: commondial: ip %s for %s failed with err %v", ip, addr, err)
}

dur := time.Since(start).Seconds()
log.D("rdial: commondial: duration: %ds; failed %s", dur*1000, addr)
dur := time.Since(start)
log.D("rdial: commondial: duration: %s; failed %s", dur, addr)
// xxx: return nil, errNoIps
return d.Dial(network, addr)
}
Expand Down
4 changes: 2 additions & 2 deletions intra/dialers/tlsdial.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ func tlsdial(d *tls.Dialer, network, addr string, connect tlsConnectFunc) (net.C
log.W("tlsdial: ip %s for %s failed with err %v", ip, addr, err)
}

dur := time.Since(start).Seconds()
log.D("tlsdial: duration: %ds; failed %s", dur*1000, addr)
dur := time.Since(start)
log.D("tlsdial: duration: %s; failed %s", dur, addr)

return nil, errNoIps
}
Expand Down

0 comments on commit 624208b

Please sign in to comment.