From 6d3e010ae7f49b14cb1201367e5479a86d9d8e94 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Tue, 31 Jan 2017 11:40:43 -0600 Subject: [PATCH 1/2] Infinite loop in acceptor handler. --- src/asio_server.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asio_server.cc b/src/asio_server.cc index bd474c1b..fd1ec7dd 100644 --- a/src/asio_server.cc +++ b/src/asio_server.cc @@ -170,8 +170,9 @@ void server::start_accept(tcp::acceptor &acceptor, serve_mux &mux) { new_connection->start_read_deadline(); new_connection->start(); } + if (acceptor.is_open ()) + start_accept(acceptor, mux); - start_accept(acceptor, mux); }); } From 1649948e7851168613cbff72b67da9b63228ac1a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 4 Feb 2017 11:33:21 +0900 Subject: [PATCH 2/2] asio: Add curly brackets to avoid possible well known issue --- src/asio_server.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/asio_server.cc b/src/asio_server.cc index fd1ec7dd..7f361ca9 100644 --- a/src/asio_server.cc +++ b/src/asio_server.cc @@ -170,9 +170,9 @@ void server::start_accept(tcp::acceptor &acceptor, serve_mux &mux) { new_connection->start_read_deadline(); new_connection->start(); } - if (acceptor.is_open ()) + if (acceptor.is_open()) { start_accept(acceptor, mux); - + } }); }