Skip to content

Commit 28e927b

Browse files
committed
Tweak: call start_accept first once async_accept succeeded
1 parent 923182c commit 28e927b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/http_proxy_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ void http_proxy_client::start_accept()
5454
auto socket = std::make_shared<boost::asio::ip::tcp::socket>(this->acceptor.get_io_service());
5555
this->acceptor.async_accept(*socket, [socket, this](const boost::system::error_code& error) {
5656
if (!error) {
57+
this->start_accept();
5758
auto connection = http_proxy_client_connection::create(std::move(*socket));
5859
connection->start();
59-
this->start_accept();
6060
}
6161
});
6262
}

0 commit comments

Comments
 (0)