From 2d6345b4937a98c33462de18b29c16520e693e35 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 10 Apr 2018 12:58:53 +0900 Subject: [PATCH] ing --- config.json | 2 +- servlet/webapp-servlet.go | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index 489f791..c56db16 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "serverHandler": { "name": "Gateway WebApp", "network": "tcp4", - "address": "192.168.1.103:19090", + "address": "127.0.0.1:19090", "concurrency": 262144, "keepAlive": 60, "handshakeTimeout": 60, diff --git a/servlet/webapp-servlet.go b/servlet/webapp-servlet.go index e63dc45..6c37d71 100644 --- a/servlet/webapp-servlet.go +++ b/servlet/webapp-servlet.go @@ -97,7 +97,7 @@ func (s *WebappServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.R token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { // Don't forget to validate the alg is what you expect: if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok { - return nil, fmt.Errorf("Webapp: Unexpected signing method: %v", token.Header["alg"]) + return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) } // hmacSampleSecret is a []byte containing your secret, e.g. []byte("my_secret_key") return verifyKey, nil @@ -157,7 +157,7 @@ func (s *WebappServlets) handleSubscribe(serverCtx server.ServerCtx, subscribeCh } for _, _connection := range _connections { - _writeChan := _connection.servletCtx.GetAttribute(og.SessionWriterChanKey) + _writeChan := _connection.servletCtx.GetAttribute(og.SessionWriteChanKey) if nil != _writeChan { writeChan := _writeChan.(chan<- []byte) writeChan <- msg.Message @@ -165,21 +165,22 @@ func (s *WebappServlets) handleSubscribe(serverCtx server.ServerCtx, subscribeCh } } - case oos.MEMBER_SESSION: - for _, sessionID := range message.Targets { - _connection, ok := s.connections.Load(sessionID) + case ogs.MEMBER_SESSION: + for _, sessionID := range msg.Targets { + __connection, ok := s.connections.Load(sessionID) if !ok { logging.Logger().Debugf("Client[%s] is not exist", sessionID) break } - _writeChan := _connection.servletCtx.GetAttribute(og.SessionWriterChanKey) + _connection := __connection.(*connection) + _writeChan := _connection.servletCtx.GetAttribute(og.SessionWriteChanKey) if nil != _writeChan { writeChan := _writeChan.(chan<- []byte) writeChan <- msg.Message } } default: - logging.Logger().Warnf("Subscriber: Unknown TargetType %s", message.TargetType) + logging.Logger().Warnf("Subscriber: Unknown TargetType %s", msg.TargetType) } } }