Page 1 of 1

Bug introduced in r9401

PostPosted: 13 May 2014 10:21
by old_death
Ryo,
what you committed in r9401 fails if there are 2 hashes of the same type in a magnet. If you have for instance "magnet:xt.1=sha1:<a>&xt.2=sha1:<b>" where <a> and <b> are some sha1 hashes, then your code will first extract <a> and then overwrite it in the second iteration with <b>. So at the end, the loop only extracts <b> from that magnet. In order to extract all of them, you probably need to use a list or map to store the files you extract.

PS.: Thanks for making me reread the Quazaa Magnet code, a bug was hiding there, too. :mrgreen:

Re: Bug introduced in r9401

PostPosted: 13 May 2014 15:33
by raspopov
It's impossible, only one of kind must exist in URI i.e. "magnet:xt.1=sha1:<a>&xt.2=md5:<b>"

Re: Bug introduced in r9401

PostPosted: 14 May 2014 11:40
by old_death
No. A magnet link with these numbers specifies multiple files. If each file has an sha1, then there are n sha1 hashes for n files in a magnet link - all of them with a different number, of course. It is true that there may not be multiple sha1 hashes for the same file, though.

Re: Bug introduced in r9401

PostPosted: 14 May 2014 16:38
by raspopov
You are right but it's a bit confusing since "tr.x" just defines several trackers for one file... :?

Re: Bug introduced in r9401

PostPosted: 15 May 2014 16:45
by old_death

Re: Bug introduced in r9401

PostPosted: 15 May 2014 17:03
by raspopov
But I added "tr.*" to Shareaza after I found several torrents with one hash and many "tr.*" keys...

Re: Bug introduced in r9401

PostPosted: 16 May 2014 13:20
by old_death
Well, that's just erroneous decoding. Maybe we could support those as a kind of error compatibility with a message box warning the user about the encoding error?

Re: Bug introduced in r9401

PostPosted: 16 May 2014 15:16
by raspopov
It's easy, just count how many hashes in the magnet and if only one so all trackers goes to the single torrent.

Re: Bug introduced in r9401

PostPosted: 17 May 2014 04:29
by old_death
Yes, that's probably the best thing we can do to stay compatible with all possible variants... Too bad there is no real spec for the magnet link tracker extension.

Re: Bug introduced in r9401

PostPosted: 19 May 2014 19:03
by raspopov

Re: Bug introduced in r9401

PostPosted: 21 May 2014 09:35
by old_death
As far as I can see you are basically ignoring the numbered part for trackers but not for anything else. So I guess it's fine concerning that part. What still needs to be done however is to make sure to extract the parts you are currently missing (all parts where nNumber != the first occurrence of nNumber, e.g. all but the first file in a multi file magnet).