mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
latest revised test
This commit is contained in:
parent
4463b909a1
commit
140f07ddc8
1 changed files with 28 additions and 34 deletions
|
|
@ -73,10 +73,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
if let Some(url) = tokens.next() {
|
if let Some(url) = tokens.next() {
|
||||||
match url.split_once('/') {
|
match url.split_once('/') {
|
||||||
Some((host, path)) => {
|
Some((host, path)) => {
|
||||||
match self.dns.lookup(host) {
|
match TcpStream::connect((host, 80)) {
|
||||||
Ok(ipaddr) => {
|
|
||||||
log::info!("resolved {} to {:?}", host, ipaddr);
|
|
||||||
match TcpStream::connect((IpAddr::from(ipaddr), 80)) {
|
|
||||||
Ok(mut stream) => {
|
Ok(mut stream) => {
|
||||||
log::trace!("stream open, setting timeouts");
|
log::trace!("stream open, setting timeouts");
|
||||||
stream.set_read_timeout(Some(std::time::Duration::from_millis(10_000))).unwrap();
|
stream.set_read_timeout(Some(std::time::Duration::from_millis(10_000))).unwrap();
|
||||||
|
|
@ -109,9 +106,6 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
Err(e) => write!(ret, "Couldn't connect to {}:80: {:?}", host, e).unwrap(),
|
Err(e) => write!(ret, "Couldn't connect to {}:80: {:?}", host, e).unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => write!(ret, "Couldn't resolve {}", host).unwrap(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => write!(ret, "Usage: tcpget bunniefoo.com/bunnie/test.txt").unwrap(),
|
_ => write!(ret, "Usage: tcpget bunniefoo.com/bunnie/test.txt").unwrap(),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue