make the server not send chunks redundantly when there aren't any to send

This commit is contained in:
りき萌 2025-09-05 20:20:45 +02:00
parent ea70c264fe
commit e9f9e21bc2

View file

@ -429,6 +429,7 @@ impl SessionLoop {
} }
} }
if !chunk_infos.is_empty() {
ws.send(to_message(&Notify::Chunks { ws.send(to_message(&Notify::Chunks {
chunks: chunk_infos, chunks: chunk_infos,
has_more: !self.pending_images.is_empty() has_more: !self.pending_images.is_empty()
@ -436,6 +437,7 @@ impl SessionLoop {
})) }))
.await?; .await?;
ws.send(Message::Binary(packet)).await?; ws.send(Message::Binary(packet)).await?;
}
Ok(()) Ok(())
} }