diff --git a/devtools/src/http_client.rs b/devtools/src/http_client.rs index 0257d86d7..ab2341059 100644 --- a/devtools/src/http_client.rs +++ b/devtools/src/http_client.rs @@ -16,7 +16,7 @@ use std::thread; use std::time::Duration; -use std::io::{Read, Write}; +use std::io::{self, Read, Write}; use std::str::{self, Lines}; use std::net::{TcpStream, SocketAddr}; @@ -87,6 +87,7 @@ pub fn request(address: &SocketAddr, request: &str) -> Response { loop { let mut chunk = [0; 32 *1024]; match req.read(&mut chunk) { + Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => break, Err(err) => panic!("Unable to read response: {:?}", err), Ok(0) => break, Ok(read) => response.extend_from_slice(&chunk[..read]),