fix of internal session_impl logic regarding TOS (#1518)

fix of internal session_impl logic regarding TOS
This commit is contained in:
Alden Torres 2017-01-13 00:55:54 -05:00 committed by Arvid Norberg
parent 3a19f33097
commit 4f7b69be90
1 changed files with 24 additions and 18 deletions

View File

@ -1879,7 +1879,7 @@ namespace aux {
, tcp::endpoint(ep.addr, std::uint16_t(ep.port))
, flags | (ep.ssl ? open_ssl_socket : 0), ec);
if (!ec && s.sock)
if (!ec && (s.sock || s.udp_sock))
{
// TODO notify interested parties of this socket's creation
m_listen_sockets.push_back(s);
@ -5949,6 +5949,8 @@ namespace aux {
{
int const tos = m_settings.get_int(settings_pack::peer_tos);
for (auto const& l : m_listen_sockets)
{
if (l.sock)
{
error_code ec;
set_tos(*l.sock, tos, ec);
@ -5961,7 +5963,10 @@ namespace aux {
, l.sock->local_endpoint().port(), tos, ec.message().c_str());
}
#endif
ec.clear();
}
if (l.udp_sock)
{
error_code ec;
set_tos(*l.udp_sock, tos, ec);
#ifndef TORRENT_DISABLE_LOGGING
@ -5975,6 +5980,7 @@ namespace aux {
#endif
}
}
}
void session_impl::update_user_agent()
{