From f772c7cfed0e2885c6d8d2f7fc84f8cf2bb259fa Mon Sep 17 00:00:00 2001 From: Yujia Qiao Date: Fri, 21 Jan 2022 19:06:35 +0800 Subject: [PATCH] fix: remove `assert_eq` for `read_hello` --- src/protocol.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/protocol.rs b/src/protocol.rs index d766c89..4419c85 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -192,9 +192,13 @@ pub async fn read_hello(conn: &mut T) -> Resu } } Hello::DataChannelHello(v, _) => { - // This assert should not fail because the version has already been - // checked by ControlChannelHello. - assert_eq!(v, CURRENT_PROTO_VERSION); + if v != CURRENT_PROTO_VERSION { + bail!( + "Protocol version mismatched. Expected {}, got {}. Please update `rathole`.", + CURRENT_PROTO_VERSION, + v + ); + } } }