Skip to content

fix: Improve use of context in websocket.NetConn code paths #6198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert one change
  • Loading branch information
mafredri committed Feb 14, 2023
commit 2fa36d2dd05f9077eb420397cc1bcbe39bfaa360
4 changes: 1 addition & 3 deletions codersdk/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, opti
options.Logger.Debug(ctx, "failed to dial", slog.Error(err))
continue
}
ctx, wsNetConn := websocketNetConn(ctx, ws, websocket.MessageBinary)
defer wsNetConn.Close()
sendNode, errChan := tailnet.ServeCoordinator(wsNetConn, func(node []*tailnet.Node) error {
sendNode, errChan := tailnet.ServeCoordinator(websocket.NetConn(ctx, ws, websocket.MessageBinary), func(node []*tailnet.Node) error {
return conn.UpdateNodes(node)
})
conn.SetNodeCallback(sendNode)
Expand Down