Skip to content

Commit

Permalink
Merge branch 'feature-upgrade-libtorrent' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
setvisible committed Sep 7, 2024
2 parents db26fb8 + 45d74a1 commit c065b72
Show file tree
Hide file tree
Showing 168 changed files with 2,684 additions and 2,267 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ CMakeLists.txt.user*
# And reject some specific files
# =======================================
/scripts
*.exe
*.bat

15 changes: 12 additions & 3 deletions 3rd/libtorrent-rasterbar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
-Wno-exit-time-destructors
-Wno-weak-vtables
-Wno-return-std-move-in-c++11
-Wno-unsafe-buffer-usage
-Wno-unknown-warning-option
)
elseif(CMAKE_CXX_COMPILER_ID MATCHES GNU)
Expand Down Expand Up @@ -595,11 +596,17 @@ target_compile_definitions(torrent-rasterbar
BOOST_ASIO_NO_DEPRECATED
PRIVATE
TORRENT_BUILDING_LIBRARY
_FILE_OFFSET_BITS=64
BOOST_EXCEPTION_DISABLE
BOOST_ASIO_HAS_STD_CHRONO
)

if (NOT WIN32)
target_compile_definitions(torrent-rasterbar
PRIVATE
_FILE_OFFSET_BITS=64
)
endif()

target_link_libraries(torrent-rasterbar
PUBLIC
Threads::Threads
Expand Down Expand Up @@ -627,12 +634,14 @@ if (WIN32)
)
target_compile_options(torrent-rasterbar
PRIVATE
# allow larger .obj files (with more sections)
/bigobj
# https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170
/permissive-
# https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170
/utf-8
# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
/Zc:__cplusplus
/MP # for multi-core compilation
/bigobj # increase the number of sections for obj files
)
set_target_properties(torrent-rasterbar PROPERTIES LINK_FLAGS_RELEASE "/OPT:ICF=5 /OPT:REF")
endif()
Expand Down
52 changes: 30 additions & 22 deletions 3rd/libtorrent-rasterbar/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2.0.10 released

* allow on_unknown_torrent method in the absence of active torrents (new plugin feature added)
* add feature to async_move_storage() to not move files
* fix reject resume data if it contains mismatching info hashes
* fix clear the candidate_cache when clear peer_list
* fix missing python converter for dht::announce_flags_t

2.0.9 released

* fix issue with web seed connections when they close and re-open
Expand Down Expand Up @@ -150,7 +158,7 @@

2.0 released

* dropped depenency on iconv
* dropped dependency on iconv
* deprecate set_file_hash() in torrent creator, as it's superceded by v2 torrents
* deprecate mutable access to info_section in torrent_info
* removed deprecated lazy_entry/lazy_bdecode
Expand Down Expand Up @@ -268,7 +276,7 @@
* fix issue with moving the session object
* deprecate torrent_status::allocating. This state is no longer used
* fix bug creating torrents with symbolic links
* remove special case to save metadata in resume data unconditionally when added throught magnet link
* remove special case to save metadata in resume data unconditionally when added through magnet link
* fix bugs in mutable-torrent support (reusing identical files from different torrents)
* fix incorrectly inlined move-assignment of file_storage
* add session::paused flag, and the ability to construct a session in paused mode
Expand Down Expand Up @@ -322,7 +330,7 @@
* limit number of concurrent HTTP announces
* fix queue position for force_rechecking a torrent that is not auto-managed
* improve rate-based choker documentation, and minor tweak
* undeprecate upnp_ignore_nonrouters (but refering to devices on our subnet)
* undeprecate upnp_ignore_nonrouters (but referring to devices on our subnet)
* increase default tracker timeout
* retry failed socks5 server connections
* allow UPnP lease duration to be changed after device discovery
Expand Down Expand Up @@ -402,7 +410,7 @@
1.2.1 release

* add dht_pkt_alert and alerts_dropped_alert to python bindings
* fix python bindins for block_uploaded_alert
* fix python bindings for block_uploaded_alert
* optimize resolving duplicate filenames in loading torrent files
* fix python binding of dht_settings
* tighten up various input validation checks
Expand All @@ -411,7 +419,7 @@
* fix python bindings for peer_info
* support creating symlinks, for torrents with symlinks in them
* fix error in seed_mode flag
* support magnet link parameters with number siffixes
* support magnet link parameters with number suffixes
* consistently use "lt" namespace in examples and documentation
* fix Mingw build to use native cryptoAPI
* uPnP/NAT-PMP errors no longer set the client's advertised listen port to zero
Expand Down Expand Up @@ -605,7 +613,7 @@

