Update conn.go

This commit is contained in:
forkfury 2025-09-16 23:34:07 +02:00 committed by GitHub
parent 6a7f64e760
commit a8891b23ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -350,9 +350,8 @@ loop:
}
return fmt.Errorf("disconnect received: %v", pretty.Sdump(msg))
case pingMsg:
// TODO (renaynay): in the future, this should be an error
// (PINGs should not be a response upon fresh connection)
c.Write(baseProto, pongMsg, nil)
// PINGs should not be a response upon fresh connection
return fmt.Errorf("unexpected ping message during status exchange")
default:
return fmt.Errorf("bad status message: code %d", code)
}