From dd21e61371c9e3f31ed6fdd2b7cfacfc127237e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 23 Oct 2017 23:52:50 +0200 Subject: [PATCH] Fix ws tests. --- devtools/src/http_client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]),