Skip to content

Commit bd94e85

Browse files
marwan-at-workalexelisenko
authored andcommitted
ipn, ipn/ipnlocal: clean up documentation and use clock instead of time
This PR addresses a number of the follow ups from PR tailscale#8491 that were written after getting merged. Updates tailscale#8489 Signed-off-by: Marwan Sulaiman <[email protected]> Signed-off-by: Alex Paguis <[email protected]>
1 parent a9b7481 commit bd94e85

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ipn/ipnlocal/serve.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ func (b *LocalBackend) StreamServe(ctx context.Context, w io.Writer, req ipn.Ser
320320
// Clean up streamer when done.
321321
defer func() {
322322
b.mu.Lock()
323-
mak.NonNilMapForJSON(&b.serveStreamers)
324323
delete(b.serveStreamers[port], id)
325324
b.mu.Unlock()
326325
}()
@@ -400,7 +399,7 @@ func (b *LocalBackend) maybeLogServeConnection(destPort uint16, srcAddr netip.Ad
400399

401400
var log ipn.FunnelRequestLog
402401
log.SrcAddr = srcAddr
403-
log.Time = time.Now() // TODO: use a different clock somewhere?
402+
log.Time = b.clock.Now()
404403

405404
if node, user, ok := b.WhoIs(srcAddr); ok {
406405
log.NodeName = node.ComputedName()

ipn/serve.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ type FunnelConn struct {
7878
Src netip.AddrPort
7979
}
8080

81-
// ServeStreamRequest defines the json request body
81+
// ServeStreamRequest defines the JSON request body
8282
// for the serve stream endpoint
8383
type ServeStreamRequest struct {
8484
// HostPort is the DNS and port of the tailscale
8585
// URL.
8686
HostPort HostPort `json:",omitempty"`
8787

88-
// Source is the user's serve destination
89-
// such as their localhost server.
88+
// Source is the user's serve source
89+
// as defined in the `tailscale serve`
90+
// command such as http://127.0.0.1:3000
9091
Source string `json:",omitempty"`
9192

9293
// MountPoint is the path prefix for

0 commit comments

Comments
 (0)