

Instead of configuring a custom storage (implementing storage_interface) whenĪdding a torrent, you can now configure a disk subsystem (implementing In this new system, the customization point is the whole disk I/O subsystem. Of making a lot more efficient use of modern disks as well as physical memory.
#Inklet 2.0.2 torrent code
This greatly simplifies the disk code and also has the potential In libtorrent 2.0, the default disk I/O uses memory mapped files, which meansĪ lot more of what used to belong in the disk caching subsystem is now handledīy the kernel. Open file descriptors) all storage objects would share a file_pool object Like a pool of open file handles across torrents (to have a global limit on
#Inklet 2.0.2 torrent torrent
Previous versions of libtorrent, each torrent has had its own, isolated,ĭisk storage object. In libtorrent 2.0, the disk I/O subsystem underwent a significant update. To access this conversion libtorrent/session_params.hpp must be included. The session_params object can be implicitly constructedįrom a settings_pack, to cover one of the now-deprecated constructors. To be saved to a std::map via the new overload ofĪ lot of session constructors have been deprecated in favor of the ones that takeĪ session_params object. Must now use the new overload of load_state(), that takes a Use read_session_params() and write_session_params() to serialize and de-serializeĪs a result of this, plugins that wish to save and restore state or settings The session_params object is passed to the session constructor, and will restore The session state can be acquired, in the form of a session_params object, by Read_session_params() and construct the session from it. The functions save_state() and load_state() on the session object haveīeen deprecated in favor loading the session state up-front using Set_file_hash() and file_hash() functions are obsolete, as v2 torrents have The rules for padding and alignment is well defined for Pad_file_limit and alignment parameters to the create_torrent constructor

Mutable_torrent_support flag is also always on. Is no longer relevant (as it's effectively always on). Is the SHA-256 merkle root hash of the 16 kiB blocks in that piece.Īll v2 torrents have pieces aligned to files, so the optimize_alignment flag In v2 torrents, each file forms a merkle tree and each v2 piece hash One important difference is that v2 hashes are SHA-256 hashes, and they are set Set_hash2(), which is similar to set_hash(), but for the v2-part of a torrent. Perhaps the most important addition for v2 torrents is the new member function To create v1-only torrents use the v1_only flag. torrentsĬompatible with both v1 and v2 bittorrent clients. The create_torrent class creates hybrid torrents by default. trackers () for ( lt :: announce_entry const & ae : h. There are two members, V1 and V2.Įxample: std :: vector tr = h. Type announce_infohash, for each bittorrent version.

TheĪnnounce_endpoint in turn has an array info_hashes, containing objects of Each listen socket is announced independently. Each corresponding toĪ local listen socket. Since hybrid torrentsĪnnounce once per info-hash (once for v1 and once for v2), the tracker resultsĪre also reported per bittorrent version.Įach tracker ( announce_entry) has a list of endpoints. On major change in the API is reporting of trackers. Torrent_handle::info_hashes(), in order to get both v1 and v2 hashes. Set, it will compare false to a sha1_hash of just the v1 hash.Ĭalls to torrent_handle::info_hash() may need to be replaced by Now deprecated in favor of an info_hashes member, which is of typeĪn info_hash_t object for a hybrid torrent will have both the v1 and v2 hashes Torrent_delete_failed_alert all have info_hash members. The alerts torrent_removed_alert, torrent_deleted_alert, Perhaps most noteworthy is that add_torrent_params::info_hash is nowĭeprecated in favor of add_torrent_params::info_hashes which is an The implicit conversion is deprecated though. For backwards compatibility, info_hash_t is implicitlyĬonvertible to and from sha1_hash and is interpreted as the v1 info-hash. Many places that previously took an info-hash as sha1_hash now With bittorrent v2 support, each torrent may now have two separate info hashes,