* fix infinite loop when parsing certain invalid magnet links
* fix parsing of torrents with certain invalid filenames
* fix leak of torrent_peer objecs (entries in peer_list)
* fix leak of torrent_peer objects (entries in peer_list)
* fix leak of peer_class objects (when setting per-torrent rate limits)
* expose peer_class API to python binding
* fix integer overflow in whole_pieces_threshold logic
Expand Down Expand Up @@ -640,7 +648,7 @@
* fix proxying of https connections
* fix race condition in disk I/O storage class
* fix http connection timeout on multi-homed hosts
* removed depdendency on boost::uintptr_t for better compatibility
* removed dependency on boost::uintptr_t for better compatibility
* fix memory leak in the disk cache
* fix double free in disk cache
* forward declaring libtorrent types is discouraged. a new fwd.hpp header is provided
Expand Down Expand Up @@ -926,7 +934,7 @@
* tweak flag_override_resume_data semantics to make more sense (breaks
backwards compatibility of edge-cases)
* improve DHT bootstrapping and periodic refresh
* improve DHT maintanence performance (by pinging instead of full lookups)
* improve DHT maintenance performance (by pinging instead of full lookups)
* fix bug in DHT routing table node-id prefix optimization
* fix incorrect behavior of flag_use_resume_save_path
* fix protocol race-condition in super seeding mode
Expand Down Expand Up @@ -1109,7 +1117,7 @@
* fix piece-picker stat bug when only selecting some files for download
* fix bug in async_add_torrent when settings file_priorities
* fix boost-1.42 support for python bindings
* fix memory allocation issue (virtual addres space waste) on windows
* fix memory allocation issue (virtual address space waste) on windows

0.16.11 release

Expand All @@ -1125,7 +1133,7 @@
* GCC 4.8 fix
* fix proxy failure semantics with regards to anonymous mode
* fix round-robin seed-unchoke algorithm
* add bootstrap.sh to generage configure script and run configure
* add bootstrap.sh to generate configure script and run configure
* fix bug in SOCK5 UDP support
* fix issue where torrents added by URL would not be started immediately

Expand Down Expand Up @@ -1302,7 +1310,7 @@
* support banning web seeds sending corrupt data
* don't let hung outgoing connection attempts block incoming connections
* improve SSL torrent support by using SNI and a single SSL listen socket
* improved peer exchange performance by sharing incoming connections which advertize listen port
* improved peer exchange performance by sharing incoming connections which advertise listen port
* deprecate set_ratio(), and per-peer rate limits
* add web seed support for torrents with pad files
* introduced a more scalable API for torrent status updates (post_torrent_updates()) and updated client_test to use it
Expand Down Expand Up @@ -1694,7 +1702,7 @@ release 0.14.9

release 0.14.8

