forked from M-Labs/artiq-zynq
comms: report error on incorrect connection start pattern
This commit is contained in:
parent
d65e893d1c
commit
4af29e8eca
|
@ -263,7 +263,9 @@ async fn load_kernel(buffer: Vec<u8>, control: &Rc<RefCell<kernel::Control>>, st
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_connection(stream: &TcpStream, control: Rc<RefCell<kernel::Control>>) -> Result<()> {
|
async fn handle_connection(stream: &TcpStream, control: Rc<RefCell<kernel::Control>>) -> Result<()> {
|
||||||
expect(stream, b"ARTIQ coredev\n").await?;
|
if !expect(stream, b"ARTIQ coredev\n").await? {
|
||||||
|
return Err(Error::UnexpectedPattern);
|
||||||
|
}
|
||||||
info!("received connection");
|
info!("received connection");
|
||||||
loop {
|
loop {
|
||||||
let request = read_request(stream, true).await?;
|
let request = read_request(stream, true).await?;
|
||||||
|
|
Loading…
Reference in New Issue