one more fix

This commit is contained in:
Arvid Norberg 2014-09-28 04:05:44 +00:00
parent d723a7a4c6
commit 6a4a5419c2
5 changed files with 8 additions and 7 deletions

View File

@ -174,7 +174,7 @@ namespace libtorrent
io_service* ios;
boost::weak_ptr<torrent> tor;
boost::shared_ptr<socket_type> s;
tcp::endpoint const* endp;
tcp::endpoint endp;
torrent_peer* peerinfo;
};

View File

@ -142,7 +142,7 @@ namespace libtorrent
, m_num_pieces(0)
, m_recv_start(0)
, m_max_out_request_queue(m_settings.get_int(settings_pack::max_out_request_queue))
, m_remote(*pack.endp)
, m_remote(pack.endp)
, m_disk_thread(*pack.disk_thread)
, m_allocator(*pack.allocator)
, m_ios(*pack.ios)

View File

@ -3028,7 +3028,7 @@ retry:
pack.ios = &m_io_service;
pack.tor = boost::weak_ptr<torrent>();
pack.s = s;
pack.endp = &endp;
pack.endp = endp;
pack.peerinfo = 0;
boost::shared_ptr<peer_connection> c

View File

@ -6253,7 +6253,7 @@ namespace libtorrent
pack.ios = &m_ses.get_io_service();
pack.tor = shared_from_this();
pack.s = s;
pack.endp = &web->endpoints.front();
pack.endp = web->endpoints.empty() ? tcp::endpoint() : web->endpoints.front();
pack.peerinfo = &web->peer_info;
if (web->type == web_seed_entry::url_seed)
{
@ -7278,7 +7278,7 @@ namespace libtorrent
pack.ios = &m_ses.get_io_service();
pack.tor = shared_from_this();
pack.s = s;
pack.endp = &a;
pack.endp = a;
pack.peerinfo = peerinfo;
boost::shared_ptr<peer_connection> c = boost::make_shared<bt_peer_connection>(

View File

@ -63,8 +63,9 @@ namespace libtorrent
, m_body_start(0)
{
TORRENT_ASSERT(&web.peer_info == pack.peerinfo);
TORRENT_ASSERT(!web.endpoints.empty());
TORRENT_ASSERT(web.endpoints.front() == *pack.endp);
// when going through a proxy, we don't necessarily have an endpoint here,
// since the proxy might be resolving the hostname, not us
TORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp);
INVARIANT_CHECK;