* ignore unkown metadata messages
* ignore unknown metadata messages
* fixed typo that would sometimes prevent queued torrents to be checked
* fixed bug in auto-manager where active_downloads and active_seeds would
sometimes be used incorrectly
Expand All @@ -1721,7 +1729,7 @@ release 0.14.7
ended with a /
* fixed bug in error handling when parsing torrent files
* fixed file checking bug when renaming a file before checking the torrent
* fixed race conditon when receiving metadata from swarm
* fixed race condition when receiving metadata from swarm
* fixed assert in ut_metadata plugin
* back-ported some fixes for building with no exceptions
* fixed create_torrent when passing in a path ending with /
Expand Down Expand Up @@ -1814,7 +1822,7 @@ release 0.14.3
* fixed issue where renamed files were sometimes not saved in resume data
* accepts tracker responses with no 'peers' field, as long as 'peers6'
is present
* fixed CIDR-distance calculation in the precense of IPv6 peers
* fixed CIDR-distance calculation in the presence of IPv6 peers
* save partial resume data for torrents that are queued for checking
or checking, to maintain stats and renamed files
* Don't try IPv6 on windows if it's not installed
Expand All @@ -1839,7 +1847,7 @@ release 0.14.2
tracker urls
* fixed bug where the files requested from web seeds would be the
renamed file names instead of the original file names in the torrent.
* documentation fix of queing section
* documentation fix of queueing section
* fixed potential issue in udp_socket (affected udp tracker support)
* made name, comment and created by also be subject to utf-8 error
correction (filenames already were)
Expand All @@ -1853,7 +1861,7 @@ release 0.14.2
* fixed race condition when saving DHT state
* fixed bugs related to lexical_cast being locale dependent
* added support for SunPro C++ compiler
* fixed bug where messeges sometimes could be encrypted in the
* fixed bug where messages sometimes could be encrypted in the
wrong order, for encrypted connections.
* fixed race condition where torrents could get stuck waiting to
get checked
Expand All @@ -1874,7 +1882,7 @@ release 0.14.1
sometimes quit when an error occurred
* fixed DHT bug
* fixed potential shutdown crash in disk_io_thread
* fixed usage of deprecated boost.filsystem functions
* fixed usage of deprecated boost.filesystem functions
* fixed http_connection unit test
* fixed bug in DHT when a DHT state was loaded
* made rate limiter change in 0.14 optional (to take estimated
Expand Down Expand Up @@ -1945,7 +1953,7 @@ release 0.14
* Disk cache support.
* New, more memory efficient, piece picker with sequential download
support (instead of the more complicated sequential download threshold).
* Auto Upload slots. Automtically opens up more slots if
* Auto Upload slots. Automatically opens up more slots if
upload limit is not met.
* Improved NAT-PMP support by querying the default gateway
* Improved UPnP support by ignoring routers not on the clients subnet.
Expand Down Expand Up @@ -2056,7 +2064,7 @@ release 0.12
* fixed bug in DHT code which would send incorrect announce messages.
* fixed bug where the http header parser was case sensitive to the header
names.
* Implemented an optmization which frees the piece_picker once a torrent
* Implemented an optimization which frees the piece_picker once a torrent
turns into a seed.
* Added support for uT peer exchange extension, implemented by Massaroddel.
* Modified the quota management to offer better bandwidth balancing
Expand Down Expand Up @@ -2086,9 +2094,9 @@ release 0.11
* fixed bug with file_progress() with files = 0 bytes
* fixed a race condition bug in udp_tracker_connection that could
cause a crash.
* fixed bug occuring when increasing the sequenced download threshold
* fixed bug occurring when increasing the sequenced download threshold
with max availability lower than previous threshold.
* fixed an integer overflow bug occuring when built with gcc 4.1.x
* fixed an integer overflow bug occurring when built with gcc 4.1.x
* fixed crasing bug when closing while checking a torrent
* fixed bug causing a crash with a torrent with piece length 0
* added an extension to the DHT network protocol to support the
Expand Down Expand Up @@ -2154,7 +2162,7 @@ release 0.10

release 0.9.1

* made the session disable file name checks within the boost.filsystem library
* made the session disable file name checks within the boost.filesystem library
* fixed race condition in the sockets
* strings that are invalid utf-8 strings are now decoded with the
local codepage on windows
Expand Down
24 changes: 23 additions & 1 deletion 3rd/libtorrent-rasterbar/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import cast ;

# we need version numbers in the form X.Y.Z in order to trigger the built-in
# support for generating symlinks to the installed library
VERSION = 2.0.9 ;
VERSION = 2.0.10 ;

BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ;
CXXFLAGS = [ modules.peek : CXXFLAGS ] ;
Expand Down Expand Up @@ -155,6 +155,14 @@ rule linking ( properties * )
result += <framework>CoreFoundation <framework>SystemConfiguration ;
}

if <target-os>iphone in $(properties)
{
# boost.asio seems to mis-detect iOS as supporting the __thread
# keyword, resulting in the error:
# error: thread-local storage is not supported for the current target
result += <define>BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION ;
}

if <toolset>gcc in $(properties)
&& <target-os>linux in $(properties)
&& ( <asserts>on in $(properties)
Expand Down Expand Up @@ -262,6 +270,10 @@ rule warnings ( properties * )

# libtorrent uses alloca() carefully
result += <cxxflags>-Wno-alloca ;

# these warnings should all be addressed. Either by transitioning to span and
# array, or by suppressing the warning for specific code
result += <cxxflags>-Wno-unsafe-buffer-usage ;
}

if <toolset>gcc in $(properties)
Expand Down Expand Up @@ -321,10 +333,20 @@ rule building ( properties * )
{
# allow larger .obj files (with more sections)
result += <cxxflags>/bigobj ;

# https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170
result += <cxxflags>/utf-8 ;

# two-phase lookup is not supported by C++/CX on msvc, so it needs to be
# disabled. We can't set permissive- in that case
if ! <windows-api>store in $(properties)
{
# https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170
result += <cxxflags>/permissive- ;
}
}


