From: Ian Jackson Date: Sat, 7 Aug 2021 12:54:09 +0000 (+0100) Subject: client: better logging of ipif failures X-Git-Tag: hippotat/1.0.0~296 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=f64597e5508a6dfcb41448cd73be261b43736763;p=hippotat.git client: better logging of ipif failures Signed-off-by: Ian Jackson --- diff --git a/src/bin/client.rs b/src/bin/client.rs index 095cd55..b3d7de3 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -241,9 +241,9 @@ async fn run_client( data = tx_stream.next_segment(), if tx_queue.is_empty() => { - let data = - data.context("read from ipif")? - .ok_or_else(|| io::Error::from(io::ErrorKind::UnexpectedEof))?; + let data = (||{ + data?.ok_or_else(|| io::Error::from(io::ErrorKind::UnexpectedEof)) + })().context("read from ipif")?; //eprintln!("data={:?}", DumpHex(&data)); match check1(Slip2Mime, ic.mtu, &data, |header| {