diff --git a/statime-linux/src/ke/client.rs b/statime-linux/src/ke/client.rs index 6ef870ea7..ca58673f5 100644 --- a/statime-linux/src/ke/client.rs +++ b/statime-linux/src/ke/client.rs @@ -32,6 +32,8 @@ pub async fn fetch_data( request.write(&mut stream).await?; stream.flush().await?; + log::trace!("Wrote message"); + // we expect the to receive messages to be smaller than data_buf let mut data_buf = vec![0; 4096]; let mut bytes_received = 0; @@ -51,7 +53,9 @@ pub async fn fetch_data( } }; - stream.shutdown().await?; + log::trace!("Received response"); + + let _ = stream.shutdown().await; let records: Vec<_> = records.into_iter().map(|r| r.into_owned()).collect(); diff --git a/statime-linux/src/ke/record.rs b/statime-linux/src/ke/record.rs index 032a906d1..1a3ac001e 100644 --- a/statime-linux/src/ke/record.rs +++ b/statime-linux/src/ke/record.rs @@ -760,6 +760,8 @@ impl<'a> Record<'a> { *buf = &buf[(4 + record_length)..]; Ok(res) } else { + // Not enough data, last record + *buf = &[]; Ok(None) } }