Skip to content

Commit

Permalink
Update DNS resolvement.
Browse files Browse the repository at this point in the history
Signed-off-by: Tricster <[email protected]>
  • Loading branch information
MediosZ committed Feb 3, 2023
1 parent 59c595b commit a3582c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ want = "0.3"

libc = { version = "0.2", optional = true }
socket2 = { version = "0.4.7", optional = true, features = ["all"] }
wasmedge_wasi_socket = {version = "0.4.2", optional = true }
wasmedge_wasi_socket = {version = "0.4.3", optional = true }

[dev-dependencies]
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
Expand Down
8 changes: 4 additions & 4 deletions src/client/connect/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::str::FromStr;
use std::task::{self, Poll};
use std::{fmt, io, vec};
#[cfg(target_os = "wasi")]
use wasmedge_wasi_socket::{nslookup, SocketAddr};
use wasmedge_wasi_socket::{SocketAddr, ToSocketAddrs};

use tokio::task::JoinHandle;
use tower_service::Service;
Expand Down Expand Up @@ -133,9 +133,9 @@ impl Service<Name> for GaiResolver {
#[cfg(target_os = "wasi")]
let blocking = tokio::task::spawn(async move {
debug!("resolving host={:?}", name.host);
nslookup(&*name.host, "http").map(|i| SocketAddrs {
iter: i.into_iter(),
})
(&*name.host, 0)
.to_socket_addrs()
.map(|i| SocketAddrs { iter: i })
});
GaiFuture { inner: blocking }
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::net::{SocketAddr, TcpListener as StdTcpListener};
#[cfg(all(feature = "tcp", target_os = "wasi"))]
use wasmedge_wasi_socket::{SocketAddr, TcpListener as StdTcpListener};

// #[cfg(feature = "tcp")]
// use std::time::Duration;
#[cfg(feature = "tcp")]
use std::time::Duration;

use pin_project_lite::pin_project;

Expand Down

0 comments on commit a3582c9

Please sign in to comment.