-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not parse the raw torrent file more than once in the code. #77
Comments
Looks like etorrent codes use two flavor of InfoHash. One is a The other is what I found such inconsistency confusing. Is there any particular reason to do that? If not, I will make them one. |
No, there is no reason from my point of view. It is worth checking with klaar though, since he is the author of the DHT subsystem. I'd really like to hinge torrent identification on the InfoHash in the future rather than the file location we are using now. |
Yes, exactly. I was trying to do that and found this interesting distinction. |
Pinged klaar. |
Got answer from klaar. Quote: "The DHT subsystem uses an integer as the type for both info hashes and node ids because the DHT protocol defines the distance between nodes, and between nodes and info hashes as the integer value that you get when you 'xor' the two id's. " After second thought, I'm not going to change the code (make them one) since it works now. Instead, I'll write klaar's answer into comment for future reference. |
+1 for that solution! |
We currently have many calls where we read the torrent file into its bcoded internal representation. This is mostly due to laziness. Only decode once, and then pass around the torrent file. One important part is to slowly change identification by FilePath of the torrent into identification by its InfoHash. This probably has to go first, before you can do the real work, namely parse-the-raw-file-only-once.
The text was updated successfully, but these errors were encountered: