From 3a55fb2a4b88ad56b7f455176729f84ff15efe14 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Wed, 6 Mar 2024 10:43:47 +0100 Subject: ipc: Update Client::send_simple with the version from the chameleon. - The Chameleon copied and improved `Client::send_simple`. Update the copy here. See: https://gitlab.com/sequoia-pgp/sequoia-chameleon-gnupg/-/blob/70802790d7d95c0084a8fea71a0836b3efc39910/src/agent.rs#L182 --- ipc/src/assuan/mod.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ipc/src/assuan/mod.rs b/ipc/src/assuan/mod.rs index 47cb2298..2fd370b4 100644 --- a/ipc/src/assuan/mod.rs +++ b/ipc/src/assuan/mod.rs @@ -186,7 +186,6 @@ impl Client { { self.send(cmd.as_ref())?; let mut data = Vec::new(); - let mut ok = false; while let Some(response) = self.next().await { match response? { Response::Data { partial } => { @@ -194,9 +193,8 @@ impl Client { let partial = Protected::from(partial); data.extend_from_slice(&partial); }, - Response::Ok { .. } => - ok = true, - Response::Comment { .. } + Response::Ok { .. } + | Response::Comment { .. } | Response::Status { .. } => (), // Ignore. Response::Error { ref message, .. } => @@ -206,12 +204,7 @@ impl Client { } } - if ok { - Ok(data.into()) - } else { - Err(crate::gnupg::Error::ProtocolError( - "Got neither success nor error".into()).into()) - } + Ok(data.into()) } /// Lazily cancels a pending operation. -- cgit v1.2.3