prevent loop when none input
This commit is contained in:
parent
5dc2457a15
commit
c0ce3b7bff
|
@ -1,7 +1,7 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
/// Manage UCI messages and link into chess component
|
/// Manage UCI messages and link into chess component
|
||||||
mod uci_command;
|
pub mod uci_command;
|
||||||
|
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use std::io::*;
|
use std::io::*;
|
||||||
|
@ -63,8 +63,10 @@ impl<Fi: Read, Fo: Write> UciEngine<Fi, Fo> {
|
||||||
self.push(GuiCommand::Uci);
|
self.push(GuiCommand::Uci);
|
||||||
|
|
||||||
// Consume commands until uciok messages
|
// Consume commands until uciok messages
|
||||||
while !self.uciok {
|
if self.source.is_some() {
|
||||||
self.pull();
|
while !self.uciok {
|
||||||
|
self.pull();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue