chiark / gitweb /
progress: Make ProgressMode come from MgmtChannel
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:22:25 +0000 (14:22 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 14:00:29 +0000 (15:00 +0100)
That's where the implementation (and any restrictions) come from.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/otter.rs
src/mgmtchannel.rs

index 66be469a3857647fb44839720fd77a335b42410e..1fd1b17ccce6d87e3ba504ed9f7599196102d399 100644 (file)
@@ -1398,7 +1398,7 @@ mod upload_bundle {
       size,
       game: instance_name.clone(),
       hash: bundles::Hash(hash.into()), kind,
-      progress: PUM::Simplex,
+      progress: MgmtChannel::PROGRESS,
     };
     let mut progress = termprogress::new();
     chan.cmd_withbulk(&cmd, &mut f, &mut io::sink(), &mut *progress)?;
index a40d961cafb30dd8be974deeb4e5ef9284aad502..8d8ad02a24334d44aa3729bfcefe1096a025ccf0 100644 (file)
@@ -47,6 +47,8 @@ impl Debug for MgmtChannel{
 }
 
 impl MgmtChannel {
+  pub const PROGRESS: ProgressUpdateMode = PUM::Simplex;
+
   #[throws(AE)]
   pub fn connect(socket_path: &str) -> MgmtChannel {
     let unix = UnixStream::connect(socket_path)