aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/webserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xdsserver/webserver.go')
-rw-r--r--lib/xdsserver/webserver.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/xdsserver/webserver.go b/lib/xdsserver/webserver.go
index f1c88d2..24456b9 100644
--- a/lib/xdsserver/webserver.go
+++ b/lib/xdsserver/webserver.go
@@ -43,8 +43,8 @@ type WebServer struct {
const indexFilename = "index.html"
-// NewWebServer creates an instance of WebServer
-func NewWebServer(ctx *Context) *WebServer {
+// WebServerConstructor creates an instance of WebServer
+func WebServerConstructor(ctx *Context) *WebServer {
// Setup logging for gin router
if ctx.Log.Level == logrus.DebugLevel {
@@ -183,11 +183,12 @@ func (s *WebServer) socketHandler(c *gin.Context) {
}
s.sIOServer.On("connection", func(so socketio.Socket) {
- s.Log.Debugf("WS Connected (SID=%v)", so.Id())
- s.sessions.UpdateIOSocket(sess.ID, &so)
+ sessID := sess.ID
+ s.Log.Debugf("WS Connected (sessID=%v, SID=%v)", sessID, so.Id())
+ s.sessions.UpdateIOSocket(sessID, &so)
so.On("disconnection", func() {
- s.Log.Debugf("WS disconnected (SID=%v)", so.Id())
+ s.Log.Debugf("WS disconnected (sessID=%v, SID=%v)", sessID, so.Id())
s.sessions.UpdateIOSocket(sess.ID, nil)
})
})