Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 14cc3c8

Browse files
jpdsclaude
authored andcommitted
net: respect caller timeout for DoT TCP connect
Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent fc2e3f4 commit 14cc3c8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/net/src/tls.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ pub async fn tls_exchange<P: RuntimeProvider<Tcp = S>, S: DnsTcpStream>(
5959
// The port (853) of DOT is for dns dedicated, SNI is unnecessary. (ISP block by the SNI name)
6060
config.enable_sni = false;
6161

62-
let stream = provider.connect_tcp(remote_addr, None, None).await?;
62+
let stream = provider
63+
.connect_tcp(remote_addr, None, Some(timeout))
64+
.await?;
6365
let (future, sender) = tls_client_connect_with_future(
6466
stream,
6567
remote_addr,

0 commit comments

Comments
 (0)