We very regularly receive confusion over the super generic
"Peer sent invalid data or we decided to disconnect due to a
protocol error" message, which doesn't say very much. Usually, we
end up disconnecting because we have a duplicate connection with a
peer, which doesn't merit such a scary message.
Instead, here we clarify the error message to just refer to the
fact that we're disconnecting, and note that its usually a dup
connection in a parenthetical.
match self.do_read_event(peer_descriptor, data) {
Ok(res) => Ok(res),
Err(e) => {
- log_trace!(self.logger, "Peer sent invalid data or we decided to disconnect due to a protocol error");
+ log_trace!(self.logger, "Disconnecting peer due to a protocol error (usually a duplicate connection).");
self.disconnect_event_internal(peer_descriptor);
Err(e)
}