derp/derphttp: use a getter method to read server key

To hold the mutex while accessing it.

Fixes #10122

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
Anton Tolchanov 2023-11-06 11:19:14 +00:00 committed by Anton Tolchanov
parent 44c6909c92
commit ef6a6e94f1

View File

@ -100,7 +100,7 @@ type Client struct {
}
func (c *Client) String() string {
return fmt.Sprintf("<derphttp_client.Client %s url=%s>", c.serverPubKey.ShortString(), c.url)
return fmt.Sprintf("<derphttp_client.Client %s url=%s>", c.ServerPublicKey().ShortString(), c.url)
}
// NewRegionClient returns a new DERP-over-HTTP client. It connects lazily.