]> git.proxmox.com Git - proxmox-backup.git/commitdiff
protocol: cleanup finish_backup
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 13 Mar 2019 13:15:30 +0000 (14:15 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 13 Mar 2019 13:16:17 +0000 (14:16 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-protocol/src/client.rs
src/bin/proxmox-protocol-testclient.rs

index 6083146295157248a950c2ea4e0f9ebcf625126e..86cc6c07a4f2061c442f6734efb2ff60c7568ae0 100644 (file)
@@ -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(|| "<no remote name received>".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))
     }
 }
index a42be22de4762b2bbc3e06bbaf65854348db31e6..e595f7e73ccf8421bcc68850a6b685a2e251c5ef 100644 (file)
@@ -240,9 +240,10 @@ impl<S: AsyncRead + AsyncWrite> UploaderBase<S> {
     }
 
     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(())
     }