github arvidn/libtorrent v2.1.0

3 hours ago

There are some changes to the API in this version. They are documented here. The headline features for this release are:

webtorrent support

Thanks to Paul-Louis Ageneau https://github.com/paullouisageneau, and apologies for this feature having been unreleased for so long.
This feature is now enabled by default. The last push to get this ready has been to add fuzz targets for WebRTC specific features, rtc_parse_endpoint, rtc_peer_conn, rtc_tracker_offer and sdp_offer. The dependencies for webtorrent support are pulled in as submodules in the repository. webtorrent also adds a new dependency on boost-json.

Note that the webtorrent support significantly widens the attack surface of libtorrent, if you don't need this feature, it's probably best disabled (webtorrent=off / -Dwebtorrent=OFF)

pread_disk_io

A new disk I/O backend that uses pwritev and preadv (and windows counterparts). This is hopefully addressing the misstep of transitioning all disk I/O over to memory mapped files. The mmap disk backend is still available and is probably more efficient for local NVMe drives. But for spinning disks, network mounts or FUSE drives, regular I/O calls should be a lot more efficient. pread_disk_io is now the default.

One of the main challenges with the new disk I/O has been to get the multi-threading right. It computes piece hashes on dedicated threads, separate from those making the I/O calls. This lets us advertise and upload pieces before they're flushed to disk, maintaining high throughput.

Other highlights are:

  • add max_directory_depth limit to load_torrent_limits to bound file path depth when loading torrents
  • fix race in wait_for_alert(), and update its return value
  • optimize torrent_handle::torrent_file()
  • add option to not validate v1 hashes for hybrid torrents
  • add post_file_status() to query them asynchronously
  • add post_file_priorities() to query them asynchronously
  • fix local service discovery not being correctly staggered
  • make the save path for part files configurable
  • retry failed SAM connection (for i2p)
  • deprecated remap_files(), and prevent it from breaking v2 torrents
  • fix peer_info holding an i2p destination
  • implement i2p_pex, peer exchange support for i2p torrents
  • deprecate torrent_alert::torrent_name()
  • requires OpenSSL minimum version 1.1.0 with SNI support
  • try harder to bind TCP and UDP sockets to the same port
  • made disk_interface's status_t type a flags type
  • optimize resume data format to use less space
  • add a simpler overload to bencode() returning a vector
  • introduced a new API for creating torrents, enabling file_storage optimizations
  • default build to not include functions deprecated in libtorrent 1.1 and earlier
  • add comment, created_by and creation_date to add_torrent_params
  • move session_flags to session_params
  • the entry class is now a standard variant type
  • use std::string_view instead of boost counterpart
  • libtorrent now requires C++17 to build
  • removed support for BEP 17 web seeds (in favor of BEP 19)
  • fix bug where torrent_status::total was not set for seeds

full commit log

New Contributors

Full Changelog: v2.0.13...v2.1.0

Don't miss a new libtorrent release

NewReleases is sending notifications on new releases.