Skip to content

Commit

Permalink
Add temp log to validate if this is being used
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Jul 27, 2023
1 parent 5489e6e commit 8103b77
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions common/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,28 +381,40 @@ func (c *Connection) recvLoop() {
// a test iteration) we need to send it to all sessions and the
// connection's event loop.
case msg.ID != 0 && msg.Error != nil && msg.SessionID == "":
c.logger.Infof(
"Connection:recvLoop:msg.ID:msg.Error: lost error message",
"msg:%v", msg,
)
c.sessionsMu.RLock()
for _, s := range c.sessions {
select {
case s.readCh <- &msg:
c.logger.Infof(
"Connection:recvLoop:msg.ID:msg.Error: sent to session",
"sid:%v tid:%v msg:%v", s.id, s.targetID, msg,
)
case code := <-c.closeCh:
c.logger.Debugf(
"Connection:recvLoop:msg.ID:msg.Error:<-c.closeCh",
"sid:%v tid:%v wsURL:%v crashed:%t",
s.id, s.targetID, c.wsURL, s.crashed,
"sid:%v tid:%v crashed:%t",
s.id, s.targetID, s.crashed,
)
_ = c.close(code)
case <-c.done:
c.logger.Debugf(
"Connection:recvLoop:msg.ID:msg.Error:<-c.done",
"sid:%v tid:%v wsURL:%v crashed:%t",
s.id, s.targetID, c.wsURL, s.crashed,
"sid:%v tid:%v crashed:%t",
s.id, s.targetID, s.crashed,
)
return
}
}
c.sessionsMu.RUnlock()
c.emit("", &msg)
c.logger.Infof(
"Connection:recvLoop:msg.ID:msg.Error: sent to connection",
"msg:%v", msg,
)

case msg.Method != "":
c.logger.Debugf("Connection:recvLoop:msg.Method:emit", "sid:%v method:%q", msg.SessionID, msg.Method)
Expand Down

0 comments on commit 8103b77

Please sign in to comment.