tracker fixes for trackerless torrents

This commit is contained in:
Arvid Norberg 2007-02-21 17:15:47 +00:00
parent 11b44fd286
commit b0ae8d3a14
4 changed files with 9 additions and 11 deletions

View File

@ -89,7 +89,7 @@ namespace libtorrent { namespace dht
void refresh_timeout(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
void on_receive(asio::error_code const& error, size_t bytes_transferred);
void on_bootstrap();

View File

@ -62,8 +62,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/resource_request.hpp"
#if !defined(NDEBUG) && defined(_MSC_VER)
# include <float.h>
#ifdef _MSC_VER
# include <eh.h>
#endif
@ -79,16 +78,12 @@ namespace libtorrent
// workaround for microsofts
// hardware exceptions that makes
// it hard to debug stuff
#if defined(_MSC_VER)
#ifdef _MSC_VER
struct eh_initializer
{
eh_initializer()
{
#ifndef NDEBUG
_clearfp();
_controlfp(_EM_INEXACT | _EM_UNDERFLOW, _MCW_EM );
::_set_se_translator(straight_to_debugger);
#endif
}
static void straight_to_debugger(unsigned int, _EXCEPTION_POINTERS*)

View File

@ -1077,7 +1077,7 @@ namespace libtorrent { namespace detail
// or if the torrent itself thinks we should request. Do not build
// a request in case the torrent doesn't have any trackers
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();
req.listen_port = m_listen_interface.port();

View File

@ -379,10 +379,13 @@ namespace libtorrent
m_connections_quota.given = 100;
m_uploads_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_torrent_file.add_tracker(tracker_url);
#ifndef TORRENT_DISABLE_DHT
if (should_announce_dht())
{