mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-22 09:23:16 +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() {
|
||||
match url.split_once('/') {
|
||||
Some((host, path)) => {
|
||||
match self.dns.lookup(host) {
|
||||
Ok(ipaddr) => {
|
||||
log::info!("resolved {} to {:?}", host, ipaddr);
|
||||
match TcpStream::connect((IpAddr::from(ipaddr), 80)) {
|
||||
match TcpStream::connect((host, 80)) {
|
||||
Ok(mut stream) => {
|
||||
log::trace!("stream open, setting timeouts");
|
||||
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(),
|
||||
}
|
||||
}
|
||||
_ => write!(ret, "Couldn't resolve {}", host).unwrap(),
|
||||
}
|
||||
}
|
||||
_ => write!(ret, "Usage: tcpget bunniefoo.com/bunnie/test.txt").unwrap(),
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue