mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
chore: fix whitespace and warning
This commit is contained in:
parent
cfa65a3a72
commit
548f4b059d
1 changed files with 8 additions and 8 deletions
|
|
@ -294,7 +294,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
}
|
}
|
||||||
#[cfg(feature="ditherpunk")]
|
#[cfg(feature="ditherpunk")]
|
||||||
"image" => {
|
"image" => {
|
||||||
if let Some(mut url) = tokens.next() {
|
if let Some(url) = tokens.next() {
|
||||||
match url.split_once('/') {
|
match url.split_once('/') {
|
||||||
Some((host, path)) => {
|
Some((host, path)) => {
|
||||||
match TcpStream::connect((host, 80)) {
|
match TcpStream::connect((host, 80)) {
|
||||||
|
|
@ -312,7 +312,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
write!(stream, "Connection: close\r\n").expect("stream error");
|
write!(stream, "Connection: close\r\n").expect("stream error");
|
||||||
write!(stream, "\r\n").expect("stream error");
|
write!(stream, "\r\n").expect("stream error");
|
||||||
log::info!("fetching response....");
|
log::info!("fetching response....");
|
||||||
let mut reader = std::io::BufReader::new(&mut stream);
|
let mut reader = std::io::BufReader::new(&mut stream);
|
||||||
let mut buf = Vec::<u8>::new();
|
let mut buf = Vec::<u8>::new();
|
||||||
let mut byte = [0u8; 1];
|
let mut byte = [0u8; 1];
|
||||||
let mut content_length = 0;
|
let mut content_length = 0;
|
||||||
|
|
@ -333,7 +333,7 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
log::info!("found end of header after {} lines.", line_count);
|
log::info!("found end of header after {} lines.", line_count);
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
1024.. => {
|
1024.. => {
|
||||||
let line = std::string::String::from_utf8_lossy(&buf);
|
let line = std::string::String::from_utf8_lossy(&buf);
|
||||||
log::warn!("header contained line > 4k {:?}", line);
|
log::warn!("header contained line > 4k {:?}", line);
|
||||||
break;
|
break;
|
||||||
|
|
@ -354,23 +354,23 @@ impl<'a> ShellCmdApi<'a> for NetCmd {
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
buf.clear();
|
buf.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if content_length > 0 {
|
if content_length > 0 {
|
||||||
log::info!("heap size: {}", heap_usage());
|
log::info!("heap size: {}", heap_usage());
|
||||||
let mut png = DecodePng::new(reader).expect("png decode failed");
|
let mut png = DecodePng::new(reader).expect("png decode failed");
|
||||||
const BORDER: u32 = 3;
|
const BORDER: u32 = 3;
|
||||||
let modal_size = gam::Point::new(
|
let modal_size = gam::Point::new(
|
||||||
(gam::IMG_MODAL_WIDTH - 2 * BORDER) as i16,
|
(gam::IMG_MODAL_WIDTH - 2 * BORDER) as i16,
|
||||||
(gam::IMG_MODAL_HEIGHT - 2 * BORDER) as i16
|
(gam::IMG_MODAL_HEIGHT - 2 * BORDER) as i16
|
||||||
);
|
);
|
||||||
let bm = gam::Bitmap::from_png(&mut png, Some(modal_size));
|
let bm = gam::Bitmap::from_png(&mut png, Some(modal_size));
|
||||||
|
|
||||||
log::info!("heap size: {}", heap_usage());
|
log::info!("heap size: {}", heap_usage());
|
||||||
let modals = modals::Modals::new(&env.xns).unwrap();
|
let modals = modals::Modals::new(&env.xns).unwrap();
|
||||||
modals.show_image(bm).expect("show image modal failed");
|
modals.show_image(bm).expect("show image modal failed");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
write!(ret, "content-length was 0, no image read").unwrap();
|
write!(ret, "content-length was 0, no image read").unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue