mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
ethstats: ethstats pong reply mangles any ping substring in the nonce
if a ping payload's nonce contain ping, the pong is malformed
This commit is contained in:
parent
95320ffe69
commit
23e2a5573c
1 changed files with 1 additions and 1 deletions
|
|
@ -388,7 +388,7 @@ func (s *Service) readLoop(conn *connWrapper) {
|
|||
// If the network packet is a system ping, respond to it directly
|
||||
var ping string
|
||||
if err := json.Unmarshal(blob, &ping); err == nil && strings.HasPrefix(ping, "primus::ping::") {
|
||||
if err := conn.WriteJSON(strings.ReplaceAll(ping, "ping", "pong")); err != nil {
|
||||
if err := conn.WriteJSON(strings.Replace(ping, "primus::ping::", "primus::pong::", 1)); err != nil {
|
||||
log.Warn("Failed to respond to system ping message", "err", err)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue