Bug introduced in r9401

Discuss Shareaza development as a user.
Forum rules
Home | Wiki | Rules

Bug introduced in r9401

Postby old_death » 13 May 2014 10:21

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:
User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19

Re: Bug introduced in r9401

Postby raspopov » 13 May 2014 15:33

It's impossible, only one of kind must exist in URI i.e. "magnet:xt.1=sha1:<a>&xt.2=md5:<b>"
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

Re: Bug introduced in r9401

Postby old_death » 14 May 2014 11:40

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.
User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19

Re: Bug introduced in r9401

Postby raspopov » 14 May 2014 16:38

You are right but it's a bit confusing since "tr.x" just defines several trackers for one file... :?
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

Re: Bug introduced in r9401

Postby old_death » 15 May 2014 16:45

User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19

Re: Bug introduced in r9401

Postby raspopov » 15 May 2014 17:03

But I added "tr.*" to Shareaza after I found several torrents with one hash and many "tr.*" keys...
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

Re: Bug introduced in r9401

Postby old_death » 16 May 2014 13:20

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?
User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19

Re: Bug introduced in r9401

Postby raspopov » 16 May 2014 15:16

It's easy, just count how many hashes in the magnet and if only one so all trackers goes to the single torrent.
User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

Re: Bug introduced in r9401

Postby old_death » 17 May 2014 04:29

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.
User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19

Re: Bug introduced in r9401

Postby raspopov » 19 May 2014 19:03

User avatar
raspopov
Project Admin
 
Posts: 945
Joined: 13 Jun 2009 12:30

Re: Bug introduced in r9401

Postby old_death » 21 May 2014 09:35

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).
User avatar
old_death
 
Posts: 1950
Joined: 13 Jun 2009 16:19


Return to Bugs, Tasks, and Features Discussion

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest