fix: remove `assert_eq` for `read_hello`

This commit is contained in:
Yujia Qiao 2022-01-21 19:06:35 +08:00
parent cdbf8781e4
commit f772c7cfed
No known key found for this signature in database
GPG Key ID: DC129173B148701B
1 changed files with 7 additions and 3 deletions

View File

@ -192,9 +192,13 @@ pub async fn read_hello<T: AsyncRead + AsyncWrite + Unpin>(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
);
}
}
}