BitTorrent bootstrap request to bootstrap servers

After you have edited the source code, post your patch here.
Forum rules
Home | Wiki | Rules

BitTorrent bootstrap request to bootstrap servers

Postby ivan386 » 30 Dec 2016 18:36

Code: Select all
Index: BTPacket.cpp
===================================================================
--- BTPacket.cpp   (revision 9647)
+++ BTPacket.cpp   (working copy)
@@ -140,6 +140,19 @@
          }
       }
 
+      if ( nCount == 0 )
+         for ( CHostCacheIterator i = HostCache.BitTorrent.Begin() ; i != HostCache.BitTorrent.End() && nCount < 100; ++i )
+         {
+            CHostCacheHostPtr pCache = (*i);
+
+            SOCKADDR_IN sa;
+            if ( Network.Resolve( pCache->Address(), pCache->m_nPort, &sa ) ){
+               unsigned char tid[4];
+               make_tid(tid, "fn", 0);
+               send_find_node( (sockaddr*)&sa, sizeof( SOCKADDR_IN ), tid, 4, &oID[ 0 ], 1, 0 );
+            }
+         }
+
       m_bConnected = true;
    }
 }
Index: HostCache.h
===================================================================
--- HostCache.h   (revision 9647)
+++ HostCache.h   (working copy)
@@ -317,6 +317,8 @@
          return eDonkey.CountHosts( TRUE ) > 0;
       case PROTOCOL_DC:
          return DC.CountHosts( TRUE ) > 0;
+      case PROTOCOL_BT:
+         return BitTorrent.CountHosts( TRUE ) > 0;
       default:
          return true;
       }


Если HostCache.BitTorrent пустой (nCount == 0) оправляется запрос к bootstrap серверам
If HostCache.BitTorrent is empty (nCount == 0) goes request to bootstrap servers
Attachments
bootstrap request (BTPacket and HostCache).zip
(21.02 KiB) Downloaded 16 times
Last edited by ivan386 on 10 Jan 2017 00:45, edited 1 time in total.
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 260
Joined: 17 Jun 2009 14:08

Re: BitTorrent bootstrap request to router.bittorrent.com:68

Postby raspopov » 09 Jan 2017 20:31

No need since it already included in DefaultServers.dat.

Code: Select all
# DHT Bootstraping
B router.bittorrent.com:6881
B router.utorrent.com:6881
B dht.transmissionbt.com:6881
B dht.aelitis.com:6881
User avatar
raspopov
Project Admin
 
Posts: 944
Joined: 13 Jun 2009 12:30
Location: Russian Federation

Re: BitTorrent bootstrap request to bootstrap servers

Postby ivan386 » 10 Jan 2017 00:52

Оказывается этот список не загружался в Shareaza. Я подправил HostCache.h и BTPacket.cpp. Первый пост обновлён.

It turns out that the list is not loaded in Shareaza. I corrected HostCache.h and BTPacket.cpp. First post updated.
data:application/exe,%B4%09%BA%0D%01%CD%21%B4%08%CD%21%CD%20Hello,World!$
ivan386
 
Posts: 260
Joined: 17 Jun 2009 14:08

Re: BitTorrent bootstrap request to bootstrap servers

Postby raspopov » 07 Feb 2017 19:45

I think DiscoveryServices must be upgraded to be able a DHT nodes search instead. Try to re-factor your patch please.

Partially added in r9650.
User avatar
raspopov
Project Admin
 
Posts: 944
Joined: 13 Jun 2009 12:30
Location: Russian Federation


Return to Code Submission

Who is online

Users browsing this forum: No registered users and 1 guest

cron