2 Aug 2010 05:25
Re: Dynamically unload and reload torrent data
<arvid <at> cs.umu.se>
2010-08-02 03:25:10 GMT
2010-08-02 03:25:10 GMT
Quoting imin imup <iminimup <at> gmail.com>: > Hello Arvid, > Destructing/re-constructing piece manager is implemented and under testing. Cool, that's awesome. Which branch are you working on again? (0.14, 0.15 or trunk?). > Since the torrent files in my application can be Mega bytes large. I'm > looking at how to unload /reload info section. Do these two variables holds > 2 copies of info section? i.e., m_into_section holds a raw string version > and m_info_dict holds a parsed version. > boost::shared_array<char> m_info_section; > mutable lazy_entry m_info_dict; No, just one copy. All the memory is kept in m_info_section, and then a parsed tree-structure with pointers into the m_info_section memory is held by m_info_dict. I think it might be a good idea to replace the m_torrent_file (i.e. the torrent_info object in the torrent class) with a new torrent_info constructed only with the info-hash, when unloading. This is the state torrents are in when they are first loaded from a magnet link and haven't downloaded the metadata yet. This state is a reliable state to keep the torrent in (because any function that needs more than the info hash out of m_torrent_file which check). Obviously you would want to reload it once the torrent starts up again so that the metadata isn't actually downloaded from the swarm for no reason.(Continue reading)
RSS Feed