Re: [libtorrent] Dynamically unload and reload torrent data
Brought to you by:
arvidn
From: <ar...@cs...> - 2010-08-18 15:20:05
|
Quoting imin imup <imi...@gm...>: > Now the torrents are unloaded in on_resume_data_checked(). However when one > of them goes to check_files, it triggers assertion failure as it tries to > access piece hash while the pointer is empty after unloaded. > > #2 0x084caf62 in assert_fail (expr=0x8828680 "m_piece_hashes", line=300, > file=0x8828604 "include/libtorrent/torrent_info.hpp", function=0x8829580 > "const char* libtorrent::torrent_info::hash_for_piece_ptr(int) const") > at src/assert.cpp:136 > #3 0x08552fdb in libtorrent::torrent_info::hash_for_piece_ptr > (this=0xa57fd10, index=0) at include/libtorrent/torrent_info.hpp:300 > > It seems what's needed is to reload the torrent, only that one, before it > goes to check_files, and unload it after it finishes checking. Could you let > me know where to trigger the on_resume/on_pause callbacks. in 0.15+ I don't think paused torrents are supposed to check their files (unless they're auto managed). Maybe for auto-managed torrents you should unload the .torrent after the file check instead. Thinking about it, you might have to add the initial unload for auto-managed paused torrents in torrent::files_checked() (there's a hook for this in plugins as well). The checking semantics is a bit tricky for non-auto managed torrents. Essentially, for auto-managed torrents, they are always checked regardless of if they are paused. Once they are checked, files_checked() is called. For non-auto managed torrents, you can pause the checking, which means if it's paused when its added, it won't check. -- Arvid Norberg |