Stop incrementing hopcount in RPL_WHOREPLY

It's extra code for something clients should ignore because it's
unreliable and useless.
This commit is contained in:
Simon Ser 2021-12-06 18:08:53 +01:00
parent 548b1c6930
commit f881a42b4b

View File

@ -1338,19 +1338,6 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
return nil return nil
} }
parts := strings.SplitN(trailing, " ", 2)
if len(parts) != 2 {
return fmt.Errorf("received malformed RPL_WHOREPLY: wrong trailing parameter: %s", trailing)
}
realname := parts[1]
hops, err := strconv.Atoi(parts[0])
if err != nil {
return fmt.Errorf("received malformed RPL_WHOREPLY: wrong hop count: %s", parts[0])
}
hops++
trailing = strconv.Itoa(hops) + " " + realname
if channel != "*" { if channel != "*" {
channel = dc.marshalEntity(uc.network, channel) channel = dc.marshalEntity(uc.network, channel)
} }