Skip to content

release/2.0.11.0 (beta)

Pre-release
Pre-release
Compare
Choose a tag to compare
@gubatron gubatron released this 27 Sep 23:47
· 17 commits to master since this release

Welcome to jlibtorrent 2.0.11.0

This is our first build of jlibtorrent-2.0, all tests are passing but we have yet to integrate the library with a production bittorrent client such as FrostWire for Desktop and FrostWire for Android.

We'll be doing so over the next weeks, and once we've throughly tested everything is working as expected we'll promote our next build (if necessary) to a stable release you can use to update your app to support bittorrent 2.0 features, plus all the fixes in libtorrent made the last 15 months.

  • Migration and Integration

    • Migration to support libtorrent 2.0 integration.
    • Maintained 1.2.x on a separate branch without active maintenance; pull requests are welcome.
  • SWIG Interface Enhancements

    • Modularization of SWIG Interfaces:

      • SWIG interface files have been modularized for better maintainability and readability.
      • Added separate .i files for various libtorrent components, including:
        • libtorrent_address.i
        • libtorrent_tcp_endpoint.i
        • libtorrent_udp_endpoint.i
        • libtorrent_kademlia_dht_state.i
        • libtorrent_client_data.i
        • libtorrent_sha1_hash.i
        • libtorrent_info_hash.i
        • libtorrent_storage_defs.i
        • libtorrent_bitfield.i
        • libtorrent_operations.i
        • libtorrent_error_code.i
        • libtorrent_announce.i
        • libtorrent_file_storage.i
        • libtorrent_peer_request.i
        • libtorrent_bdecode.i
        • libtorrent_torrent_info.i
        • libtorrent_torrent_flags.i
        • libtorrent_add_torrent_params.i
        • libtorrent_close_reason.i
        • libtorrent_peer_info.i
        • libtorrent_torrent_handle.i
        • libtorrent_torrent_status.i
        • libtorrent_performance_counters.i
        • libtorrent_portmap.i
        • libtorrent_piece_block.i
        • libtorrent_socket_type.i
        • libtorrent_entry.i
    • Alert Types Integration:

      • Integrated additional alert type interface files to comprehensively cover libtorrent's alert system:
        • libtorrent_dht_announce_alert.i
        • libtorrent_external_ip_alert.i
        • libtorrent_listen_failed_alert.i
        • libtorrent_listen_succeeded_alert.i
        • libtorrent_incoming_connection_alert.i
        • libtorrent_peer_alert.i
        • libtorrent_dht_direct_response_alert.i
        • libtorrent_dht_outgoing_get_peers_alert.i
        • libtorrent_dht_pkt_alert.i
        • libtorrent_udp_error_alert.i
        • libtorrent_dht_sample_infohashes_alert.i
        • libtorrent_tracker_alert.i
        • libtorrent_dht_lookup.i
        • libtorrent_portmap_alert.i
        • libtorrent_portmap_error_alert.i
        • libtorrent_dht_mutable_item_alert.i
        • libtorrent_dht_put_alert.i
        • libtorrent_session_stats_alert.i
        • libtorrent_peer_log_alert.i
        • libtorrent_read_piece_alert.i
        • libtorrent_dht_stats_alert.i
        • libtorrent_torrent_conflict_alert.i
    • Type Aliases and Templates:

      • Introduced typed_bitfield template for handling different index types, enhancing type safety and flexibility.
    • Operator Renaming:

      • Mapped C++ operators to Java-friendly method names using %rename directives:
        • operator== to op_eq
        • operator!= to op_ne
        • operator< to op_lt
        • operator> to op_gt
        • operator<= to op_lte
        • operator>= to op_gte
        • operator~ to op_inv
        • operator^ to op_xor
        • operator| to op_or
        • operator& to op_and
        • operator[] to op_at
      • Included boost_system_error_code.i for proper error handling.
  • Build Scripts and Dependencies

    • Added New Build Options:

      • Introduced --swig-only and --build-only options to the SWIG/build scripts (run-swig.sh and build.sh).
        • --swig-only: Executes only the SWIG interface generation without initiating the build process.
        • --build-only: Runs only the build process using pre-generated SWIG wrappers, skipping the SWIG generation phase.
      • These options provide developers with greater flexibility during development and testing by allowing selective execution of build stages.
    • Build Script Enhancements:

      • Added prepare-macos.sh script to automate the installation of dependencies and the required SWIG version on macOS systems.
        • Installs necessary packages using Homebrew (wget, pcre2).
        • Checks and installs SWIG version 4.2.1 if not already present.
        • Verifies successful installation post-build.
      • Updated run-swig.sh script to handle platform-specific code adjustments and ensure correct SWIG version usage.
        • Implemented additional sed commands to fix code issues in libtorrent headers before SWIG processing.
        • Added safeguards to handle SWIG failures gracefully, providing informative messages and exiting if necessary.
        • Updated build flags and configurations to align with the latest libtorrent ABI versions.
        • Set TORRENT_ABI_VERSION=4 and updated namespaces for versions 3 and 4.
  • Dependency Upgrades

    • Boost Upgrade:

      • Upgraded Boost library to version 1.86.0 to improve performance and compatibility.
    • OpenSSL Upgrade:

      • Updated OpenSSL to version 1.1.1t to enhance security and support the latest protocols.
    • Gradle Upgrade:

      • Upgraded Gradle to version 8.10.2 to leverage new features and improvements in build automation.
    • Java Development Kit (JDK):

      • Jar built with JDK 11, ensuring compatibility with the build environment.
    • Libtorrent Update:

      • Updated libtorrent to RC_2_0 (rev: 2ab8fedabb7716947edc77958da6d0b5e1040df9) to incorporate the latest fixes and features from the libtorrent 2.0 branch.
    • Android NDK Upgrade:

      • Upgraded Android NDK to version r26d (LTS) from r25c, providing the latest toolchains and platform support.
    • SWIG Upgrade:

      • Upgraded SWIG to version 4.2.1 to improve interface generation and support new language features.
  • Exception and Error Handling

    • Enhanced Exception Handling:
      • Improved exception translation from C++ to Java within SWIG interfaces to ensure robust error management.
  • Compatibility and Performance Fixes

    • Fixed Compatibility Issues:

      • Resolved syntax issues in file_storage.hpp and ip_filter.hpp to ensure successful SWIG processing and avoid compilation errors.
      • Adjusted build flags and macros for Boost and libtorrent compatibility across different platforms.
    • Performance Optimizations:

      • Optimized SWIG typemaps and wrappers for efficient data handling, minimizing performance overhead in Java bindings.
  • Directors and Inheritance

    • Enabled SWIG Directors:
      • Enabled directors for classes requiring Java-side inheritance, facilitating the overriding of C++ virtual methods in Java subclasses:
        • add_files_listener
        • set_piece_hashes_listener
        • alert_notify_callback
        • swig_plugin
        • posix_wrapper
  • Code Clean-up and Maintenance

    • Ignored Deprecated and Internal Elements:

      • Excluded numerous deprecated methods, internal functions, and classes from the SWIG interface to streamline Java bindings and prevent potential conflicts.
    • Removed Redundant Code:

      • Deleted unnecessary %ignore directives and obsolete SWIG configurations to maintain a clean and maintainable interface.
    • Enhanced Documentation:

      • Improved comments and added TODOs for future integrations, such as web_seed_entry.hpp once merged from the master branch.
