Skip to content

Commit a3582c9

Browse files
committed
Update DNS resolvement.
Signed-off-by: Tricster <mediosrity@gmail.com>
1 parent 59c595b commit a3582c9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ want = "0.3"
4343

4444
libc = { version = "0.2", optional = true }
4545
socket2 = { version = "0.4.7", optional = true, features = ["all"] }
46-
wasmedge_wasi_socket = {version = "0.4.2", optional = true }
46+
wasmedge_wasi_socket = {version = "0.4.3", optional = true }
4747

4848
[dev-dependencies]
4949
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }

src/client/connect/dns.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::str::FromStr;
3232
use std::task::{self, Poll};
3333
use std::{fmt, io, vec};
3434
#[cfg(target_os = "wasi")]
35-
use wasmedge_wasi_socket::{nslookup, SocketAddr};
35+
use wasmedge_wasi_socket::{SocketAddr, ToSocketAddrs};
3636

3737
use tokio::task::JoinHandle;
3838
use tower_service::Service;
@@ -133,9 +133,9 @@ impl Service<Name> for GaiResolver {
133133
#[cfg(target_os = "wasi")]
134134
let blocking = tokio::task::spawn(async move {
135135
debug!("resolving host={:?}", name.host);
136-
nslookup(&*name.host, "http").map(|i| SocketAddrs {
137-
iter: i.into_iter(),
138-
})
136+
(&*name.host, 0)
137+
.to_socket_addrs()
138+
.map(|i| SocketAddrs { iter: i })
139139
});
140140
GaiFuture { inner: blocking }
141141
}

src/server/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::net::{SocketAddr, TcpListener as StdTcpListener};
55
#[cfg(all(feature = "tcp", target_os = "wasi"))]
66
use wasmedge_wasi_socket::{SocketAddr, TcpListener as StdTcpListener};
77

8-
// #[cfg(feature = "tcp")]
9-
// use std::time::Duration;
8+
#[cfg(feature = "tcp")]
9+
use std::time::Duration;
1010

1111
use pin_project_lite::pin_project;
1212

0 commit comments

Comments
 (0)