From 68cc12869cdd2f84a7ac0cf3a981e9df5bd04d7b Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Fri, 1 Feb 2019 19:42:57 +0100 Subject: [PATCH] fix(std.http): Don't let one slow TLS connection block the server Probably a better fix than this but this should prevent the hangs gluon-lang.org sees --- src/http.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http.rs b/src/http.rs index f44d38946a..2e1671477d 100644 --- a/src/http.rs +++ b/src/http.rs @@ -331,12 +331,13 @@ fn listen( ); let incoming = listener .incoming() - .and_then(move |stream| { + .map(move |stream| { acceptor.accept(stream).map(Some).or_else(|err| { info!("Unable to accept TLS connection: {}", err); Ok(None) }) }) + .buffer_unordered(100) .filter_map(|opt_tls_stream| opt_tls_stream); let future = http