rust/hedgewars-server/src/protocol.rs
changeset 15123 1aa3b44c0441
parent 15114 a7841105493e
child 15439 a158ff8f84ef
--- a/rust/hedgewars-server/src/protocol.rs	Tue Jun 04 23:44:01 2019 +0300
+++ b/rust/hedgewars-server/src/protocol.rs	Tue Jun 04 23:59:16 2019 +0300
@@ -46,7 +46,7 @@
     pub fn extract_messages(&mut self) -> Vec<messages::HwProtocolMessage> {
         let mut messages = vec![];
         if !self.is_recovering {
-            loop {
+            while !self.buf.is_empty() {
                 match parser::message(&self.buf[..]) {
                     Ok((tail, message)) => {
                         messages.push(message);