This commit is contained in:
open-trade
2022-01-05 15:47:04 +08:00
parent 5631ffac4c
commit 5f61c2442a
2 changed files with 3 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ use crate::{
udp::FramedSocket,
ResultType,
};
use anyhow::{bail, Context};
use anyhow::bail;
use std::net::SocketAddr;
use tokio::net::ToSocketAddrs;
use tokio_socks::{IntoTargetAddr, TargetAddr};
@@ -69,9 +69,7 @@ pub async fn connect_tcp<'t, T: IntoTargetAddr<'t>>(
bail!("Invalid target addr");
};
FramedStream::new(addrs[0], local, ms_timeout)
.await
.with_context(|| "Failed to connect to rendezvous server")
Ok(FramedStream::new(addrs[0], local, ms_timeout).await?)
}
}