remove heuristic from read loop, now that read works.

This commit is contained in:
bunnie 2022-08-05 05:04:03 +08:00
parent 89cba7250e
commit 1cf0479528

View file

@ -368,7 +368,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
let mut rx_buf = [0u8; CHUNK]; let mut rx_buf = [0u8; CHUNK];
log::info!("starting read loop"); log::info!("starting read loop");
// stream.set_nonblocking(true).expect("couldn't set stream to nonblocking"); // stream.set_nonblocking(true).expect("couldn't set stream to nonblocking");
let mut last_chunk = 0; // let mut last_chunk = 0;
loop { loop {
match stream.read(&mut rx_buf) { match stream.read(&mut rx_buf) {
Ok(len) => { Ok(len) => {
@ -379,6 +379,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
log::info!("got 0-length read, concluding we're at an EOF..."); log::info!("got 0-length read, concluding we're at an EOF...");
break; break;
} }
/*
if last_chunk == 0 { if last_chunk == 0 {
last_chunk = len; last_chunk = len;
} else { } else {
@ -386,7 +387,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
log::info!("heuristic termination of read loop"); log::info!("heuristic termination of read loop");
break; break;
} }
} }*/
}, },
Err(e) => { Err(e) => {
log::info!("quitting read loop with err {:?}", e); log::info!("quitting read loop with err {:?}", e);