mirror of
https://github.com/speyejack/smo-multi-rs.git
synced 2025-10-05 23:52:48 +02:00
Force packet resizing on broadcast
This commit is contained in:
@@ -254,7 +254,8 @@ impl Coordinator {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
async fn broadcast(&mut self, p: Packet) -> Result<()> {
|
||||
async fn broadcast(&mut self, mut p: Packet) -> Result<()> {
|
||||
p.resize();
|
||||
for cli in &mut self.to_clients.values() {
|
||||
cli.send(Command::Packet(p.clone())).await?;
|
||||
}
|
||||
|
@@ -38,6 +38,10 @@ impl Packet {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn resize(&mut self) {
|
||||
self.data_size = self.data.get_size() as u16;
|
||||
}
|
||||
|
||||
pub fn check(buf: &mut Cursor<&[u8]>) -> Result<u64> {
|
||||
let header_size = 16 + 2;
|
||||
let start_pos = buf.position();
|
||||
|
Reference in New Issue
Block a user