From: Ian Jackson Date: Thu, 29 Jul 2021 00:37:12 +0000 (+0100) Subject: client: wip code X-Git-Tag: hippotat/1.0.0~430 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=3a2585065ef2449e84656a63d093af97ea07ce7a;p=hippotat.git client: wip code Signed-off-by: Ian Jackson --- diff --git a/src/bin/client.rs b/src/bin/client.rs index 9e9028c..3feefc0 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -14,7 +14,7 @@ struct Client { #[allow(unused_variables)] // xxx async fn run_client(ic: InstanceConfig, hclient: Arc>) -> Result -where C: hyper::client::connect::Connect + Clone + Send + Sync, +where C: hyper::client::connect::Connect + Clone + Send + Sync + 'static, { debug!("{}: config: {:?}", &ic, &ic); @@ -87,9 +87,9 @@ where C: hyper::client::connect::Connect + Clone + Send + Sync, let body = hyper::body::Body::wrap_stream( futures::stream::iter( Itertools::intersperse( - upbound.into_iter().map(|u| Cow::from(u)), - Cow::from(&[SLIP_END] as &'static [u8]) - ).map(Ok) + upbound.into_iter().map(|u| Bytes::from(u)), + slip::SLIP_END_SLICE.into() + ).map(Ok::<_,Void>) ) ); diff --git a/src/prelude.rs b/src/prelude.rs index f1afa4e..7194967 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -23,7 +23,7 @@ pub use anyhow::{anyhow, Context}; pub use extend::ext; pub use fehler::{throw, throws}; pub use futures::{poll, future}; -pub use hyper::body::{Buf as _}; +pub use hyper::body::{Bytes, Buf as _}; pub use hyper::Uri; pub use hyper_tls::HttpsConnector; pub use ipnet::IpNet; diff --git a/src/slip.rs b/src/slip.rs index 0de0947..269c8fe 100644 --- a/src/slip.rs +++ b/src/slip.rs @@ -4,6 +4,8 @@ use crate::prelude::*; +pub static SLIP_END_SLICE: &[u8] = &[SLIP_END]; + #[throws(AE)] pub fn check_checkmtu_mimeify(_data: &mut [u8], _ic: &InstanceConfig) { // xxx