-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
TORRENT_FINISHED alert emitted twice #220
Comments
is this still an issue after our 1.2.1.0 release? |
I'm facing similar issue; getting If you want I can post the torrent link here, it is one of the copyright content and I remember, in another post I saw reluctance to accept/post copyright torrents. |
I wonder if you could write a test for it and submit a pull request, that way we could replicate it easily and perhaps track down why this alert is being fired twice. Maybe in the test you are not able to replicate the problem and then you'll be able to track down the issue to your own bittorrent client. |
Maybe something like |
Can I add the torrent link? As I mentioned it is a copyright torrent. Sorry for the late reply I had a broken hand. |
Please do not. |
A fix from libtorrent 1.2.8 might help with this issue:
|
Hello,
I'm seeing the torrent finished alert being emitted twice when working with magnets.
The first emitted finished event is occurring directly after ADD_TORRENT alert is emitted. The second event is occurring when the torrent download completes.
I believe the extra event is emitted due to how I'm "forcing" magnets to start in my code by invoking resume on the torrent handle. My reason for doing so is that when I start a download with a magnet using the SessionManager the ADD_TORRENT alert is emitted but the download never starts. I'm seeing the following in my logs:
The only way I was able to get the download to start is by invoking resume on the torrent handle when the ADD_TORRENT alert is emitted. Doing so solves the issue where the magnet would not start, but it seems to have the unintended side effect of emitting a TORRENT_FINISHED alert. I'm almost positive this is where the problem occurs as I'm probably messing up some internal state somewhere.
I also want to add that I'm waiting for the DHT to initialize before starting the magnet download so I don't believe that's the cause of the issue.
I'm sure the solution to this problem is simple but I'm not sure what I'm missing. I would expect that once the DHT is initialized and download is invoked on the session manager using a magnet that the download would start and continue until completion.
The forced resume I mentioned can be seen here.
There is also a sample project in that repository. The issue can be reproduced by commenting out the line here, removing the resume invocation, and starting the download of the magnet.
Any advice would be greatly appreciated :)!
The text was updated successfully, but these errors were encountered: