tracker fixes for trackerless torrents
This commit is contained in:
parent
11b44fd286
commit
b0ae8d3a14
|
@ -89,7 +89,7 @@ namespace libtorrent { namespace dht
|
||||||
void refresh_timeout(asio::error_code const& e);
|
void refresh_timeout(asio::error_code const& e);
|
||||||
void tick(asio::error_code const& e);
|
void tick(asio::error_code const& e);
|
||||||
|
|
||||||
// translate bittorrent kademlia message into the generice kademlia message
|
// translate bittorrent kademlia message into the generic kademlia message
|
||||||
// used by the library
|
// used by the library
|
||||||
void on_receive(asio::error_code const& error, size_t bytes_transferred);
|
void on_receive(asio::error_code const& error, size_t bytes_transferred);
|
||||||
void on_bootstrap();
|
void on_bootstrap();
|
||||||
|
|
|
@ -62,8 +62,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/resource_request.hpp"
|
#include "libtorrent/resource_request.hpp"
|
||||||
|
|
||||||
#if !defined(NDEBUG) && defined(_MSC_VER)
|
#ifdef _MSC_VER
|
||||||
# include <float.h>
|
|
||||||
# include <eh.h>
|
# include <eh.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -79,16 +78,12 @@ namespace libtorrent
|
||||||
// workaround for microsofts
|
// workaround for microsofts
|
||||||
// hardware exceptions that makes
|
// hardware exceptions that makes
|
||||||
// it hard to debug stuff
|
// it hard to debug stuff
|
||||||
#if defined(_MSC_VER)
|
#ifdef _MSC_VER
|
||||||
struct eh_initializer
|
struct eh_initializer
|
||||||
{
|
{
|
||||||
eh_initializer()
|
eh_initializer()
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
|
||||||
_clearfp();
|
|
||||||
_controlfp(_EM_INEXACT | _EM_UNDERFLOW, _MCW_EM );
|
|
||||||
::_set_se_translator(straight_to_debugger);
|
::_set_se_translator(straight_to_debugger);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void straight_to_debugger(unsigned int, _EXCEPTION_POINTERS*)
|
static void straight_to_debugger(unsigned int, _EXCEPTION_POINTERS*)
|
||||||
|
|
|
@ -1077,7 +1077,7 @@ namespace libtorrent { namespace detail
|
||||||
// or if the torrent itself thinks we should request. Do not build
|
// or if the torrent itself thinks we should request. Do not build
|
||||||
// a request in case the torrent doesn't have any trackers
|
// a request in case the torrent doesn't have any trackers
|
||||||
if ((!i->second->is_paused() || i->second->should_request())
|
if ((!i->second->is_paused() || i->second->should_request())
|
||||||
&& !i->second->torrent_file().trackers().empty())
|
&& !i->second->trackers().empty())
|
||||||
{
|
{
|
||||||
tracker_request req = i->second->generate_tracker_request();
|
tracker_request req = i->second->generate_tracker_request();
|
||||||
req.listen_port = m_listen_interface.port();
|
req.listen_port = m_listen_interface.port();
|
||||||
|
|
|
@ -379,10 +379,13 @@ namespace libtorrent
|
||||||
m_connections_quota.given = 100;
|
m_connections_quota.given = 100;
|
||||||
m_uploads_quota.max = std::numeric_limits<int>::max();
|
m_uploads_quota.max = std::numeric_limits<int>::max();
|
||||||
m_connections_quota.max = std::numeric_limits<int>::max();
|
m_connections_quota.max = std::numeric_limits<int>::max();
|
||||||
m_trackers.push_back(announce_entry(tracker_url));
|
if (tracker_url)
|
||||||
|
{
|
||||||
|
m_trackers.push_back(announce_entry(tracker_url));
|
||||||
|
m_torrent_file.add_tracker(tracker_url);
|
||||||
|
}
|
||||||
|
|
||||||
m_policy.reset(new policy(this));
|
m_policy.reset(new policy(this));
|
||||||
m_torrent_file.add_tracker(tracker_url);
|
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
if (should_announce_dht())
|
if (should_announce_dht())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue