aquatic_ws_protocol: add comment OutMessage::from_ws_message

This commit is contained in:
Joakim Frostegård 2020-08-09 04:27:06 +02:00
parent 4bffecc345
commit 1d2dfe3fe1

View file

@ -304,6 +304,8 @@ impl OutMessage {
_ => return Err(anyhow::anyhow!("Message is neither text nor bytes")),
};
// This is brittle and could fail, but it doesn't matter too much
// since this function is only used in load tester
if text.contains("answer"){
Ok(Self::Answer(::serde_json::from_str(&text)?))
} else if text.contains("offer"){