if <toolset>gcc in $(properties) && <target-os>windows in $(properties)
{
# allow larger .obj files (with more sections)
Expand Down
5 changes: 3 additions & 2 deletions 3rd/libtorrent-rasterbar/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=2.0.9
VERSION=2.0.10

BUILD_CONFIG=release link=shared crypto=openssl warnings=off address-model=64

Expand Down Expand Up @@ -1012,6 +1012,7 @@ TEST_TORRENTS = \
invalid_pieces.torrent \
invalid_symlink.torrent \
large.torrent \
large_piece_size.torrent \
long_name.torrent \
many_pieces.torrent \
missing_path_list.torrent \
Expand Down Expand Up @@ -1049,6 +1050,7 @@ TEST_TORRENTS = \
url_seed_multi_space_nolist.torrent \
whitespace_url.torrent \
v2.torrent \
v2_empty_file.torrent \
v2_multipiece_file.torrent \
v2_only.torrent \
v2_invalid_filename.torrent \
Expand Down Expand Up @@ -1101,7 +1103,6 @@ TEST_EXTRA = Jamfile \
root2.xml \
root3.xml \
ssl/regenerate_test_certificate.sh \
ssl/cert_request.pem \
ssl/dhparams.pem \
ssl/invalid_peer_certificate.pem \
ssl/invalid_peer_private_key.pem \
Expand Down
6 changes: 0 additions & 6 deletions 3rd/libtorrent-rasterbar/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@
.. image:: https://api.cirrus-ci.com/github/arvidn/libtorrent.svg?branch=RC_2_0
:target: https://cirrus-ci.com/github/arvidn/libtorrent

.. image:: https://img.shields.io/lgtm/alerts/g/arvidn/libtorrent.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/arvidn/libtorrent/alerts/

.. image:: https://oss-fuzz-build-logs.storage.googleapis.com/badges/libtorrent.svg
:target: https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&q=proj%3Alibtorrent&can=1

.. image:: https://codecov.io/github/arvidn/libtorrent/coverage.svg?branch=RC_2_0
:target: https://codecov.io/github/arvidn/libtorrent?branch=RC_2_0&view=all#sort=missing&dir=desc

.. image:: https://img.shields.io/lgtm/grade/cpp/g/arvidn/libtorrent.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/arvidn/libtorrent/context:cpp

.. image:: https://www.openhub.net/p/rasterbar-libtorrent/widgets/project_thin_badge.gif
:target: https://www.openhub.net/p/rasterbar-libtorrent

Expand Down
1 change: 0 additions & 1 deletion 3rd/libtorrent-rasterbar/bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def write_b2_python_config(


class LibtorrentBuildExt(build_ext_lib.build_ext):

CONFIG_MODE_DISTUTILS = "distutils"
CONFIG_MODE_B2 = "b2"
CONFIG_MODES = (CONFIG_MODE_DISTUTILS, CONFIG_MODE_B2)
Expand Down
3 changes: 3 additions & 0 deletions 3rd/libtorrent-rasterbar/bindings/python/src/converters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "libtorrent/pex_flags.hpp"
#include "libtorrent/string_view.hpp"
#include "libtorrent/storage_defs.hpp"
#include "libtorrent/kademlia/announce_flags.hpp"
#include "libtorrent/write_resume_data.hpp"
#include <vector>
#include <map>
Expand Down Expand Up @@ -453,6 +454,7 @@ void bind_converters()
to_python_converter<lt::create_flags_t, from_bitfield_flag<lt::create_flags_t>>();
to_python_converter<lt::pex_flags_t, from_bitfield_flag<lt::pex_flags_t>>();
to_python_converter<lt::reannounce_flags_t, from_bitfield_flag<lt::reannounce_flags_t>>();
to_python_converter<lt::dht::announce_flags_t, from_bitfield_flag<lt::dht::announce_flags_t>>();
to_python_converter<lt::file_progress_flags_t, from_bitfield_flag<lt::file_progress_flags_t>>();
to_python_converter<lt::write_torrent_flags_t, from_bitfield_flag<lt::write_torrent_flags_t>>();
to_python_converter<lt::string_view, from_string_view>();
Expand Down Expand Up @@ -549,6 +551,7 @@ void bind_converters()
to_bitfield_flag<lt::create_flags_t>();
to_bitfield_flag<lt::pex_flags_t>();
to_bitfield_flag<lt::reannounce_flags_t>();
to_bitfield_flag<lt::dht::announce_flags_t>();
to_string_view();
to_bitfield_flag<lt::session_flags_t>();
to_bitfield_flag<lt::file_progress_flags_t>();
Expand Down
Loading

0 comments on commit c065b72

Please sign in to comment.