summaryrefslogtreecommitdiffstats
path: root/lib/agent/webserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/agent/webserver.go')
-rw-r--r--lib/agent/webserver.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/agent/webserver.go b/lib/agent/webserver.go
index 2f24c6c..4deb738 100644
--- a/lib/agent/webserver.go
+++ b/lib/agent/webserver.go
@@ -246,13 +246,15 @@ func (s *WebServer) socketHandler(c *gin.Context) {
}
s.sIOServer.On("connection", func(so socketio.Socket) {
- s.Log.Debugf("WS Connected (WSID=%s, SID=%s)", so.Id(), sess.ID)
- s.sessions.UpdateIOSocket(sess.ID, &so)
+ sessID := sess.ID
+
+ s.Log.Debugf("WS Connected (sessID=%s, WS SID=%s)", sessID, so.Id())
+ s.sessions.UpdateIOSocket(sessID, &so)
so.On("disconnection", func() {
- s.Log.Debugf("WS disconnected (WSID=%s, SID=%s)", so.Id(), sess.ID)
- s.events.UnRegister(xaapiv1.EVTAll, sess.ID)
- s.sessions.UpdateIOSocket(sess.ID, nil)
+ s.Log.Debugf("WS disconnected (sessID=%s, WS SID=%s)", sessID, so.Id())
+ s.events.UnRegister(xaapiv1.EVTAll, sessID)
+ s.sessions.UpdateIOSocket(sessID, nil)
})
})