snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

No peer connection for torrents without metadata #681

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add info hash to session
2. add peer(s) via torrent_handle::connect_peer

What is the expected output? What do you see instead?
peer connections - instead no connections are made because 
torrent::m_connections_initialized remains false

What version of the product are you using? On what operating system?

trunk revision 10375

Original issue reported on code.google.com by webmas...@massaroddel.de on 8 Oct 2014 at 6:49

GoogleCodeExporter commented 9 years ago
There seems to be a contradiction now since a peer connection requires metadata 
to be started. So there is no way to download metadata from a peer. (maybe it 
would still work with incoming connections) 

Original comment by webmas...@massaroddel.de on 10 Oct 2014 at 4:57

GoogleCodeExporter commented 9 years ago
I haven't had time to look into this properly, but the metadata unit test still 
passes, doesn't it?
perhaps it only tests incoming connections though..

Original comment by arvid.no...@gmail.com on 10 Oct 2014 at 5:08

GoogleCodeExporter commented 9 years ago
There seems to be two problems in peer_connection::start()
1. if (!t || !t->ready_for_connections())
    return;
2. init();

ready_for_connections() wont be true
init() expects metadata to be present

Original comment by webmas...@massaroddel.de on 10 Oct 2014 at 9:36

GoogleCodeExporter commented 9 years ago
I run the metadata extension test and it is failing (for some other reason it 
seems).
According to the output the seeder always connects to the downloader and the 
downloader receives the metadata.
IMO, this tests the less likely case.

Original comment by webmas...@massaroddel.de on 11 Oct 2014 at 8:34

GoogleCodeExporter commented 9 years ago
thanks for the pointers! I've improved the unit test to cover this case as well 
and fixed it!

Original comment by arvid.no...@gmail.com on 12 Oct 2014 at 6:30