Skip to content

Commit

Permalink
fix incoming TCP connections when using tracker-only proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Feb 22, 2021
1 parent 60a2d7f commit 6aad9a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.2.13 released

* fix incoming TCP connections when using tracker-only proxy
* fix issue with paths starting with ./
* fix integer overflow when setting a high DHT upload rate limit
* improve Path MTU discovery logic in uTP
Expand Down
12 changes: 10 additions & 2 deletions src/session_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2646,7 +2646,8 @@ namespace {

// don't accept any connections from our local sockets if we're using a
// proxy
if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none)
if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none
&& m_settings.get_bool(settings_pack::proxy_peer_connections))
return;

auto listen = std::find_if(m_listen_sockets.begin(), m_listen_sockets.end()
Expand Down Expand Up @@ -2732,6 +2733,12 @@ namespace {
{
TORRENT_ASSERT(is_single_thread());

// don't accept any connections from our local sockets if we're using a
// proxy
if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none
&& m_settings.get_bool(settings_pack::proxy_peer_connections))
return;

if (m_paused)
{
#ifndef TORRENT_DISABLE_LOGGING
Expand Down Expand Up @@ -5509,7 +5516,8 @@ namespace {
return std::uint16_t(sock->tcp_external_port());
}

if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none)
if (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none
&& m_settings.get_bool(settings_pack::proxy_peer_connections))
return 0;

for (auto const& s : m_listen_sockets)
Expand Down

0 comments on commit 6aad9a4

Please sign in to comment.