fix protocol race condition
libnyx sends a ping packet twice during initialization which can cause a synchronization problem with QEMU-Nyx
This commit is contained in:
parent
c4b71a05c0
commit
3cceb0caae
@ -172,7 +172,7 @@ impl QemuProcess {
|
|||||||
thread::sleep(time::Duration::from_secs(1));
|
thread::sleep(time::Duration::from_secs(1));
|
||||||
|
|
||||||
thread::sleep(time::Duration::from_millis(200*params.qemu_id as u64));
|
thread::sleep(time::Duration::from_millis(200*params.qemu_id as u64));
|
||||||
|
|
||||||
|
|
||||||
let mut child = if params.dump_python_code_for_inputs{
|
let mut child = if params.dump_python_code_for_inputs{
|
||||||
Command::new(¶ms.cmd[0])
|
Command::new(¶ms.cmd[0])
|
||||||
@ -192,7 +192,7 @@ impl QemuProcess {
|
|||||||
thread::sleep(time::Duration::from_secs(1));
|
thread::sleep(time::Duration::from_secs(1));
|
||||||
|
|
||||||
thread::sleep(time::Duration::from_millis(200*params.qemu_id as u64));
|
thread::sleep(time::Duration::from_millis(200*params.qemu_id as u64));
|
||||||
|
|
||||||
|
|
||||||
let mut control = loop {
|
let mut control = loop {
|
||||||
match UnixStream::connect(¶ms.control_filename) {
|
match UnixStream::connect(¶ms.control_filename) {
|
||||||
@ -203,7 +203,7 @@ impl QemuProcess {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if run_qemu(&mut control).is_err() {
|
if wait_qemu(&mut control).is_err() {
|
||||||
return Err(format!("cannot launch QEMU-Nyx..."));
|
return Err(format!("cannot launch QEMU-Nyx..."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user