Skip to content

Commit

Permalink
fix(std.http): Don't let one slow TLS connection block the server
Browse files Browse the repository at this point in the history
Probably a better fix than this but this should prevent the hangs
gluon-lang.org sees
  • Loading branch information
Marwes committed Feb 1, 2019
1 parent 9ecba53 commit 68cc128
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68cc128

Please sign in to comment.