frame: correctly parse AUTH_SUCCESS
AUTH_SUCCESS contains a possibly-null [bytes] value, but it was parsed
as a non-null [string]. On password authentication success, Scylla
returns an empty [bytes] value (which correctly parses as a non-null
[string]), but Cassandra returns a null [bytes] value. Now, the frame is
correctly parsed as nullable [bytes].
@@ -17,12 +17,12 @@ impl Authenticate {
#[derive(Debug)]
pub struct AuthSuccess {
- pub success_message: String,
+ pub success_message: Option<Vec<u8>>,
}
impl AuthSuccess {
pub fn deserialize(buf: &mut &[u8]) -> Result<Self, ParseError> {
- let success_message = types::read_string(buf)?.to_string();
+ let success_message = types::read_bytes_opt(buf)?.map(|b| b.to_owned());
Ok(AuthSuccess { success_message })
}
