msgs::DecodeError::BadLengthDescriptor => return,
msgs::DecodeError::ShortRead => panic!("We picked the length..."),
msgs::DecodeError::Io(e) => panic!("{:?}", e),
+ msgs::DecodeError::UnsupportedCompression => return,
}
}
}}
/// Error from std::io
Io(/// (C-not exported) as ErrorKind doesn't have a reasonable mapping
::std::io::ErrorKind),
+ /// The message included zlib-compressed values, which we don't support.
+ UnsupportedCompression,
}
/// An init message to be sent or received from a peer
DecodeError::ShortRead => f.write_str("Packet extended beyond the provided bytes"),
DecodeError::BadLengthDescriptor => f.write_str("A length descriptor in the packet didn't describe the later data correctly"),
DecodeError::Io(ref e) => e.fmt(f),
+ DecodeError::UnsupportedCompression => f.write_str("We don't support receiving messages with zlib-compressed fields"),
}
}
}
}
msgs::DecodeError::BadLengthDescriptor => return Err(PeerHandleError { no_connection_possible: false }),
msgs::DecodeError::Io(_) => return Err(PeerHandleError { no_connection_possible: false }),
+ msgs::DecodeError::UnsupportedCompression => {
+ log_debug!(self.logger, "We don't support zlib-compressed message fields, ignoring message");
+ continue;
+ }
}
}
};