Skip to content

Commit 79f6727

Browse files
committed
Fixes cpp-netlib#172 -- do not stop accepting connections for whatever reason.
1 parent bb97e54 commit 79f6727

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

boost/network/protocol/http/server/async_server.hpp

+14-13
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,21 @@ namespace boost { namespace network { namespace http {
9090
scoped_mutex_lock stopping_lock(stopping_mutex_);
9191
if (stopping) return; // we dont want to add another handler instance, and we dont want to know about errors for a socket we dont need anymore
9292
}
93-
if (!ec) {
94-
socket_options_base::socket_options(new_connection->socket());
95-
new_connection->start();
96-
new_connection.reset(
97-
new connection(service_, handler, *thread_pool));
98-
acceptor.async_accept(
99-
new_connection->socket(),
100-
boost::bind(
101-
&async_server_base<Tag,Handler>::handle_accept,
102-
this,
103-
boost::asio::placeholders::error));
104-
} else {
105-
BOOST_NETWORK_MESSAGE("Error accepting connection, reason: " << ec);
93+
94+
if (ec) {
95+
BOOST_NETWORK_MESSAGE("Error accepting connection, reason: "
96+
<< ec);
10697
}
98+
99+
socket_options_base::socket_options(new_connection->socket());
100+
new_connection->start();
101+
new_connection.reset(
102+
new connection(service_, handler, *thread_pool));
103+
acceptor.async_accept(
104+
new_connection->socket(),
105+
boost::bind(&async_server_base<Tag, Handler>::handle_accept,
106+
this,
107+
boost::asio::placeholders::error));
107108
}
108109

109110
void start_listening() {

0 commit comments

Comments
 (0)