change to debug level message

This commit is contained in:
c9s 2021-12-29 17:28:45 +08:00
parent b637d46c83
commit 6030a62cf0

View File

@ -309,6 +309,7 @@ func (s *Stream) dial(listenKey string) (*websocket.Conn, error) {
// Unsolicited pong frames are allowed.
conn.SetPingHandler(nil)
conn.SetPongHandler(func(string) error {
log.Debugf("websocket <- received pong")
if err := conn.SetReadDeadline(time.Now().Add(readTimeout * 2)); err != nil {
log.WithError(err).Error("pong handler can not set read deadline")
}
@ -451,7 +452,7 @@ func (s *Stream) ping(ctx context.Context) {
conn := s.Conn
s.ConnLock.Unlock()
log.Infof("websocket ping")
log.Debugf("websocket -> ping")
if err := conn.WriteControl(websocket.PingMessage, nil, time.Now().Add(writeTimeout)); err != nil {
log.WithError(err).Error("ping error", err)
s.Reconnect()