Skip to content

Commit 538dd49

Browse files
authored
Do not report errors (such as EBADF and EINVAL) from setsockopt here, since this is a performance optimization only, and hard errors will be picked up by the following operation (#1393)
1 parent e18f6f2 commit 538dd49

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Release/src/http/client/http_client_asio.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ class asio_connection
333333
void enable_no_delay()
334334
{
335335
boost::asio::ip::tcp::no_delay option(true);
336-
m_socket.set_option(option);
336+
boost::system::error_code error_ignored;
337+
m_socket.set_option(option, error_ignored);
337338
}
338339

339340
private:

Release/src/http/listener/http_server_asio.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ void hostport_listener::on_accept(std::unique_ptr<ip::tcp::socket> socket, const
594594
if (!ec)
595595
{
596596
boost::asio::ip::tcp::no_delay option(true);
597-
socket->set_option(option);
597+
boost::system::error_code error_ignored;
598+
socket->set_option(option, error_ignored);
598599

599600
auto conn = asio_server_connection::create(std::move(socket), m_p_server, this);
600601

0 commit comments

Comments
 (0)