瀏覽代碼

log debug message on ErrMaxConcurrentSessionsReached

Mike 5 月之前
父節點
當前提交
ea5c4e326e
共有 3 個文件被更改,包括 3 次插入1 次删除
  1. 1 0
      server/oscar/server.go
  2. 1 1
      state/session_manager.go
  3. 1 0
      wire/snacs_string.go

+ 1 - 0
server/oscar/server.go

@@ -246,6 +246,7 @@ func (s oscarServer) connectToOSCARService(
 		instance, err = s.AuthService.RegisterBOSSession(ctx, cookie)
 		if err != nil {
 			if errors.Is(err, state.ErrMaxConcurrentSessionsReached) {
+				s.Logger.Debug("session registration failed", "err", err.Error())
 				block := wire.TLVRestBlock{}
 				// error code indicating the signon is blocked. i can't find a
 				// more appropriate error code to indicate the maximum session limit is reached

+ 1 - 1
state/session_manager.go

@@ -194,7 +194,7 @@ func (s *InMemorySessionManager) AddSession(ctx context.Context, screenName Disp
 
 			// Check if we've reached the maximum number of concurrent sessions
 			if active.session.InstanceCount() >= s.maxConcurrentSessions {
-				return nil, ErrMaxConcurrentSessionsReached
+				return nil, fmt.Errorf("%w: max instance(s) = %d", ErrMaxConcurrentSessionsReached, s.maxConcurrentSessions)
 			}
 
 			instance := active.session.AddInstance()

+ 1 - 0
wire/snacs_string.go

@@ -1,6 +1,7 @@
 package wire
 
 var foodGroupName = map[uint16]string{
+	BOS:         "BOS",
 	OService:    "OService",
 	Locate:      "Locate",
 	Buddy:       "Buddy",