17 Jun 2012 09:45
Delete a torrent from within a torrent_plugin?
Spindizzy - The Dizzy Wizard <spindizzy_wizard <at> yahoo.com>
2012-06-17 07:45:34 GMT
2012-06-17 07:45:34 GMT
I'm writing a torrent_plugin. In the plugin, when a certain condition
is detected, I want to automatically delete the torrent with all of its
files, including the fastresume.
How do I do so properly?
Everything
I've tried so far either hasn't actually deleted the torrent, has lead
to an invariant crash, or has caused a SEGV. Here's a simplified view
of the latest. Any help would be appreciated!
struct foo : torrent_plugin {
...
torrent* tp;
...
virtual bool on_tick() {
...
if (condition satisfied) {
tp->set_error(errors::destructing_torrent, "...");
tp->session().remove_torrent(tp->get_handle(),session::delete_files);
return true;
}
...
return false;
}
...
}
Spindizzy, the Dizzy Wizard
(spindizzy_wizard <at> yahoo.com)
(Continue reading)
RSS Feed