mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
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:
parent
0df5507c81
commit
000c0a70f6
@ -320,7 +320,6 @@ func (b *LocalBackend) StreamServe(ctx context.Context, w io.Writer, req ipn.Ser
|
|||||||
// Clean up streamer when done.
|
// Clean up streamer when done.
|
||||||
defer func() {
|
defer func() {
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
mak.NonNilMapForJSON(&b.serveStreamers)
|
|
||||||
delete(b.serveStreamers[port], id)
|
delete(b.serveStreamers[port], id)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
}()
|
}()
|
||||||
@ -400,7 +399,7 @@ func (b *LocalBackend) maybeLogServeConnection(destPort uint16, srcAddr netip.Ad
|
|||||||
|
|
||||||
var log ipn.FunnelRequestLog
|
var log ipn.FunnelRequestLog
|
||||||
log.SrcAddr = srcAddr
|
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 {
|
if node, user, ok := b.WhoIs(srcAddr); ok {
|
||||||
log.NodeName = node.ComputedName()
|
log.NodeName = node.ComputedName()
|
||||||
|
@ -78,15 +78,16 @@ type FunnelConn struct {
|
|||||||
Src netip.AddrPort
|
Src netip.AddrPort
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServeStreamRequest defines the json request body
|
// ServeStreamRequest defines the JSON request body
|
||||||
// for the serve stream endpoint
|
// for the serve stream endpoint
|
||||||
type ServeStreamRequest struct {
|
type ServeStreamRequest struct {
|
||||||
// HostPort is the DNS and port of the tailscale
|
// HostPort is the DNS and port of the tailscale
|
||||||
// URL.
|
// URL.
|
||||||
HostPort HostPort `json:",omitempty"`
|
HostPort HostPort `json:",omitempty"`
|
||||||
|
|
||||||
// Source is the user's serve destination
|
// Source is the user's serve source
|
||||||
// such as their localhost server.
|
// as defined in the `tailscale serve`
|
||||||
|
// command such as http://127.0.0.1:3000
|
||||||
Source string `json:",omitempty"`
|
Source string `json:",omitempty"`
|
||||||
|
|
||||||
// MountPoint is the path prefix for
|
// MountPoint is the path prefix for
|
||||||
|
Loading…
Reference in New Issue
Block a user