mirror of
https://github.com/fhmq/hmq.git
synced 2026-05-04 07:08:32 +00:00
Add addr in broekr log (#146)
This commit is contained in:
@@ -283,7 +283,7 @@ func (b *Broker) handleConnection(typ int, conn net.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("read connect from ", zap.String("clientID", msg.ClientIdentifier))
|
||||
log.Info("read connect from ", zap.String("clientID", msg.ClientIdentifier), zap.String("addr", conn.RemoteAddr().String()))
|
||||
|
||||
connack := packets.NewControlPacket(packets.Connack).(*packets.ConnackPacket)
|
||||
connack.SessionPresent = msg.CleanSession
|
||||
@@ -360,7 +360,8 @@ func (b *Broker) handleConnection(typ int, conn net.Conn) {
|
||||
case CLIENT:
|
||||
old, exist = b.clients.Load(cid)
|
||||
if exist {
|
||||
log.Warn("client exist, close old...", zap.String("clientID", c.info.clientID))
|
||||
log.Warn("client exist, close old...", zap.String("clientID", c.info.clientID),
|
||||
zap.String("addr", conn.RemoteAddr().String()))
|
||||
ol, ok := old.(*client)
|
||||
if ok {
|
||||
ol.Close()
|
||||
|
||||
Reference in New Issue
Block a user