From 48f6543cb9518c6b28b26bcf7c49357497badc63 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Wed, 2 Dec 2020 18:31:48 -0700 Subject: [PATCH] appmgr: reqwest compatibility --- appmgr/src/install.rs | 3 ++- appmgr/src/registry.rs | 4 ++++ appmgr/src/version/mod.rs | 3 ++- appmgr/src/version/v0_1_0.rs | 1 + appmgr/src/version/v0_1_1.rs | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/appmgr/src/install.rs b/appmgr/src/install.rs index 23b99214d..192f0d643 100644 --- a/appmgr/src/install.rs +++ b/appmgr/src/install.rs @@ -16,7 +16,7 @@ use futures::stream::StreamExt; use futures::stream::TryStreamExt; use tokio::io::AsyncWriteExt; use tokio::io::{AsyncRead, ReadBuf}; -use tokio_compat_02::IoCompat; +use tokio_compat_02::{FutureExt, IoCompat}; use tokio_tar as tar; use crate::config::{ConfigRuleEntry, ConfigSpec}; @@ -99,6 +99,7 @@ pub async fn download(url: &str, name: Option<&str>) -> Result Result Result Result Result<(), Error> .collect(); let url = format!("{}/appmgr?spec={}", &*crate::SYS_REGISTRY_URL, req_str); log::info!("Fetching new version from {}", url); - let response = reqwest::get(&url) + let response = reqwest::get(&url).compat() .await .with_code(crate::error::NETWORK_ERROR)? .error_for_status() diff --git a/appmgr/src/version/v0_1_0.rs b/appmgr/src/version/v0_1_0.rs index f2444d928..6a6a9eea7 100644 --- a/appmgr/src/version/v0_1_0.rs +++ b/appmgr/src/version/v0_1_0.rs @@ -25,6 +25,7 @@ impl VersionT for Version { tokio::io::copy( &mut AsyncCompat( reqwest::get(&format!("{}/torrc?spec==0.0.0", &*crate::SYS_REGISTRY_URL)) + .compat() .await .with_context(|e| format!("GET {}/torrc: {}", &*crate::SYS_REGISTRY_URL, e)) .with_code(crate::error::NETWORK_ERROR)? diff --git a/appmgr/src/version/v0_1_1.rs b/appmgr/src/version/v0_1_1.rs index 3bc1c8b62..fe7be909a 100644 --- a/appmgr/src/version/v0_1_1.rs +++ b/appmgr/src/version/v0_1_1.rs @@ -22,6 +22,7 @@ impl VersionT for Version { tokio::io::copy( &mut AsyncCompat( reqwest::get(&format!("{}/torrc?spec==0.1.1", &*crate::SYS_REGISTRY_URL)) + .compat() .await .with_context(|e| format!("GET {}/torrc: {}", &*crate::SYS_REGISTRY_URL, e)) .with_code(crate::error::NETWORK_ERROR)? @@ -76,6 +77,7 @@ impl VersionT for Version { tokio::io::copy( &mut AsyncCompat( reqwest::get(&format!("{}/torrc?spec==0.1.0", &*crate::SYS_REGISTRY_URL)) + .compat() .await .with_context(|e| format!("GET {}/torrc: {}", &*crate::SYS_REGISTRY_URL, e)) .no_code()?