2.0.11.0
 * Migration to support libtorrent 2.0 integration
 * Maintained 1.2.x on a separate branch without active maintenance; pull requests are welcome
 * SWIG interface files have been modularized for better maintainability and readability
 * Added missing alert types
 * Introduced typed_bitfield template
 * Operator renaming for Java compatibility
 * Included boost_system_error_code.i
 * Added prepare-macos.sh script
 * Updated run-swig.sh script
 * Set TORRENT_ABI_VERSION=4
 * Boost 1.86.0 upgrade
 * OpenSSL 1.1.1t upgrade
 * Gradle 8.10.2 upgrade
 * Jar built with JDK 11
 * Libtorrent updated to RC_2_0 (rev:2ab8fedabb7716947edc77958da6d0b5e1040df9)
 * Android NDK r26d (LTS) upgrade (from r25c)
 * Added `--swig-only` and `--build-only` options to swig/build scripts
 * Added `prepare-macos.sh` script for macOS build setup
 * Updated `run-swig.sh` script for improved SWIG processing 
 * Upgraded SWIG to 4.2.1
 * Enhanced exception handling in SWIG interfaces
 * Fixed issues in file_storage.hpp and ip_filter.hpp
 * Adjusted build flags and macros for Boost and libtorrent compatibility
 * Enabled SWIG directors for specific classes
 * Ignored deprecated methods in SWIG interface
 * Improved documentation and added TODOs
 * lt:fix uTP issue where closing the connection could corrupt the payload
 * lt:apply DSCP/TOS to sockets before initiating the TCP connection
 * lt:assume copy_file_range() exists on linux (unless old glibc)
 * lt:fix issue where set_piece_deadline() did not correctly post read_piece_alert
 * lt:fix integer overflow in piece picker
 * lt:torrent_status::num_pieces counts pieces passed hash check, as documented
 * lt:check settings_pack::max_out_request_queue before performance alert
 * lt:allow on_unknown_torrent method in the absence of active torrents (new plugin feature added)
 * lt:add feature to async_move_storage() to not move files
 * lt:fix reject resume data if it contains mismatching info hashes
 * lt:fix clear the candidate_cache when clear peer_list
 * lt:fix missing python converter for dht::announce_flags_t
 * lt:fix issue with web seed connections when they close and re-open
 * lt:fallocate() not supported is not a fatal error
 * lt:fix proxying of IPv6 connections via IPv4 proxy
 * lt:treat CGNAT address range as local IPs
 * lt:add stricter checking of piece layers when loading torrents
 * lt:add stricter checking of v1 and v2 hashes being consistent
 * lt:cache failed DNS lookups as well as successful ones
 * lt:add an i2p torrent state to control interactions with clear swarms
 * lt:fix i2p SAM protocol parsing of quoted messages
 * lt:expose i2p peer destination in peer_info
 * lt:fix i2p tracker announces
 * lt:fix issue with read_piece() stopping torrent on pieces not yet downloaded
 * lt:improve handling of allow_i2p_mixed setting to work for magnet links
 * lt:fix web seed request for renamed single-file torrents
 * lt:fix issue where web seeds could disappear from resume data
 * lt:extend save_resume with additional conditional flags
 * lt:fix issue with retrying trackers in tiers > 0
 * lt:fix last_upload and last_download resume data fields to use posix time
 * lt:improve error messages for no_connect_privileged_ports, by untangle it from the port filter
 * lt:fix I2P issue introduced in 2.0.0
 * lt:add async tracker status query, post_trackers()
 * lt:add async torrent status query, post_status()
 * lt:support loading version 2 of resume data format
 * lt:fix issue with odd piece sizes
 * lt:add async piece availability query, post_piece_availability()
 * lt:add async download queue query, post_download_queue()
 * lt:add async file_progress query, post_file_progress()
 * lt:add async peer_info query, post_peer_info()
 * lt:fix uTP streams timing out instead of closing cleanly
 * lt:add write_torrent_file_buf() overload for generating .torrent files
 * lt:add create_torrent::generate_buf() function to generate into a buffer
 * lt:fix copy_file when the file ends with a sparse region
 * lt:uTP performance, fix packet loss when sending is stalled
 * lt:fix trackers being stuck after session pause/resume
 * lt:fix bug in hash_picker with empty files
 * lt:uTP performance, prevent premature timeouts/resends
 * lt:add option to not memory map files below a certain size
 * lt:settings_pack now returns default values when queried for missing settings
 * lt:fix copy_file fall-back when SEEK_HOL/SEEK_DATA is not supported
 * lt:improve error reporting from file copy and move
 * lt:tweak pad file placement to match reference implementation (tail-padding)
 * lt:uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
 * lt:uTP performance, piggy-back held back undersized packet with ACKs
 * lt:uTP performance, don't send redundant deferred ACKs
 * lt:support incoming SOCKS5 packets with hostnames as source address, for UDP trackers
 * lt:ignore duplicate network interface change notifications on linux
 * lt:fix total_want/want accounting when forcing a recheck
 * lt:fix merging metadata with magnet links added on top of existing torrents
 * lt:add torrent_flag to default all file priorities to dont_download
 * lt:fix &so= feature in magnet links
 * lt:improve compatibility of SOCKS5 UDP ASSOCIATE
 * lt:fix madvise range for flushing cache in mmap_storage
 * lt:open files with no_cache set in O_SYNC mode~
 * lt:fix issue in use of copy_file_range() on linux
 * lt:avoid open-file race in the file_view_pool
 * lt:fix issue where stop-when-ready would not close files
 * lt:fix issue with duplicate hybrid torrent via separate v1 and v2 magnet links
 * lt:added new function to load torrent files, load_torrent_*()
 * lt:support sync_file_range() on linux
 * lt:fix issue in write_torrent_file() when file size is exactly piece size
 * lt:fix file_num_blocks() and file_num_pieces() for empty files
 * lt:add new overload to make_magnet_uri()
 * lt:add missing protocol version to tracker_reply_alert and tracker_error_alert
 * lt:fix privilege issue with SetFileValidData()
 * lt:add asynchronous overload of torrent_handle::add_piece()
 * lt:default to a single hashing thread, for full checks
 * lt:Fix bug when checking files and the first piece is invalid
 * lt:fix issue creating a v2 torrent from torrent_info containing an empty file
 * lt:make recheck files also update which files use partfile
 * lt:add write_through disk_io_write_mode, which flushes pieces to disk immediately
 * lt:improve copy file function to preserve sparse regions (when supported)
 * lt:add function to truncate over-sized files part of a torrent
 * lt:fix directory creation on windows shared folders
 * lt:add flag to make add_files() not record file attributes
 * lt:deprecate (unused) allow_partial_disk_writes settings
 * lt:fix disk-full error reporting in mmap_disk_io
 * lt:fixed similar-torrents feature for v2 torrents
 * lt:fix potential unbounded recursion in add_completed_job, in disk I/O
 * lt:deprecated (unused) volatile_read_cache setting
 * lt:fix part files being marked as hidden on window
 * lt:on windows, explicitly flush memory mapped files periodically
 * lt:fix build with WolfSSL
 * lt:fix issue where incoming uTP connections were not accepted over SOCKS5
 * lt:fix several issues in handling of checking files of v2 torrents, esp. from magnet links
 * lt:make the token limit when parsing metadata from magnet files configurable
 * lt:fix issue with stalled pieces on disk full errors
 * lt:fix missing python binding for file_progress_flags
 * lt:fix torrent_file_with_hashes() to fail when we don't have the piece layers
 * lt:restore path character encoding conversion for non UTF-8 locales on linux
 * lt:fix use-after-free bug in make_magnet_uri
 * lt:add write_torrent_file() to produce a .torrent file from add_torrent_params
 * lt:allow loading v2 .torrent files without piece layer
 * lt:fix issue with adding v2 torrents with invalid file root hash
 * lt:fix piece picker bug causing double-picks with prefer-contiguous enabled
 * lt:expose session_params in python bindings
 * lt:fix (deprecated) use of add_torrent_params::info_hash
 * lt:fix issue creating and loading v2 torrents with empty files. Improves conformance to BEP52 reference implementation
 * lt:add new torrent_file_with_hashes() which includes piece layers for creating .torrent files
 * lt:add file_prio_alert, posted when file priorities are updated
 * lt:fix issue where set_piece_hashes() would not propagate file errors
 * lt:add missing python binding for event_t
 * lt:add work-around for systems without fseeko() (such as Android)
 * lt:add convenience header libtorrent/libtorrent.hpp
 * lt:increase default max_allowed_in_request_queue
 * lt:fix loading non-ascii filenames on windows with torrent_info constructor (2.0 regression)
 * lt:add std::hash<> specialization for info_hash_t
 * lt:fix integer overflow in hash_picker and properly restrict max file sizes in torrents
 * lt:strengthen SSRF mitigation for web seeds
 * lt:add v1() and v2() functions to torrent_info
 * lt:fix piece_layers() to work for single-piece files
 * lt:fix python binding regression in session constructor flags
 * lt:fix unaligned piece requests in mmap_storage
 * lt:improve client_data_t ergonomics
 * lt:fix issue with concurrent access to part files
 * lt:fix attribute in single-file v2 torrent creation
 * lt:fix padding for empty files in v2 torrent creation
 * lt:add function to ask a file_storage whether it's v2 or not
 * lt:fix mtime field when creating single-file v2 torrents
 * lt:fix performance regression in checking files
 * lt:disable use of SetFileValidData() by default (windows). A new setting allows enabling it
 * lt:dropped dependency on iconv
 * lt:deprecate set_file_hash() in torrent creator, as it's superceded by v2 torrents
 * lt:deprecate mutable access to info_section in torrent_info
 * lt:removed deprecated lazy_entry/lazy_bdecode
 * lt:stats_alert deprecated
 * lt:remove bittyrant choking algorithm
 * lt:update userdata in add_torrent_params to be type-safe and add to torrent_handle
 * lt:add ip_filter to session_params
 * lt:added support for wolfSSL for SHA-1 hash and HTTPS (no Torrents over SSL)
 * lt:requires OpenSSL minimum version 1.0.0 with SNI support
 * lt:deprecated save_state() and load_state() on session in favour of new
 * lt:write_session_params() and read_session_params()
 * lt:added support for BitTorrent v2 (see docs/upgrade_to_2.0.html)
 * lt:create_torrent() pad_file_limit parameter removed
 * lt:create_torrent() merkle- and optimize-alignment flags removed
 * lt:merkle_tree removed from add_torrent_params
 * lt:announce_entry expose information per v1 and v2 info-hash announces
 * lt:deprecated sha1_hash info_hash members on torrent_removed_alert,
 * lt:torrent_deleted_alert, torrent_delete_failed_alert and add_torrent_params
 * lt:undeprecate error_file_metadata for torrent errors related to its metadata
 * lt:remove support for adding a torrent under a UUID (used for previous RSS support)
 * lt:remove deprecated feature to add torrents by file:// URL
 * lt:remove deprecated feature to download .torrent file from URL
 * lt:requires boost >= 1.66 to build
 * lt:update networking API to networking TS compatible boost.asio
 * lt:overhauled disk I/O subsystem to use memory mapped files (where available)
 * lt:libtorrent now requires C++14 to build
 * lt:added support for GnuTLS for HTTPS and torrents over SSL
 * lt:fix issue where stop-when-ready would not close files
 * lt:uTP performance, fix packet loss when sending is stalled
 * lt:uTP performance, prevent premature timeouts/resends
 * lt:uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
 * lt:uTP performance, piggy-back held back undersized packet with ACKs
 * lt:uTP performance, don't send redundant deferred ACKs
 * lt:fix wanted_done/done accounting when force-rechecking
 * lt:expose userdata via torrent_handle (back-port from 2.0)
 * lt:fix renaming of filenames that are too long for the filesystem
 * lt:made UPnP and LSD code avoid using select_reactor (to work around an issue on windows in boost.asio < 1.80)