Skip to content
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

Implement torrent synchronization and automatic notification on torrent alerts #7576

Open
wants to merge 2 commits into
base: RC_2_0
Choose a base branch
from

Conversation

joriscarrier
Copy link
Contributor

No description provided.

@joriscarrier joriscarrier force-pushed the torrent_wait branch 2 times, most recently from 9474fdd to 387b193 Compare January 3, 2024 09:53
@arvidn
Copy link
Owner

arvidn commented Jan 13, 2024

what's the rationale for this change? it's not obvious from the documentation you added.
it looks like you also meant to expose the wait functions to torrent_handle as well, otherwise they're not usable by the client.

But more fundamentally, I believe this kind of mechanism would be implemented either by a plugin or by a set_alert_notify() function. It's not obvious why this would need to be built into libtorrent.

@arvidn
Copy link
Owner

arvidn commented Jan 13, 2024

if you want a hook on when a torrent changes state, it would probably be better to do something in torrent::set_state(). Going via the alert mechanism won't work if the client clear the alert_category::status bit in the alert mask.

@arvidn
Copy link
Owner

arvidn commented Jan 13, 2024

I also think there's a race condition in here. For example, if you call handle.status() followed by handle.wait(), it the torrent may have changed status before you call wait()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants