|
|
@@ -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
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|