Hi Peter,
I did all the changes, thanks once again for the extensive check. Look once again in the BDecoder::readList and BDecoder::readDictionary functions. The created bList and bDict objects had to be deleted too in case of an error. I hope that there is nothing else forgotten there this time :).
I additionaly apply the binary torrent files neesed for the tests. I didn’t notice that they are not included in the patch so thats why i upload them now. They should be copied to Testing\Protocols\BitTorrent\Torrents.
Thanks once again for the hints.
Slavcho
Peter Dimov wrote:
Hi Slavcho,
Thanks for the prompt reply and fixes! I’m going only through the points for which I have comments:
Thanks for the clarification about
len_pow_10. Now I get it, clever ;-) Maybe you could write a few words about that inline with the code or in the function documentation header?
BDecoder::readDictionary()in the if where youreturn new BErrorItem();, just noticed thatvaluemust be deleted as well. I missed that the first time ;-).For
BDictionaryI think we are better off with a key of typeQByteArrayinstead ofQString. The user of the class would have the choice to perform any required conversions of the raw string bytes. Would you change that please?One last, I hope, thing. Can you please rearrange the declarations in BItem so that they are in order of visibility (public first, then protected, then private). I have to check whether I have that in the coding conventions ;-).
If nobody else reports anything I’ll commit you next patch.
Regards,
Peter
