diff options
author | Neal H. Walfield <neal@sequoia-pgp.org> | 2024-03-06 10:43:47 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@sequoia-pgp.org> | 2024-03-06 10:46:20 +0100 |
commit | 3a55fb2a4b88ad56b7f455176729f84ff15efe14 (patch) | |
tree | 500263ac6afd60007554b00f90c8444e92809f34 | |
parent | d0c536c11032bd5c86a4697ce44a0c1e3097916f (diff) |
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
-rw-r--r-- | ipc/src/assuan/mod.rs | 13 |
1 files 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. |