forked from premiere/premiere-libtorrent
only start a new accept request on new listen sockets
Existing sockets already have an outstanding accept. Also fix mapping new listen sockets when re-mapping is not requested.
This commit is contained in:
parent
1a66a8b285
commit
92a7188163
|
@ -1895,6 +1895,12 @@ namespace aux {
|
||||||
if (m_dht)
|
if (m_dht)
|
||||||
m_dht->new_socket(m_listen_sockets.back());
|
m_dht->new_socket(m_listen_sockets.back());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TORRENT_ASSERT((s->incoming == duplex::accept_incoming) == bool(s->sock));
|
||||||
|
if (s->sock) async_accept(s->sock, s->ssl);
|
||||||
|
// since this is a new socket it needs to map ports
|
||||||
|
// even if the caller did not request re-mapping
|
||||||
|
if (!map_ports) remap_ports(remap_natpmp_and_upnp, *s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1953,12 +1959,12 @@ namespace aux {
|
||||||
|
|
||||||
ec.clear();
|
ec.clear();
|
||||||
|
|
||||||
// initiate accepting on the listen sockets
|
if (map_ports)
|
||||||
for (auto& s : m_listen_sockets)
|
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT((s->incoming == duplex::accept_incoming) == bool(s->sock));
|
for (auto const& s : m_listen_sockets)
|
||||||
if (s->sock) async_accept(s->sock, s->ssl);
|
{
|
||||||
if (map_ports) remap_ports(remap_natpmp_and_upnp, *s);
|
remap_ports(remap_natpmp_and_upnp, *s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TORRENT_USE_I2P
|
#if TORRENT_USE_I2P
|
||||||
|
|
Loading…
Reference in New Issue