From 2de75dc0474811f52369a45fbe0487c4471fcb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Moyne?= Date: Thu, 10 Aug 2023 11:28:20 -0700 Subject: [PATCH] Implement PR feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-Noël Moyne --- server/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/server.go b/server/server.go index ee6b0bc92aa..b24e438bcf5 100644 --- a/server/server.go +++ b/server/server.go @@ -4253,7 +4253,7 @@ func (s *Server) changeRateLimitLogInterval(d time.Duration) { } } -// Disconnects a client by cid +// DisconnectClientByID disconnects a client by connection ID func (s *Server) DisconnectClientByID(id uint64) error { client := s.clients[id] if client != nil { @@ -4263,6 +4263,7 @@ func (s *Server) DisconnectClientByID(id uint64) error { return errors.New("no such client id") } +// LDMClientByID sends a Lame Duck Mode info message to a client by connection ID func (s *Server) LDMClientByID(id uint64) error { info := s.copyInfo() info.LameDuckMode = true @@ -4272,7 +4273,7 @@ func (s *Server) LDMClientByID(id uint64) error { c.flags.isSet(firstPongSent) { // sendInfo takes care of checking if the connection is still // valid or not, so don't duplicate tests here. - s.Debugf("sending LDM info to cid=%d", id) + c.Debugf("sending Lame Duck Mode info to client") c.enqueueProto(c.generateClientInfoJSON(info)) return nil }