support for adjusting the socket buffer sizes through session_settings

This commit is contained in:
Arvid Norberg
2009-05-01 04:59:15 +00:00
parent 6ca1c191b6
commit 84dda7b617
6 changed files with 41 additions and 0 deletions

View File

@@ -1006,6 +1006,8 @@ namespace aux {
return;
}
setup_socket_buffers(*s);
boost::intrusive_ptr<peer_connection> c(
new bt_peer_connection(*this, s, endp, 0));
#ifdef TORRENT_DEBUG
@@ -1019,6 +1021,23 @@ namespace aux {
}
}
void session_impl::setup_socket_buffers(socket_type& s)
{
error_code ec;
if (m_settings.send_socket_buffer_size)
{
boost::asio::socket_base::send_buffer_size option(
m_settings.send_socket_buffer_size);
s.set_option(option, ec);
}
if (m_settings.recv_socket_buffer_size)
{
boost::asio::socket_base::receive_buffer_size option(
m_settings.recv_socket_buffer_size);
s.set_option(option, ec);
}
}
void session_impl::on_socks_accept(boost::shared_ptr<socket_type> const& s
, error_code const& e)
{