diff --git a/proxmox-protocol/src/client.rs b/proxmox-protocol/src/client.rs index 60831462..86cc6c07 100644 --- a/proxmox-protocol/src/client.rs +++ b/proxmox-protocol/src/client.rs @@ -587,17 +587,17 @@ where self.common.queue_data(packet.finish()) } - pub fn finish_backup(&mut self, stream: BackupStream) -> Result<(StreamId, String, bool)> { + pub fn finish_backup(&mut self, stream: BackupStream) -> Result<(String, bool)> { let path = self .streams .remove(&stream.0) .ok_or_else(|| format_err!("no such active backup stream"))? .path .unwrap_or_else(|| "".to_string()); - let ack = self + let done = self .common .queue_data(Packet::simple(stream.0, PacketType::BackupFinished))?; self.expect_ok_for_id(stream.0); - Ok((StreamId(stream.0), path, ack)) + Ok((path, done)) } } diff --git a/src/bin/proxmox-protocol-testclient.rs b/src/bin/proxmox-protocol-testclient.rs index a42be22d..e595f7e7 100644 --- a/src/bin/proxmox-protocol-testclient.rs +++ b/src/bin/proxmox-protocol-testclient.rs @@ -240,9 +240,10 @@ impl UploaderBase { } pub fn finish_backup(&mut self, stream: BackupStream) -> Result<(), Error> { - let (ack, name, _done) = self.client.as_mut().unwrap().finish_backup(stream)?; + let id = stream.into(); + let (name, _done) = self.client.as_mut().unwrap().finish_backup(stream)?; println!("Server created file: {}", name); - self.wait_id = Some(ack); + self.wait_id = Some(id); Ok(()) }