From 31e1aab9a4898f3a27131acf5d30039bd5ad891f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 12 Mar 2018 09:01:19 -0700 Subject: [PATCH] do not log WouldBlock error from socket accept --- CHANGES.md | 4 ++++ src/server/srv.rs | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 538a01793..4038520fc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## 0.4.8 (2018-03-xx) + +* Do not log WouldBlock error from socket accept + ## 0.4.7 (2018-03-11) * Fix panic on unknown content encoding diff --git a/src/server/srv.rs b/src/server/srv.rs index 8ba058b38..981e1a271 100644 --- a/src/server/srv.rs +++ b/src/server/srv.rs @@ -741,9 +741,12 @@ fn start_accept_thread( break } }, - Err(ref e) if connection_error(e) => continue, + Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => + break, + Err(ref e) if connection_error(e) => + continue, Err(e) => { - error!("Error accepting connection: {:?}", e); + error!("Error accepting connection: {}", e); // sleep after error thread::sleep(sleep); break