Handle both numerical and binary pings.

This commit is contained in:
Paul
2021-09-11 12:43:26 +01:00
parent 06f968022d
commit fa8eb874d0
2 changed files with 11 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
use crate::database::*;
use crate::notifications::events::Ping;
use crate::util::variables::WS_HOST;
use super::subscriptions;
@@ -140,7 +141,7 @@ async fn accept(stream: TcpStream) {
rmp_serde::decode::from_read::<&[u8], ServerboundNotification>(vec.as_slice())
.map_err(|e| e.to_string())
}
Message::Ping(vec) => Ok(ServerboundNotification::Ping { data: vec, responded: Some(()) }),
Message::Ping(vec) => Ok(ServerboundNotification::Ping { data: Ping::Binary(vec), responded: Some(()) }),
_ => return Ok(()),
};