summaryrefslogtreecommitdiffhomepage
path: root/control/controlhttp/controlhttpserver/controlhttpserver.go
diff options
context:
space:
mode:
authorNick Khyl <nickk@tailscale.com>2025-01-13 17:42:12 -0600
committerNick Khyl <1761190+nickkhyl@users.noreply.github.com>2025-01-14 15:54:43 -0600
commitf33f5f99c00f187644bf807b5336e2008e0228b7 (patch)
tree983a14bac7ed4b87adb8632c5d95fae8def001a7 /control/controlhttp/controlhttpserver/controlhttpserver.go
parentc3c4c964898716511142e448f6e1006daace28f8 (diff)
downloadtailscale-f33f5f99c00f187644bf807b5336e2008e0228b7.tar.xz
tailscale-f33f5f99c00f187644bf807b5336e2008e0228b7.zip
ipn/{ipnlocal,ipnserver}: remove redundant (*LocalBackend).ResetForClientDisconnect
In this commit, we add a failing test to verify that ipn/ipnserver.Server correctly sets and unsets the current user when two different users connect sequentially (A connects, A disconnects, B connects, B disconnects). We then fix the test by updating (*ipn/ipnserver.Server).addActiveHTTPRequest to avoid calling (*LocalBackend).ResetForClientDisconnect again after a new user has connected and been set as the current user with (*LocalBackend).SetCurrentUser(). Since ipn/ipnserver.Server does not allow simultaneous connections from different Windows users and relies on the LocalBackend's current user, and since we already reset the LocalBackend's state by calling ResetForClientDisconnect when the last active request completes (indicating the server is idle and can accept connections from any Windows user), it is unnecessary to track the last connected user on the ipnserver.Server side or call ResetForClientDisconnect again when the user changes. Additionally, the second call to ResetForClientDisconnect occurs after the new user has been set as the current user, resetting the correct state for the new user instead of the old state of the now-disconnected user, causing issues. Updates tailscale/corp#25804 Signed-off-by: Nick Khyl <nickk@tailscale.com>
Diffstat (limited to 'control/controlhttp/controlhttpserver/controlhttpserver.go')
0 files changed, 0 insertions, 0 deletions