summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-11-29 12:43:48 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-11-29 12:43:48 +0100
commit59c8fd0cc5944b1699e55fd1ed6cd64e37b5500a (patch)
tree7fc05efc7b0ebf3a247add509d25c0c7930f4c43
parente757aa31c0c102588029ffd9a3b8f2e92ab9a0ec (diff)
-rw-r--r--ipc/src/assuan/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipc/src/assuan/mod.rs b/ipc/src/assuan/mod.rs
index 0e0ed672..c475aaef 100644
--- a/ipc/src/assuan/mod.rs
+++ b/ipc/src/assuan/mod.rs
@@ -77,7 +77,9 @@ assert_send_and_sync!(WriteState);
impl Client {
/// Connects to the server.
pub async fn connect<P>(path: P) -> Result<Client> where P: AsRef<Path> {
+ let path = path.as_ref();
let connection = socket::sock_connect(path)?;
+ eprintln!("XXX");
Ok(ConnectionFuture::new(connection).await?)
}
@@ -212,6 +214,7 @@ impl Future for ConnectionFuture {
match Pin::new(&mut responses).poll(cx) {
Poll::Ready(response) => {
+ dbg!(&response);
Poll::Ready(match response.iter().last() {
Some(Ok(Response::Ok { .. })) =>
Ok(self.0.take().unwrap()),
@@ -302,7 +305,7 @@ impl Stream for Client {
// First, get a new read buffer.
// Later, append the read data to the Client's buffer
- let mut vec = Vec::with_capacity(MAX_LINE_LENGTH);
+ let mut vec = vec![0; MAX_LINE_LENGTH];
let mut read_buf = tokio::io::ReadBuf::new(&mut vec);
match reader.as_mut().poll_read(cx, &mut read_buf)? {
@@ -316,6 +319,7 @@ impl Stream for Client {
//}
+ eprintln!("GOT: {}", String::from_utf8(read_buf.filled().into()).unwrap());
if read_buf.filled().is_empty() {
// End of stream.
return Poll::Ready(None)