ipn, ipn/ipnlocal: clean up documentation and use clock instead of time

This PR addresses a number of the follow ups from PR #8491 that were written
after getting merged.

Updates #8489

Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
This commit is contained in:
Marwan Sulaiman
2023-08-22 17:57:43 +01:00
committed by Marwan Sulaiman
parent 0df5507c81
commit 000c0a70f6
2 changed files with 5 additions and 5 deletions

View File

@@ -320,7 +320,6 @@ func (b *LocalBackend) StreamServe(ctx context.Context, w io.Writer, req ipn.Ser
// Clean up streamer when done.
defer func() {
b.mu.Lock()
mak.NonNilMapForJSON(&b.serveStreamers)
delete(b.serveStreamers[port], id)
b.mu.Unlock()
}()
@@ -400,7 +399,7 @@ func (b *LocalBackend) maybeLogServeConnection(destPort uint16, srcAddr netip.Ad
var log ipn.FunnelRequestLog
log.SrcAddr = srcAddr
log.Time = time.Now() // TODO: use a different clock somewhere?
log.Time = b.clock.Now()
if node, user, ok := b.WhoIs(srcAddr); ok {
log.NodeName = node.ComputedName()