MCPcopy
hub / github.com/wavetermdev/waveterm / unregisterConn

Function unregisterConn

pkg/web/ws.go:239–251  ·  view source on GitHub ↗
(wsConnId string, stableId string)

Source from the content-addressed store, hash-verified

237}
238
239func unregisterConn(wsConnId string, stableId string) {
240 GlobalLock.Lock()
241 defer GlobalLock.Unlock()
242 curConnInfo := RouteToConnMap[stableId]
243 if curConnInfo == nil || curConnInfo.ConnId != wsConnId {
244 log.Printf("[websocket] warning: trying to unregister connection %q for stableid %q but it is not the current connection (ignoring)\n", wsConnId, stableId)
245 return
246 }
247 delete(RouteToConnMap, stableId)
248 if curConnInfo.LinkId != baseds.NoLinkId {
249 wshutil.DefaultRouter.UnregisterLink(curConnInfo.LinkId)
250 }
251}
252
253func HandleWsInternal(w http.ResponseWriter, r *http.Request) error {
254 stableId := r.URL.Query().Get("stableid")

Callers 1

HandleWsInternalFunction · 0.85

Calls 1

UnregisterLinkMethod · 0.80

Tested by

no test coverage detected