diff --git a/.cirrus.yml b/.cirrus.yml index fe454e9545a..4b555e97619 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,10 +1,10 @@ freebsd_instance: - image_family: freebsd-12-1 + image_family: freebsd-14-0 task: install_script: | IGNORE_OSVERSION=yes pkg update - pkg install -U -y git boost_build boost-libs unzip wget openssl cmake ninja + pkg install -U -y git boost-build boost-libs unzip wget openssl cmake ninja echo "using clang ;" > ~/user-config.jam submodules_script: | git submodule update --init --recursive @@ -28,7 +28,7 @@ build_and_store_wheels: &BUILD_AND_STORE_WHEELS delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} install_cibuildwheel_script: - - $PYTHON -m pip install cibuildwheel==2.12.0 + - $PYTHON -m pip install cibuildwheel==2.16.3 run_cibuildwheel_script: - cibuildwheel @@ -40,12 +40,12 @@ build_macos_arm64_task: name: Build macOS arm64 wheels. macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode + image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest env: CIRRUS_CLONE_SUBMODULES: true CIBW_SKIP: pp* cp38-* # cp38-* has problem with x86_64 / arm64 confusion - CIBW_BUILD: cp39-* cp310-* # cp311-* can be added after boost-python version >= 1.81 + CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* CIBW_ARCH: arm64 PATH: /opt/homebrew/bin:$PATH PYTHON: python3.9 @@ -64,19 +64,19 @@ test_macos_arm64_task: name: Test macOS arm64. macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode + image: ghcr.io/cirruslabs/macos-sonoma-xcode:latest env: CIRRUS_CLONE_SUBMODULES: true PATH: /opt/homebrew/bin:$PATH PYTHON: python3.9 OPENSSL_OPTS: > - openssl-lib=/opt/homebrew/opt/openssl@1.1/lib - openssl-include=/opt/homebrew/opt/openssl@1.1/include + openssl-lib=/opt/homebrew/opt/openssl@3.0/lib + openssl-include=/opt/homebrew/opt/openssl@3.0/include install_pre_requirements_script: - brew install python@3.9 - - brew install boost-build boost openssl@1.1 + - brew install boost-build boost openssl@3.0 - echo "using darwin ;" >>~/user-config.jam debug_script: diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index b5b2d925d96..9002aac5cb7 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -88,6 +88,7 @@ jobs: CIBW_BUILD_VERBOSITY: 1 CIBW_BUILD: ${{ matrix.CIBW_BUILD }} CIBW_ARCHS: ${{ matrix.CIBW_ARCHS }} + CIBW_TEST_SKIP: "*-win32" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 86609b94fa6..28aba9eb6ca 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -25,7 +25,7 @@ jobs: build: name: build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 continue-on-error: true strategy: @@ -52,7 +52,7 @@ jobs: - name: install boost run: | - sudo apt install libboost-tools-dev libboost-dev libboost-system-dev + sudo apt install libboost-python-dev libboost-tools-dev libboost-dev libboost-system-dev python3 echo "using gcc ;" >>~/user-config.jam - name: install gcrypt @@ -61,18 +61,23 @@ jobs: - name: build library run: | - b2 ${{ matrix.config }} cxxstd=14 + b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - name: build examples run: | cd examples - b2 ${{ matrix.config }} + b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on - name: build tools run: | cd tools - b2 ${{ matrix.config }} warnings-as-errors=on + b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on + - name: build python bindings + run: | + cd bindings/python + echo "using python ;" >>~/user-config.jam + BOOST_ROOT="" b2 ${{ matrix.config }} cxxstd=14,17,20 warnings-as-errors=on fuzzers: @@ -176,7 +181,7 @@ jobs: - name: install boost run: | sudo apt install libboost-tools-dev libboost-dev - echo "using clang_tidy : : clang-tidy \"-checks=-clang-analyzer-core.*,-clang-analyzer-unix.*\" : -std=c++14 -I/usr/local/clang-7.0.0/include/c++/v1 -stdlib=libc++ -stdlib=libc++ ;" >> ~/user-config.jam; + echo "using clang_tidy : : clang-tidy \"-checks=-clang-analyzer-core.*,-clang-analyzer-unix.*\" : -std=c++14 -I/usr/local/clang-7.0.0/include/c++/v1 -stdlib=libc++ -Wno-unknown-warning-option -stdlib=libc++ ;" >> ~/user-config.jam; - name: analyze run: | @@ -186,7 +191,7 @@ jobs: test: name: Tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 continue-on-error: true strategy: @@ -194,7 +199,7 @@ jobs: include: - config: address-sanitizer=norecover undefined-sanitizer=norecover crypto=openssl - config: toolset=clang logging=off address-sanitizer=norecover undefined-sanitizer=norecover - - config: thread-sanitizer=norecover crypto=openssl release debug-symbols=on + - config: thread-sanitizer=norecover crypto=openssl release debug-symbols=on cxxflags=-Wno-tsan - config: crypto=gnutls - config: deprecated-functions=off @@ -221,16 +226,21 @@ jobs: run: | sudo apt install libgnutls28-dev - - name: install clang-10 + - name: install clang-12 continue-on-error: true run: | - sudo apt install clang-10 + sudo apt install clang-12 + + - name: install GCC-12 + continue-on-error: true + run: | + sudo apt install gcc-12 - name: install boost run: | sudo apt install libboost-tools-dev libboost-dev libboost-system-dev - echo "using gcc ;" >>~/user-config.jam - echo "using clang : 10 : clang++-10 ;" >>~/user-config.jam + echo "using gcc : 12 : g++-12 ;" >>~/user-config.jam + echo "using clang : 12 : clang++-12 ;" >>~/user-config.jam - name: build and run tests run: | diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cde3b1444dd..b61b276566a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -120,7 +120,18 @@ jobs: - name: install boost run: | - brew install boost-build boost + git clone --depth=1 --recurse-submodules -j10 --branch=boost-1.78.0 https://github.com/boostorg/boost.git + cd boost + ./bootstrap.sh + + - name: boost headers + run: | + cd boost + ./b2 headers + cp b2 .. + + - name: user-config + run: | echo "using darwin : ios_sim : clang++ : -Wno-deprecated-declarations \"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk\" -mios-simulator-version-min=7 @@ -141,4 +152,4 @@ jobs: - name: build library run: | - b2 -l400 cxxstd=14 darwin-ios darwin-ios_sim address-model=64 link=static + BOOST_ROOT=boost ./b2 -l400 cxxstd=14 target-os=iphone crypto=built-in darwin-ios darwin-ios_sim address-model=64 link=static diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index d5fea5856fc..70a0e49aff0 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -27,8 +27,8 @@ jobs: - name: dependencies (MacOS) if: runner.os == 'macOS' run: | - brew install boost-build boost boost-python3 python@3.11 openssl@1.1 - export PATH=$(brew --prefix)/opt/python@3.11/bin:$PATH + brew install boost-build boost boost-python3 python@3.12 openssl@1.1 + export PATH=$(brew --prefix)/opt/python@3.12/bin:$PATH - name: update package lists (linux) if: runner.os == 'Linux' @@ -109,8 +109,8 @@ jobs: run: | # Install to Homebrew's python site-packages. no need for --user and --prefix cd bindings/python - export PATH=$(brew --prefix)/opt/python@3.11/bin:$PATH - python3.11 setup.py build_ext install --install-lib $(brew --prefix)/lib/python3.11/site-packages + export PATH=$(brew --prefix)/opt/python@3.12/bin:$PATH + python3.12 setup.py build_ext install --install-lib $(brew --prefix)/lib/python3.12/site-packages - name: tests (Linux) if: runner.os == 'Linux' @@ -122,5 +122,5 @@ jobs: if: runner.os == 'macOS' run: | cd bindings/python - export PATH=$(brew --prefix)/opt/python@3.11/bin:$PATH - python3.11 test.py + export PATH=$(brew --prefix)/opt/python@3.12/bin:$PATH + python3.12 test.py diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f98dcd30f1c..3cd0f584d02 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -221,6 +221,7 @@ jobs: - name: Set up MinGW uses: egor-tensin/setup-mingw@v2 with: + static: 0 platform: x64 - name: tests (deterministic) diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index 597a3ccd707..00000000000 --- a/.lgtm.yml +++ /dev/null @@ -1,20 +0,0 @@ -path_classifiers: - test: - - "test/*.py" - - exclude: "test/*.cpp" - - exclude: "test/*.hpp" - -extraction: - cpp: - prepare: - packages: - - libboost-all-dev - - libssl-dev - - ninja-build - after_prepare: | - wget -q "https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-linux-x86_64.tar.gz" - tar xzf cmake-3.21.2-linux-x86_64.tar.gz - index: - build_command: | - ./cmake-3.21.2-linux-x86_64/bin/cmake -Dbuild_examples=ON -Dbuild_tests=ON -Dbuild_tools=ON -GNinja . - ./cmake-3.21.2-linux-x86_64/bin/cmake --build . diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fef8dd7742..88b60f3ecc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.5.0 hooks: #- id: trailing-whitespace #- id: end-of-file-fixer @@ -32,17 +32,17 @@ repos: - id: check-symlinks - id: check-toml - repo: https://github.com/pappasam/toml-sort - rev: v0.20.1 + rev: v0.23.1 hooks: - id: toml-sort args: [--all, --in-place] - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort exclude: | @@ -71,8 +71,8 @@ repos: tools/run_benchmark.py| tools/update_copyright.py )$ -- repo: https://github.com/myint/autoflake - rev: v1.7.6 +- repo: https://github.com/PyCQA/autoflake + rev: v2.2.1 hooks: - id: autoflake args: [--in-place, --remove-unused-variables, --remove-all-unused-imports, --remove-duplicate-keys] @@ -85,8 +85,8 @@ repos: tools/gen_convenience_header.py| tools/libtorrent_lldb.py ) -- repo: https://github.com/python/black - rev: 22.10.0 +- repo: https://github.com/psf/black + rev: 24.2.0 hooks: - id: black # Avoiding PR bloat @@ -132,7 +132,7 @@ repos: name: black (pyi) types: [pyi] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v1.8.0 hooks: - id: mypy # Avoiding PR bloat @@ -171,7 +171,7 @@ repos: tools/update_copyright.py )$ - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 7.0.0 hooks: - id: flake8 exclude: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 5477543b6c1..91be804fdf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 @@ -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() diff --git a/ChangeLog b/ChangeLog index 4006b7b12bb..06de8be737c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 / @@ -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 @@ -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) @@ -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 @@ -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 @@ -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. @@ -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 @@ -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 @@ -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 diff --git a/Jamfile b/Jamfile index a9e121a3280..1e35e5a2963 100644 --- a/Jamfile +++ b/Jamfile @@ -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 ] ; @@ -155,6 +155,14 @@ rule linking ( properties * ) result += CoreFoundation SystemConfiguration ; } + if 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 += BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION ; + } + if gcc in $(properties) && linux in $(properties) && ( on in $(properties) @@ -262,6 +270,10 @@ rule warnings ( properties * ) # libtorrent uses alloca() carefully result += -Wno-alloca ; + +# these warnings should all be addressed. Either by transitioning to span and +# array, or by suppressing the warning for specific code + result += -Wno-unsafe-buffer-usage ; } if gcc in $(properties) @@ -321,10 +333,20 @@ rule building ( properties * ) { # allow larger .obj files (with more sections) result += /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 += /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 ! store in $(properties) + { + # https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170 + result += /permissive- ; + } } + if gcc in $(properties) && windows in $(properties) { # allow larger .obj files (with more sections) diff --git a/Makefile b/Makefile index e3f43e88112..cf67552383b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=2.0.9 +VERSION=2.0.10 BUILD_CONFIG=release link=shared crypto=openssl warnings=off address-model=64 @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/README.rst b/README.rst index b45fb29f67f..207b248cab3 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/bindings/python/setup.cfg b/bindings/python/setup.cfg index f95b5b8a28d..3b6e8031ddc 100644 --- a/bindings/python/setup.cfg +++ b/bindings/python/setup.cfg @@ -1,5 +1,5 @@ [metadata] -version = 2.0.9 +version = 2.0.10 [build_ext] cxxstd = 14 diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 3653b9ae38a..0eb07c2b5c6 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -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) diff --git a/bindings/python/src/converters.cpp b/bindings/python/src/converters.cpp index 9c7c2b2170d..d989329d741 100644 --- a/bindings/python/src/converters.cpp +++ b/bindings/python/src/converters.cpp @@ -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 #include @@ -453,6 +454,7 @@ void bind_converters() to_python_converter>(); to_python_converter>(); to_python_converter>(); + to_python_converter>(); to_python_converter>(); to_python_converter>(); to_python_converter(); @@ -549,6 +551,7 @@ void bind_converters() to_bitfield_flag(); to_bitfield_flag(); to_bitfield_flag(); + to_bitfield_flag(); to_string_view(); to_bitfield_flag(); to_bitfield_flag(); diff --git a/bindings/python/src/entry.cpp b/bindings/python/src/entry.cpp index 6e0ee74aadb..e4c55aa14a3 100644 --- a/bindings/python/src/entry.cpp +++ b/bindings/python/src/entry.cpp @@ -20,7 +20,7 @@ struct entry_to_python result.append(*i); } - return std::move(result); + return TORRENT_RVO(result); } static object convert(entry::dictionary_type const& d) @@ -30,7 +30,7 @@ struct entry_to_python for (entry::dictionary_type::const_iterator i(d.begin()), e(d.end()); i != e; ++i) result[bytes(i->first)] = i->second; - return std::move(result); + return TORRENT_RVO(result); } static object convert0(entry const& e) diff --git a/bindings/python/src/error_code.cpp b/bindings/python/src/error_code.cpp index b947119f583..6e802b34280 100644 --- a/bindings/python/src/error_code.cpp +++ b/bindings/python/src/error_code.cpp @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace boost { - // this fixe mysterious link error on msvc + // this fixes mysterious link error on msvc template <> inline boost::system::error_category const volatile* get_pointer(class boost::system::error_category const volatile* p) diff --git a/bindings/python/src/gil.hpp b/bindings/python/src/gil.hpp index 59f2f74467e..562ca3c09a5 100644 --- a/bindings/python/src/gil.hpp +++ b/bindings/python/src/gil.hpp @@ -80,7 +80,7 @@ struct visitor : boost::python::def_visitor> F fn; }; -// Member function adaptor that releases and aqcuires the GIL +// Member function adaptor that releases and acquires the GIL // around the function call. template visitor allow_threads(F fn) diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 1a597129aa4..02a6fcb369a 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -1157,6 +1157,7 @@ void bind_session() .def("post_session_stats", allow_threads(<::session::post_session_stats)) .def("is_listening", allow_threads(<::session::is_listening)) .def("listen_port", allow_threads(<::session::listen_port)) + .def("ssl_listen_port", allow_threads(<::session::ssl_listen_port)) #ifndef TORRENT_DISABLE_DHT .def("add_dht_node", &add_dht_node) #if TORRENT_ABI_VERSION == 1 diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index 12fcbca9455..41247f29f21 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -468,6 +468,8 @@ void bind_torrent_handle() .value("always_replace_files", move_flags_t::always_replace_files) .value("fail_if_exist", move_flags_t::fail_if_exist) .value("dont_replace", move_flags_t::dont_replace) + .value("reset_save_path", move_flags_t::reset_save_path) + .value("reset_save_path_unchecked", move_flags_t::reset_save_path_unchecked) ; #if TORRENT_ABI_VERSION == 1 @@ -557,6 +559,7 @@ void bind_torrent_handle() .def("info_hashes", _(&torrent_handle::info_hashes)) .def("force_recheck", _(&torrent_handle::force_recheck)) .def("rename_file", _(rename_file0)) + .def("set_ssl_certificate_buffer", &torrent_handle::set_ssl_certificate_buffer, (arg("cert"), arg("private_key"), arg("dh_params"))) .def("set_ssl_certificate", &torrent_handle::set_ssl_certificate, (arg("cert"), arg("private_key"), arg("dh_params"), arg("passphrase")="")) .def("flags", _(&torrent_handle::flags)) .def("set_flags", _(set_flags0)) diff --git a/bindings/python/test.py b/bindings/python/test.py index 0b6aaaddcb7..612006ecac5 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -208,7 +208,7 @@ def test_replace_trackers(self): self.assertEqual(new_trackers[1]['fail_limit'], 2) def test_pickle_trackers(self): - """Test lt objects convertors are working and trackers can be pickled""" + """Test lt objects converters are working and trackers can be pickled""" self.setup() tracker = lt.announce_entry('udp://tracker1.com') tracker.tier = 0 diff --git a/docs/header.rst b/docs/header.rst index cdfef908808..fff8a7cffde 100644 --- a/docs/header.rst +++ b/docs/header.rst @@ -1 +1 @@ -:Version: 2.0.9 +:Version: 2.0.10 diff --git a/docs/hunspell/libtorrent.dic b/docs/hunspell/libtorrent.dic index 0697d409e68..1b0993710f3 100644 --- a/docs/hunspell/libtorrent.dic +++ b/docs/hunspell/libtorrent.dic @@ -551,7 +551,7 @@ cpp tos BP qB -LT2090 +LT20A0 iocontrol getname getpeername diff --git a/docs/style.css b/docs/style.css index 7739455a3a7..c0b3912c55e 100644 --- a/docs/style.css +++ b/docs/style.css @@ -1,3 +1,29 @@ +:root { + /* Nord Color Theme: https://www.nordtheme.com/ + Details about the palette and use cause of each color: https://www.nordtheme.com/docs/colors-and-palettes */ + + /* Polar Night */ + --nord0: #2e3440; + --nord1: #3b4252; + --nord2: #434c5e; + --nord3: #4c566a; + /* Snow Storm */ + --nord4: #d8dee9; + --nord5: #e5e9f0; + --nord6: #eceff4; + /* Frost */ + --nord7: #8fbcbb; + --nord8: #88c0d0; + --nord9: #81a1c1; + --nord10: #5e81ac; + /* Aurora */ + --nord11: #bf616a; + --nord12: #d08770; + --nord13: #ebcb8b; + --nord14: #a3be8c; + --nord15: #b48ead; +} + @media (prefers-color-scheme: light) { body { background-color: white; @@ -7,420 +33,550 @@ @media (prefers-color-scheme: dark) { body { - background-color: black; - color: #ddd; + background-color: var(--nord0); + color: var(--nord6); } } /* STYLE */ body { - margin: 0px; - font-size: 12pt; + margin: 0; + font-size: 12pt; } dt { - margin-bottom: 0.3em; - font-style: italic; - font-weight: 600; + margin-bottom: 0.3em; + font-style: italic; + font-weight: 600; } dd { - margin-left: 2em; - margin-bottom: 1em; + margin-left: 2em; + margin-bottom: 1em; } tt { - font-family: monospace; + font-family: monospace; } -h1 { font-size: 1.7em; } -h2 { font-size: 1.5em; } +h1 { + font-size: 1.7em; +} + +h2 { + font-size: 1.5em; +} @media (prefers-color-scheme: light) { -tt { background-color: rgba(0, 0, 0, 0.05); } -table { border-color: #ccc; } -th, td { border-color: #ddd; } -th { border-bottom-color: black; } -a.reference, a { color: #000070; } -hr { border-color: #eee; } + tt { + background-color: rgb(0 0 0 / 5%); + } + + table { + border-color: #ccc; + } + + th, + td { + border-color: #ddd; + } + + th { + border-bottom-color: black; + } + + a.reference, + a { + color: #000070; + } + + hr { + border-color: #eee; + } } + @media (prefers-color-scheme: dark) { -tt { background-color: rgba(255, 255, 255, 0.2); } -table { border-color: #777; } -th, td { border-color: #444; } -th { border-bottom-color: white; } -a.reference, a { color: #bbf; } -hr { border-color: #777; } + tt { + background-color: var(--nord3); + } + + table { + border-color: var(--nord7); + } + + th, + td { + border-color: var(--nord2); + } + + th { + border-bottom-color: var(--nord7); + } + + a.reference, + a { + color: var(--nord8); + } + + hr { + border-color: var(--nord7); + } } hr { - border-bottom-width: 1px; - border-style: solid; + border-bottom-width: 1px; + border-style: solid; } table { - margin-bottom: 1em; - border-collapse: collapse; - border-style: solid; + margin-bottom: 1em; + border-collapse: collapse; + border-style: solid; } -th, td { padding: 0.2em; } +th, +td { + padding: 0.2em; +} th { - border-bottom-style: solid; - border-bottom-width: 1px; + border-bottom-style: solid; + border-bottom-width: 1px; } a { - text-decoration: none; + text-decoration: none; } -a:hover -{ - text-decoration: underline; +a:hover { + text-decoration: underline; } p.last { - margin-bottom: 0.3em; + margin-bottom: 0.3em; } p.first { - margin-top: 0.3em; + margin-top: 0.3em; } .align-right { - float: right; + float: right; } @media (prefers-color-scheme: dark) { -.bw { - filter: invert(1); -} + .bw { + filter: invert(1); + } } /* TEMPLATE */ @media (prefers-color-scheme: light) { -#footer { - color: #777; -} -#footer a { color: #555; } -#footer a:hover { color: #000; } -#gradient { background: linear-gradient(#aaa, #ddd); } -#filler { background: linear-gradient(#ddd, #fff); } + #footer { + color: #777; + } + + #footer a { + color: #555; + } + + #footer a:hover { + color: #000; + } + + #gradient { + background: linear-gradient(#aaa, #ddd); + } + + #filler { + background: linear-gradient(#ddd, #fff); + } } + @media (prefers-color-scheme: dark) { -#footer { - color: #888; -} -#footer a { color: #ccc; } -#footer a:hover { color: #fff; } -#gradient { background: #444; } -#filler { background: linear-gradient(#444, black); } + #footer { + color: var(--nord5); + } + + #footer a { + color: var(--nord9); + } + + #footer a:hover { + color: var(--nord8); + } + + #gradient { + background: var(--nord1); + } + + #filler { + background: linear-gradient(var(--nord1), var(--nord0)); + } } + #container { - text-align: left; - max-width: 60em; - margin: 5px auto; - position: relative; - padding: 3px; + text-align: left; + max-width: 60em; + margin: 5px auto; + position: relative; + padding: 3px; } #gradient { - height: 40px; + height: 40px; } #filler { - min-height: 400px; - height: 100%; + min-height: 400px; + height: 100%; } #footer { - margin-bottom: 0px; - margin-left: auto; - margin-right: auto; - column-count: 3; - column-width: 7em; - max-width: 40em; + margin-bottom: 0; + margin-left: auto; + margin-right: auto; + columns: 7em 3; + max-width: 40em; } #footer a { - text-decoration: none; + text-decoration: none; } #footer a:hover { - text-decoration: underline; + text-decoration: underline; } table.docinfo { - float: right; - width: 200px; - margin-right: 0px; - margin-left: 20px; - margin-bottom: 20px; - border: none; + float: right; + width: 200px; + margin-right: 0; + margin-left: 20px; + margin-bottom: 20px; + border: none; } -@media screen and (max-width: 499px) { -table.docinfo { - display: none; -} +@media screen and (width <= 499px) { + table.docinfo { + display: none; + } } table.docinfo th { - text-align: right; - background-color: transparent; - border: none; + text-align: right; + background-color: transparent; + border: none; } table.docinfo td { - padding-left: 10px; + padding-left: 10px; } - /* FRONT PAGE */ -@media screen and (min-width: 500px) { -#librarySidebar { - float: left; - width: 13em; -} -#libraryBody { - margin-left: 13em; -} -} +@media screen and (width >= 500px) { + #librarySidebar { + float: left; + width: 13em; + } -@media screen and (max-width: 240px) { -#librarySidebar ul { - list-style-type: none; - padding-inline-start: 0px; + #libraryBody { + margin-left: 13em; + } } + +@media screen and (width <= 240px) { + #librarySidebar ul { + list-style-type: none; + padding-inline-start: 0; + } } -#librarySidebar li { padding-bottom: 0.35em; } +#librarySidebar li { + padding-bottom: 0.35em; +} @media (prefers-color-scheme: light) { -#libraryBody { - border-color: #eee; -} + #libraryBody { + border-color: #eee; + } } + @media (prefers-color-scheme: dark) { -#libraryBody { - border-color: #777; -} + #libraryBody { + border-color: var(--nord7); + } } #libraryBody { - border-left-style: solid; - border-left-width: 1px; - padding-left: 10px; - margin-right: 10px; + border-left-style: solid; + border-left-width: 1px; + padding-left: 10px; + margin-right: 10px; } .screenshot { - width: 100%; + width: 100%; } .front-page-screenshot { - float: right; -} -@media screen and (max-width: 890px) { -.front-page-screenshot { - display: none; -} + float: right; } -.front-page-qr { - float: right; - clear: right; +@media screen and (width <= 890px) { + .front-page-screenshot { + display: none; + } } -@media screen and (max-width: 600px) { + .front-page-qr { - display: none; + float: right; + clear: right; } + +@media screen and (width <= 600px) { + .front-page-qr { + display: none; + } } .report-issue { - float: right; - font-size: 90%; + float: right; + font-size: 90%; } /* REFERENCE MAIN TABLE OF CONTENT */ @media (prefers-color-scheme: light) { -div.main-toc { border-color: #999; } + div.main-toc { + border-color: #999; + } } + @media (prefers-color-scheme: dark) { -div.main-toc { border-color: #888; } + div.main-toc { + border-color: var(--nord3); + } } + div.main-toc { - column-count: 4; - column-width: 13em; - border-style: solid; - border-width: 1px; - padding: 5px; - margin-bottom: 10px; + columns: 13em 4; + border-style: solid; + border-width: 1px; + padding: 5px; + margin-bottom: 10px; } -.rubric -{ - margin-top: 5px; - margin-bottom: 5px; - font-size: 120%; - font-weight: bold; +.rubric { + margin-top: 5px; + margin-bottom: 5px; + font-size: 120%; + font-weight: bold; } - /* TABLE OF CONTENT */ @media (prefers-color-scheme: light) { -#table-of-contents { - background-color: white; - border-color: #a1c5d6; -} + #table-of-contents { + background-color: white; + border-color: #a1c5d6; + } } + @media (prefers-color-scheme: dark) { -#table-of-contents { - background-color: black; - border-color: #76c; -} -} -#table-of-contents { - margin-left: 20px; - padding: 0.8em; - border-style: solid; - border-width: 1px; - position: relative; - z-index: 1; + #table-of-contents { + background-color: var(--nord1); + border-color: var(--nord10); + } } -@media screen and (min-width: 500px) { #table-of-contents { - width: 15em; - float: right; - clear: right; -} + margin-left: 20px; + padding: 0.8em; + border-style: solid; + border-width: 1px; + position: relative; + z-index: 1; +} + +@media screen and (width >= 500px) { + #table-of-contents { + width: 15em; + float: right; + clear: right; + } } #table-of-contents p { - font-size: 140%; - font-weight: bold; - padding-bottom: 0.5em; - margin: 0; + font-size: 140%; + font-weight: bold; + padding-bottom: 0.5em; + margin: 0; } #table-of-contents ul { - margin: 0; - padding: 0 0 0 0.8em; - list-style: square; - text-align: left; - line-height: 1.5em; + margin: 0; + padding: 0 0 0 0.8em; + list-style: square; + text-align: left; + line-height: 1.5em; } -@media screen and (max-width: 319px) { -#table-of-contents ul { - list-style-type: none; - padding-inline-start: 0px; -} +@media screen and (width <= 319px) { + #table-of-contents ul { + list-style-type: none; + padding-inline-start: 0; + } } #table-of-contents a.reference { - border: none; - font-weight: bold; + border: none; + font-weight: bold; } #table-of-contents li li a.reference { - font-weight: normal; - padding: 0; + font-weight: normal; + padding: 0; } - /* CODE BLOCKS */ @media (prefers-color-scheme: light) { -pre { - background: #f6f6f6; - border-color: #bbb; -} + pre { + background: #f6f6f6; + border-color: #bbb; + } } + @media (prefers-color-scheme: dark) { -pre { - background: #222; - border-color: #666; -} + pre { + background: var(--nord2); + border-color: var(--nord1); + } } + pre { - font-family: monospace; - padding: 5px 10px 5px 10px; - border-style: solid; - border-width: 1px; - margin: 1em 0; + font-family: monospace; + padding: 5px 10px; + border-style: solid; + border-width: 1px; + margin: 1em 0; } - /* SYNTAX HIGHLIGHTING */ -.keyword { font-weight: bold } +.keyword { + font-weight: bold; +} @media (prefers-color-scheme: light) { -.string { color: #771; } -.comment { font-style: italic; color: #559; } -.preproc { font-style: italic; color: #959; } -.number { color: #595; } + .string { + color: #771; + } + + .comment { + font-style: italic; + color: #559; + } + + .preproc { + font-style: italic; + color: #959; + } + + .number { + color: #595; + } } + @media (prefers-color-scheme: dark) { -.string { color: #ff6; } -.comment { font-style: italic; color: #99f; } -.preproc { font-style: italic; color: #f7f; } -.number { color: #7f7; } + .string { + color: var(--nord14); + } + + .comment { + font-style: italic; + color: var(--nord10); + } + + .preproc { + font-style: italic; + color: var(--nord10); + } + + .number { + color: var(--nord15); + } } /* ALERT BOXES */ @media (prefers-color-scheme: light) { -div.warning, div.note, div.important { - background: #f1fff5; - border-color: #d1dfd5; -} -div.warning { - background: #fffdca; - border-color: #dddd80; -} -div.note .admonition-title { border-bottom-color: #d1dfd5; } -div.warning .admonition-title { border-bottom-color: #dddd80; } + div.warning, + div.note, + div.important { + background: #f1fff5; + border-color: #d1dfd5; + } + + div.warning { + background: #fffdca; + border-color: #dddd80; + } + + div.note .admonition-title { + border-bottom-color: #d1dfd5; + } + + div.warning .admonition-title { + border-bottom-color: #dddd80; + } } + @media (prefers-color-scheme: dark) { -div.warning, div.note, div.important { - background: #0f3a0f; - border-color: #5d9e5d; -} -div.warning { - background: #666507; - border-color: #dbd818; -} -div.warning .admonition-title { border-bottom-color: #dbd818; } -div.note .admonition-title { border-bottom-color: #5d9e5d; } + div.note, + div.important { + background: #0f3a0f; + border-color: #5d9e5d; + } + + div.warning { + background: #666507; + border-color: #dbd818; + } + + div.warning .admonition-title { + border-bottom-color: #dbd818; + } + + div.note .admonition-title { + border-bottom-color: #5d9e5d; + } } -div.warning, div.note, div.important { - width: 80%; - margin: 1.5em auto; - border-style: solid; - border-width: 1px; - padding: 5px 10px 5px 10px; + +div.warning, +div.note, +div.important { + width: 80%; + margin: 1.5em auto; + border-style: solid; + border-width: 1px; + padding: 5px 10px; } div.warning { - border-style: solid; - border-width: 1px; + border-style: solid; + border-width: 1px; } p.admonition-title { - font-size: 128%; - letter-spacing: 2px; - text-transform: uppercase; - margin: 0 0 0.5em 0; - border-bottom-style: solid; - border-bottom-width: 1px; + font-size: 128%; + letter-spacing: 2px; + text-transform: uppercase; + margin: 0 0 0.5em; + border-bottom-style: solid; + border-bottom-width: 1px; } - diff --git a/docs/tuning.rst b/docs/tuning.rst index 5eefe4891c2..757e4b0efde 100644 --- a/docs/tuning.rst +++ b/docs/tuning.rst @@ -48,7 +48,7 @@ session_stats_header_alert that will be posted on startup containing the column for all metrics. Logging this line will greatly simplify interpreting the output, and is required for the script to work out-of-the-box. -The python scrip in ``tools/parse_session_stats.py`` can parse the resulting +The python script in ``tools/parse_session_stats.py`` can parse the resulting file and produce graphs of relevant stats. It requires gnuplot_. .. _gnuplot: http://www.gnuplot.info @@ -332,7 +332,7 @@ contributions ============= If you have added instrumentation for some part of libtorrent that is not -covered here, or if you have improved any of the parser scrips, please consider +covered here, or if you have improved any of the parser scripts, please consider contributing it back to the project. If you have run tests and found that some algorithm or default value in diff --git a/docs/upgrade_to_1.2.rst b/docs/upgrade_to_1.2.rst index 0f894957417..c36a118d171 100644 --- a/docs/upgrade_to_1.2.rst +++ b/docs/upgrade_to_1.2.rst @@ -124,7 +124,7 @@ For example, the following expressions are deprecated:: atp.flags = 0; -Insted say:: +Instead say:: if (!(atp.flags & torrent_flags::paused)) diff --git a/examples/connection_tester.cpp b/examples/connection_tester.cpp index 2dfa278d6fd..032df0611e9 100644 --- a/examples/connection_tester.cpp +++ b/examples/connection_tester.cpp @@ -81,7 +81,7 @@ void generate_block(span buffer, piece_index_t const piece // in order to circumvent the restricton of only // one connection per IP that most clients implement // all sockets created by this tester are bound to -// uniqe local IPs in the range (127.0.0.1 - 127.255.255.255) +// unique local IPs in the range (127.0.0.1 - 127.255.255.255) // it's only enabled if the target is also on the loopback int local_if_counter = 0; bool local_bind = false; diff --git a/examples/torrent_view.cpp b/examples/torrent_view.cpp index 68ee1689660..38ace62ae83 100644 --- a/examples/torrent_view.cpp +++ b/examples/torrent_view.cpp @@ -443,8 +443,8 @@ void torrent_view::print_torrent(lt::torrent_status const& s, bool selected) std::array str; lt::span dest(str); - // the active torrent is highligted in the list - // this inverses the forground and background colors + // the active torrent is highlighted in the list + // this inverses the foreground and background colors char const* selection = ""; if (selected) selection = "\x1b[1m\x1b[44m"; diff --git a/include/libtorrent/aux_/aligned_storage.hpp b/include/libtorrent/aux_/aligned_storage.hpp index 935317663f4..9f81fa069ac 100644 --- a/include/libtorrent/aux_/aligned_storage.hpp +++ b/include/libtorrent/aux_/aligned_storage.hpp @@ -38,9 +38,10 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { -#if defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) +#if __cplusplus >= 202302L || defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) // this is for backwards compatibility with not-quite C++11 compilers +// and for C++23 which deprecated std::aligned_storage template struct aligned_storage { diff --git a/include/libtorrent/aux_/aligned_union.hpp b/include/libtorrent/aux_/aligned_union.hpp index 012b95580e1..0864b08357b 100644 --- a/include/libtorrent/aux_/aligned_union.hpp +++ b/include/libtorrent/aux_/aligned_union.hpp @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { namespace aux { -#if defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) +#if __cplusplus >= 202302L || defined __GNUC__ && __GNUC__ < 5 && !defined(_LIBCPP_VERSION) constexpr std::size_t max(std::size_t a) { return a; } @@ -51,6 +51,7 @@ constexpr std::size_t max(std::size_t a, std::size_t b, Vals... v) { return max(a, max(b, v...)); } // this is for backwards compatibility with not-quite C++11 compilers +// and for C++23 which deprecated std::aligned_union template struct aligned_union { diff --git a/include/libtorrent/aux_/disable_warnings_push.hpp b/include/libtorrent/aux_/disable_warnings_push.hpp index 4ee039ec33f..6ef8303500e 100644 --- a/include/libtorrent/aux_/disable_warnings_push.hpp +++ b/include/libtorrent/aux_/disable_warnings_push.hpp @@ -63,6 +63,9 @@ POSSIBILITY OF SUCH DAMAGE. #if __GNUC__ >= 9 #pragma GCC diagnostic ignored "-Wdeprecated-copy" #endif +#if __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Woverflow" +#endif #endif #ifdef __clang__ diff --git a/include/libtorrent/aux_/export.hpp b/include/libtorrent/aux_/export.hpp index 18c69e95e52..77a744f9ae4 100644 --- a/include/libtorrent/aux_/export.hpp +++ b/include/libtorrent/aux_/export.hpp @@ -99,8 +99,11 @@ POSSIBILITY OF SUCH DAMAGE. # endif #endif +// clang on windows complain if you mark a symbol with visibility hidden that's +// already being exported with dllexport. It seems dllexport doesn't support +// omitting some members of an exported class #if !defined TORRENT_EXPORT_EXTRA \ - && ((defined __GNUC__ && __GNUC__ >= 4) || defined __clang__) + && ((defined __GNUC__ && __GNUC__ >= 4) || defined __clang__) && !defined _WIN32 # define TORRENT_UNEXPORT __attribute__((visibility("hidden"))) #else # define TORRENT_UNEXPORT diff --git a/include/libtorrent/aux_/io.hpp b/include/libtorrent/aux_/io.hpp index abd44a64224..0edcf0aab98 100644 --- a/include/libtorrent/aux_/io.hpp +++ b/include/libtorrent/aux_/io.hpp @@ -46,7 +46,7 @@ namespace libtorrent { namespace aux { // reads an integer from a byte stream // in big endian byte order and converts - // it to native endianess + // it to native endianness template inline typename std::enable_if::type read_impl(span& view, type) diff --git a/include/libtorrent/aux_/merkle.hpp b/include/libtorrent/aux_/merkle.hpp index 3605c830b71..c30553e4d94 100644 --- a/include/libtorrent/aux_/merkle.hpp +++ b/include/libtorrent/aux_/merkle.hpp @@ -152,7 +152,7 @@ namespace libtorrent { // layer that can be verified, and the root_index is the node that needs to // be known in (tree) to do so. The num_valid_leafs specifies how many of // the leafs that are actually *supposed* to be non-zero. Any leafs beyond - // thses are padding and expected to be zero. + // these are padding and expected to be zero. // The caller must validate the hash at root_index. TORRENT_EXTRA_EXPORT std::tuple merkle_find_known_subtree(span const tree diff --git a/include/libtorrent/aux_/merkle_tree.hpp b/include/libtorrent/aux_/merkle_tree.hpp index c1d6858ab32..3057d2aec5d 100644 --- a/include/libtorrent/aux_/merkle_tree.hpp +++ b/include/libtorrent/aux_/merkle_tree.hpp @@ -176,7 +176,7 @@ struct TORRENT_EXTRA_EXPORT merkle_tree aux::vector m_tree; // when the full tree is allocated, this has one bit for each block hash. a - // 1 means we have verified the block hash to be corret, otherwise the block + // 1 means we have verified the block hash to be correct, otherwise the block // hash may represent what's on disk, but we haven't been able to verify it // yet bitfield m_block_verified; diff --git a/include/libtorrent/aux_/resolver.hpp b/include/libtorrent/aux_/resolver.hpp index fda446527e1..8b1e2e7ab35 100644 --- a/include/libtorrent/aux_/resolver.hpp +++ b/include/libtorrent/aux_/resolver.hpp @@ -67,9 +67,6 @@ struct TORRENT_EXTRA_EXPORT resolver final : resolver_interface void on_lookup(error_code const& ec, tcp::resolver::results_type ips , std::string const& hostname); - void callback(resolver_interface::callback_t h - , error_code const& ec, std::vector
const& ips); - struct dns_cache_entry { time_point last_seen; @@ -99,7 +96,7 @@ struct TORRENT_EXTRA_EXPORT resolver final : resolver_interface time_duration m_timeout; // the callbacks to call when a host resolution completes. This allows to - // attach more callbacks if the same host is looked up mutliple times + // attach more callbacks if the same host is looked up multiple times std::multimap m_callbacks; }; diff --git a/include/libtorrent/aux_/resolver_interface.hpp b/include/libtorrent/aux_/resolver_interface.hpp index 891d8314587..9e3c988cc3b 100644 --- a/include/libtorrent/aux_/resolver_interface.hpp +++ b/include/libtorrent/aux_/resolver_interface.hpp @@ -53,7 +53,7 @@ struct TORRENT_EXTRA_EXPORT resolver_interface using callback_t = std::function const&)>; // this flag will make async_resolve() only use the cache and fail if we - // don't have a cache entry, regardless of how old it is. This is usefull + // don't have a cache entry, regardless of how old it is. This is useful // when completing the lookup quickly is more important than accuracy, // like on shutdown static constexpr resolver_flags cache_only = 0_bit; diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index 7df1f17ea2e..5bbad421ca0 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -6,6 +6,7 @@ Copyright (c) 2015-2020, Alden Torres Copyright (c) 2015, Thomas Copyright (c) 2016-2017, Pavel Pimenov Copyright (c) 2020, Paul-Louis Ageneau +Copyright (c) 2023, Joris Carrier All rights reserved. Redistribution and use in source and binary forms, with or without @@ -246,7 +247,7 @@ namespace aux { } // 0 is natpmp 1 is upnp - // the order of these arrays determines the priorty in + // the order of these arrays determines the priority in // which their ports will be announced to peers aux::array tcp_port_mapping; aux::array udp_port_mapping; @@ -349,7 +350,8 @@ namespace aux { plugins_all_idx = 0, // to store all plugins plugins_optimistic_unchoke_idx = 1, // optimistic_unchoke_feature plugins_tick_idx = 2, // tick_feature - plugins_dht_request_idx = 3 // dht_request_feature + plugins_dht_request_idx = 3, // dht_request_feature + plugins_unknown_torrent_idx = 4 // unknown_torrent_feature }; template @@ -1330,7 +1332,7 @@ namespace aux { #ifndef TORRENT_DISABLE_EXTENSIONS // this is a list to allow extensions to potentially remove themselves. - std::array>, 4> m_ses_extensions; + std::array>, 5> m_ses_extensions; #endif #if TORRENT_ABI_VERSION == 1 diff --git a/include/libtorrent/aux_/utp_stream.hpp b/include/libtorrent/aux_/utp_stream.hpp index e37ec32b6e0..f7ce9c869f5 100644 --- a/include/libtorrent/aux_/utp_stream.hpp +++ b/include/libtorrent/aux_/utp_stream.hpp @@ -527,7 +527,7 @@ struct TORRENT_EXTRA_EXPORT utp_stream } #if BOOST_VERSION >= 106600 - // Compatiblity with the async_wait method introduced in boost 1.66 + // Compatibility with the async_wait method introduced in boost 1.66 enum wait_type { wait_read, wait_write, wait_error }; diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index dd1157367eb..b995e99fc03 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -616,6 +616,12 @@ POSSIBILITY OF SUCH DAMAGE. #define __has_builtin(x) 0 // for non-clang compilers #endif +#ifdef __cpp_guaranteed_copy_elision +#define TORRENT_RVO(x) x +#else +#define TORRENT_RVO(x) std::move(x) +#endif + #if (TORRENT_HAS_SSE && defined __GNUC__) # define TORRENT_HAS_BUILTIN_CLZ 1 #elif (TORRENT_HAS_ARM && defined __GNUC__ && !defined __clang__) diff --git a/include/libtorrent/extensions.hpp b/include/libtorrent/extensions.hpp index 708c2edc4a4..8302b9d2896 100644 --- a/include/libtorrent/extensions.hpp +++ b/include/libtorrent/extensions.hpp @@ -211,6 +211,10 @@ TORRENT_VERSION_NAMESPACE_3 // called static constexpr feature_flags_t alert_feature = 4_bit; + // include this bit if your plugin needs to have on_unknown_torrent() + // called even if there is no active torrent in the session + static constexpr feature_flags_t unknown_torrent_feature = 5_bit; + // This function is expected to return a bitmask indicating which features // this plugin implements. Some callbacks on this object may not be called // unless the corresponding feature flag is returned here. Note that diff --git a/include/libtorrent/file_storage.hpp b/include/libtorrent/file_storage.hpp index d5c18be9fdf..80503973903 100644 --- a/include/libtorrent/file_storage.hpp +++ b/include/libtorrent/file_storage.hpp @@ -238,6 +238,21 @@ namespace aux { , std::int64_t((std::numeric_limits::max)() / 2) * default_block_size); static constexpr std::int64_t max_file_offset = (std::int64_t(1) << 48) - 1; + // we use a signed 32 bit integer for piece indices internally, but + // frequently need headroom for intermediate calculations, so we limit + // the number of pieces 1 bit below the maximum + static constexpr std::int32_t max_num_pieces = (std::int32_t(1) << 30) - 1; + + // limit the piece length at (2 ^ 30) to get a bit of headroom. We + // commonly compute the number of blocks per pieces by adding + // block_size - 1 before dividing by block_size. That would overflow with + // a piece size of 2 ^ 31. This limit is still an unreasonably large + // piece size anyway. + // The piece picker (currently) has a limit of no more than (2^15)-1 + // blocks per piece, which is more restrictive, at a block size of 16 + // kiB (0x4000). + static constexpr std::int32_t max_piece_size = ((1 << 15) - 1) * 0x4000; + // returns true if the piece length has been initialized // on the file_storage. This is typically taken as a proxy // of whether the file_storage as a whole is initialized or diff --git a/include/libtorrent/flags.hpp b/include/libtorrent/flags.hpp index 27e9ef9aaaf..9175d8f0808 100644 --- a/include/libtorrent/flags.hpp +++ b/include/libtorrent/flags.hpp @@ -46,7 +46,7 @@ struct bit_t int m_bit_idx; }; -constexpr bit_t operator "" _bit(unsigned long long int b) { return bit_t{static_cast(b)}; } +constexpr bit_t operator ""_bit(unsigned long long int b) { return bit_t{static_cast(b)}; } namespace flags { diff --git a/include/libtorrent/i2p_stream.hpp b/include/libtorrent/i2p_stream.hpp index ca0ec74ae5f..cc6c40a68f3 100644 --- a/include/libtorrent/i2p_stream.hpp +++ b/include/libtorrent/i2p_stream.hpp @@ -447,7 +447,8 @@ struct i2p_stream : proxy_base m_state = read_session_create_response; char cmd[400]; int size = std::snprintf(cmd, sizeof(cmd), - "SESSION CREATE STYLE=STREAM ID=%s DESTINATION=TRANSIENT SIGNATURE_TYPE=7 " + "SESSION CREATE STYLE=STREAM ID=%s " + "DESTINATION=TRANSIENT SIGNATURE_TYPE=7 i2cp.leaseSetEncType=4,0 " "inbound.quantity=%d outbound.quantity=%d inbound.length=%d outbound.length=%d\n", m_id, m_session_options.m_inbound_quantity, m_session_options.m_outbound_quantity, m_session_options.m_inbound_length, m_session_options.m_outbound_length); diff --git a/include/libtorrent/io.hpp b/include/libtorrent/io.hpp index 29b3676d2e0..7802e168ab8 100644 --- a/include/libtorrent/io.hpp +++ b/include/libtorrent/io.hpp @@ -49,7 +49,7 @@ namespace aux { // reads an integer from a byte stream // in big endian byte order and converts - // it to native endianess + // it to native endianness template inline T read_impl(InIt& start, type) { diff --git a/include/libtorrent/kademlia/refresh.hpp b/include/libtorrent/kademlia/refresh.hpp index 6f67473ca78..62e426c1d0b 100644 --- a/include/libtorrent/kademlia/refresh.hpp +++ b/include/libtorrent/kademlia/refresh.hpp @@ -61,7 +61,7 @@ class bootstrap : public get_peers }; -} // namesapce dht +} // namespace dht } // namespace libtorrent #endif // REFRESH_050324_HPP diff --git a/include/libtorrent/mmap_storage.hpp b/include/libtorrent/mmap_storage.hpp index 0e42b03973d..e9b6127ebbb 100644 --- a/include/libtorrent/mmap_storage.hpp +++ b/include/libtorrent/mmap_storage.hpp @@ -218,7 +218,7 @@ namespace aux { // serialized on a per-file basis. See github issue #3842 for details. // This array stores a mutex for each file in the storage object - // It must be aquired before calling CreateFileMapping or UnmapViewOfFile + // It must be acquired before calling CreateFileMapping or UnmapViewOfFile mutable std::shared_ptr m_file_open_unmap_lock; #endif diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 058734bc7a1..ce327a1b786 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -659,7 +659,7 @@ namespace aux { // returns the block currently being // downloaded. And the progress of that // block. If the peer isn't downloading - // a piece for the moment, implementors + // a piece for the moment, implementers // must return an object with the piece_index // value invalid (the default constructor). virtual piece_block_progress downloading_piece_progress() const; diff --git a/include/libtorrent/peer_list.hpp b/include/libtorrent/peer_list.hpp index 3fe0711bd5b..502919baac2 100644 --- a/include/libtorrent/peer_list.hpp +++ b/include/libtorrent/peer_list.hpp @@ -159,6 +159,7 @@ namespace libtorrent { #endif int num_peers() const { return int(m_peers.size()); } + int num_candidate_cache() const { return int(m_candidate_cache.size()); } using peers_t = aux::deque; using iterator = peers_t::iterator; diff --git a/include/libtorrent/piece_picker.hpp b/include/libtorrent/piece_picker.hpp index 8612e26bec3..c90158e5578 100644 --- a/include/libtorrent/piece_picker.hpp +++ b/include/libtorrent/piece_picker.hpp @@ -807,8 +807,8 @@ namespace libtorrent { // blocks covered by the pad bytes are not picked by the piece picker std::unordered_map m_pads_in_piece; - // when the adjecent_piece affinity is enabled, this contains the most - // recent "extents" of adjecent pieces that have been requested from + // when the adjacent_piece affinity is enabled, this contains the most + // recent "extents" of adjacent pieces that have been requested from // this is mutable because it's updated by functions to pick pieces, which // are const. That's an efficient place to update it, since it's being // traversed already. diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp index 0c533005505..e3a1f4d4767 100644 --- a/include/libtorrent/proxy_base.hpp +++ b/include/libtorrent/proxy_base.hpp @@ -125,7 +125,7 @@ struct proxy_base } #if BOOST_VERSION >= 106600 && !defined TORRENT_BUILD_SIMULATOR - // Compatiblity with the async_wait method introduced in boost 1.66 + // Compatibility with the async_wait method introduced in boost 1.66 static constexpr auto wait_read = tcp::socket::wait_read; static constexpr auto wait_write = tcp::socket::wait_write; diff --git a/include/libtorrent/socks5_stream.hpp b/include/libtorrent/socks5_stream.hpp index 5e8c11c6490..0459331e452 100644 --- a/include/libtorrent/socks5_stream.hpp +++ b/include/libtorrent/socks5_stream.hpp @@ -127,7 +127,7 @@ class socks5_stream : public proxy_base void set_dst_name(std::string const& host) { - // if this assert trips, set_dst_name() is called wth an IP address rather + // if this assert trips, set_dst_name() is called with an IP address rather // than a hostname. Instead, resolve the IP into an address and pass it to // async_connect instead TORRENT_ASSERT(!aux::is_ip_address(host)); diff --git a/include/libtorrent/storage_defs.hpp b/include/libtorrent/storage_defs.hpp index f4c5e3e6d1c..45a090f2854 100644 --- a/include/libtorrent/storage_defs.hpp +++ b/include/libtorrent/storage_defs.hpp @@ -1,5 +1,6 @@ /* +Copyright (c) 2023, Vladimir Golovnev Copyright (c) 2006-2007, 2009, 2013-2014, 2016-2020, 2022, Arvid Norberg Copyright (c) 2016, 2021, Alden Torres All rights reserved. @@ -110,7 +111,15 @@ namespace libtorrent { // if any file exist in the target, take those files instead // of the ones we may have in the source. - dont_replace + dont_replace, + + // don't move any source files, just forget about them + // and begin checking files at new save path + reset_save_path, + + // don't move any source files, just change save path + // and continue working without any checks + reset_save_path_unchecked }; #if TORRENT_ABI_VERSION == 1 diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 116d264a5a6..ecca52f34ea 100644 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -1023,7 +1023,7 @@ namespace libtorrent { // piece_failed is called when a piece fails the hash check // for failures detected with v2 hashes the failing blocks(s) // are specified in blocks - // *blocks must be sorted in acending order* + // *blocks must be sorted in ascending order* void piece_failed(piece_index_t index, std::vector blocks = std::vector()); // the peers in "peers" participated in sending a bad piece. If @@ -1436,7 +1436,7 @@ namespace libtorrent { // peers. This vector is ordered, to make lookups fast. // TODO: 3 factor out predictive pieces and all operations on it into a - // separate class (to use as memeber here instead) + // separate class (to use as member here instead) std::vector m_predictive_pieces; #endif diff --git a/include/libtorrent/version.hpp b/include/libtorrent/version.hpp index cc136f58125..914af9104d7 100644 --- a/include/libtorrent/version.hpp +++ b/include/libtorrent/version.hpp @@ -39,27 +39,27 @@ POSSIBILITY OF SUCH DAMAGE. #define LIBTORRENT_VERSION_MAJOR 2 #define LIBTORRENT_VERSION_MINOR 0 -#define LIBTORRENT_VERSION_TINY 9 +#define LIBTORRENT_VERSION_TINY 10 // the format of this version is: MMmmtt // M = Major version, m = minor version, t = tiny version #define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTORRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY) -#define LIBTORRENT_VERSION "2.0.9.0" -#define LIBTORRENT_REVISION "559e52ca3" +#define LIBTORRENT_VERSION "2.0.10.0" +#define LIBTORRENT_REVISION "dacf64c50" namespace libtorrent { // the major, minor and tiny versions of libtorrent constexpr int version_major = 2; constexpr int version_minor = 0; - constexpr int version_tiny = 9; + constexpr int version_tiny = 10; // the libtorrent version in string form - constexpr char const* version_str = "2.0.9.0"; + constexpr char const* version_str = "2.0.10.0"; // the git commit of this libtorrent version - constexpr std::uint64_t version_revision = 0x559e52ca3; + constexpr std::uint64_t version_revision = 0xdacf64c50; // returns the libtorrent version as string form in this format: // "..." diff --git a/pyproject.toml b/pyproject.toml index 689ba9cdcd1..a3b0b8c6955 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,75 +2,75 @@ requires-python = ">=3.7" [tool.cibuildwheel] -skip = "{pp*,cp311-*}" +skip = "{pp*,}" [tool.cibuildwheel.macos] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "brew install openssl", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "brew install openssl" ] test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] [tool.cibuildwheel.macos.environment] BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.80.0" -MACOSX_DEPLOYMENT_TARGET = "10.9" # required for full C++11 support +BOOST_VERSION = "1.81.0" +MACOSX_DEPLOYMENT_TARGET = "10.9" # required for full C++11 support PATH = "/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "yum install -y glibc-static", # needed for libutil.a and libdl.a - "./tools/cibuildwheel/setup_ccache_on_manylinux.sh", - "./tools/cibuildwheel/setup_openssl.sh", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "./tools/cibuildwheel/setup_ccache_on_manylinux.sh", + "./tools/cibuildwheel/setup_openssl.sh", + "yum install -y glibc-static" # needed for libutil.a and libdl.a ] before-test = "ccache -s" select = "*-manylinux_*" test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] -[tool.cibuildwheel.overrides.environment] # sub-table of previous block! +[tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.80.0" +BOOST_VERSION = "1.81.0" PATH = "/usr/local/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "apk add ccache openssl-dev openssl-libs-static", - "./tools/cibuildwheel/setup_openssl.sh", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "./tools/cibuildwheel/setup_openssl.sh", + "apk add ccache openssl-dev openssl-libs-static" ] before-test = "ccache -s" select = "*-musllinux_*" test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] -[tool.cibuildwheel.overrides.environment] # sub-table of previous block! +[tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" -BOOST_VERSION = "1.76.0" +BOOST_VERSION = "1.81.0" PATH = "/usr/lib/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress --x86 openssl'", # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", + "bash -c 'choco install --no-progress --x86 openssl'" # choco only allows EITHER 32 OR 64-bit version of a package ] select = "*-win32" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress openssl'", # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", + "bash -c 'choco install --no-progress openssl'" # choco only allows EITHER 32 OR 64-bit version of a package ] select = "*-win_amd64" @@ -80,7 +80,7 @@ test-command = '''bash -c "cd '{project}/bindings/python' && python test.py"''' [tool.cibuildwheel.windows.environment] BOOST_BUILD_PATH = 'c:/boost/tools/build' BOOST_ROOT = 'c:/boost' -BOOST_VERSION = "1.80.0" +BOOST_VERSION = "1.81.0" PATH = 'c:/boost;$PATH' [tool.isort] diff --git a/simulation/disk_io.hpp b/simulation/disk_io.hpp index 4e4911ebf49..9e37d13c835 100644 --- a/simulation/disk_io.hpp +++ b/simulation/disk_io.hpp @@ -100,7 +100,7 @@ struct test_disk std::unique_ptr operator()( lt::io_context& ioc, lt::settings_interface const&, lt::counters&); - // seek time in fron of every read and write + // seek time in front of every read and write lt::time_duration seek_time = lt::milliseconds(10); // hash time per block diff --git a/simulation/test_file_pool.cpp b/simulation/test_file_pool.cpp index 94a797babdb..dc7d641f92f 100644 --- a/simulation/test_file_pool.cpp +++ b/simulation/test_file_pool.cpp @@ -77,7 +77,7 @@ TORRENT_TEST(close_file_interval) } else if (ticks > 21) { - // the close file timer shuold have kicked in at 20 seconds + // the close file timer should have kicked in at 20 seconds // and closed the file TEST_EQUAL(file_status.size(), 0); } diff --git a/simulation/test_http_connection.cpp b/simulation/test_http_connection.cpp index 30fb0aa5bcf..69833e27db2 100644 --- a/simulation/test_http_connection.cpp +++ b/simulation/test_http_connection.cpp @@ -274,7 +274,7 @@ void run_suite(lt::aux::proxy_settings ps) { // this hostname will resolve to multiple IPs, all but one that we cannot // connect to and the second one where we'll get the test file response. Make - // sure the http_connection correcly tries the second IP if the first one + // sure the http_connection correctly tries the second IP if the first one // fails. run_test(ps, "http://try-next.com:8080/test_file", 1337, 200 , error_condition(), { 1, 1, 1}); diff --git a/simulation/test_socks5.cpp b/simulation/test_socks5.cpp index ad0adda0bbb..be99ab91e67 100644 --- a/simulation/test_socks5.cpp +++ b/simulation/test_socks5.cpp @@ -299,7 +299,7 @@ TORRENT_TEST(socks5_udp_retry) lt::session_proxy zombie; sim::asio::io_context proxy_ios{sim, addr("50.50.50.50") }; - // close UDP associate connectons prematurely + // close UDP associate connections prematurely sim::socks_server socks5(proxy_ios, 5555, 5, socks_flag::disconnect_udp_associate); lt::settings_pack pack = settings(); diff --git a/simulation/test_swarm.cpp b/simulation/test_swarm.cpp index 73a290c4346..814dcc4df9d 100644 --- a/simulation/test_swarm.cpp +++ b/simulation/test_swarm.cpp @@ -478,7 +478,7 @@ struct nat_config : sim::default_config sim::route outgoing_route(lt::address ip) override { - // This is extremely simplistic. It will simply alter the percieved source + // This is extremely simplistic. It will simply alter the perceived source // IP of the connecting client. sim::route r; if (ip == addr("50.0.0.1")) r.append(m_nat_hop); diff --git a/simulation/test_timeout.cpp b/simulation/test_timeout.cpp index 5305a159268..5affa5ea93f 100644 --- a/simulation/test_timeout.cpp +++ b/simulation/test_timeout.cpp @@ -241,7 +241,7 @@ disconnects_t test_no_interest_timeout(int const num_peers } // if a peer is not interested in us, and we're not interested in it for long -// enoguh, we disconenct it, but only if we are close to peer connection capacity +// enough, we disconnect it, but only if we are close to peer connection capacity TORRENT_TEST(no_interest_timeout) { // with 10 peers, we're close enough to the connection limit to enable diff --git a/simulation/test_torrent_status.cpp b/simulation/test_torrent_status.cpp index b4296e561c9..77c37f59a8b 100644 --- a/simulation/test_torrent_status.cpp +++ b/simulation/test_torrent_status.cpp @@ -128,7 +128,7 @@ TORRENT_TEST(status_timers_last_upload) TEST_CHECK(!handle.is_valid()); handle = ta->handle; torrent_status st = handle.status(); - // test last upload and download state before wo go throgh + // test last upload and download state before we go through // torrent states TEST_CHECK(st.last_upload == time_point(seconds(0))); TEST_CHECK(st.last_download == time_point(seconds(0))); @@ -174,7 +174,7 @@ TORRENT_TEST(status_timers_time_shift_with_active_torrent) TEST_CHECK(!handle.is_valid()); handle = ta->handle; torrent_status st = handle.status(); - // test last upload and download state before wo go throgh + // test last upload and download state before we go through // torrent states TEST_CHECK(st.last_download == time_point(seconds(0))); TEST_CHECK(st.last_upload == time_point(seconds(0))); @@ -201,9 +201,9 @@ TORRENT_TEST(status_timers_time_shift_with_active_torrent) break; case 64000: // resume just before we hit the time shift handling - // this is needed to test what happend if we want to + // this is needed to test what happens if we want to // shift more time then we have active time because - // we shift 4 hours and have less then 1 hours active time + // we shift 4 hours and have less then 1 hour active time handle.resume(); tick_is_in_active_range = true; // don't check every tick @@ -253,7 +253,7 @@ TORRENT_TEST(finish_time_shift_active) TEST_CHECK(!handle.is_valid()); handle = ta->handle; torrent_status st = handle.status(); - // test last upload and download state before wo go throgh + // test last upload and download state before we go through // torrent states TEST_CHECK(st.last_download == time_point(seconds(0))); TEST_CHECK(st.last_upload == time_point(seconds(0))); @@ -325,7 +325,7 @@ TORRENT_TEST(finish_time_shift_paused) TEST_CHECK(!handle.is_valid()); handle = ta->handle; torrent_status st = handle.status(); - // test last upload and download state before wo go throgh + // test last upload and download state before we go through // torrent states TEST_CHECK(st.last_upload == time_point(seconds(0))); TEST_CHECK(st.last_download == time_point(seconds(0))); diff --git a/simulation/test_utp.cpp b/simulation/test_utp.cpp index 5f991d0f10b..4780fed0ef1 100644 --- a/simulation/test_utp.cpp +++ b/simulation/test_utp.cpp @@ -110,7 +110,7 @@ std::vector utp_test(sim::configuration& cfg, int send_buffer_size } // TODO: 3 simulate non-congestive packet loss -// TODO: 3 simulate unpredictible latencies +// TODO: 3 simulate unpredictable latencies // TODO: 3 simulate proper (taildrop) queues (perhaps even RED and BLUE) // The counters checked by these tests are proxies for the expected behavior. If diff --git a/src/alert.cpp b/src/alert.cpp index a848899ecb2..e0853ea9b3a 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -2579,7 +2579,7 @@ namespace { for (int i = 0; i < m_v6_num_peers; i++) peers.push_back(aux::read_v6_endpoint(v6_ptr)); - return std::move(peers); + return TORRENT_RVO(peers); } dht_direct_response_alert::dht_direct_response_alert( @@ -2819,7 +2819,7 @@ namespace { nodes.emplace_back(ih, aux::read_v6_endpoint(v6_ptr)); } - return std::move(nodes); + return TORRENT_RVO(nodes); } } @@ -2931,7 +2931,7 @@ namespace { char const* ptr = m_alloc.get().ptr(m_samples_idx); std::memcpy(samples.data(), ptr, samples.size() * 20); - return std::move(samples); + return TORRENT_RVO(samples); } int dht_sample_infohashes_alert::num_nodes() const diff --git a/src/bdecode.cpp b/src/bdecode.cpp index f8aeca26e3d..0deec874a83 100644 --- a/src/bdecode.cpp +++ b/src/bdecode.cpp @@ -150,7 +150,7 @@ namespace aux { - // reads the string between start and end, or up to the first occurrance of + // reads the string between start and end, or up to the first occurrence of // 'delimiter', whichever comes first. This string is interpreted as an // integer which is assigned to 'val'. If there's a non-delimiter and // non-digit in the range, a parse error is reported in 'ec'. If the value diff --git a/src/choker.cpp b/src/choker.cpp index cc204fc13b9..297ec1653eb 100644 --- a/src/choker.cpp +++ b/src/choker.cpp @@ -70,7 +70,7 @@ namespace { int const cmp = compare_peers(lhs, rhs); if (cmp != 0) return cmp > 0; - // when seeding, rotate which peer is unchoked in a round-robin fasion + // when seeding, rotate which peer is unchoked in a round-robin fashion // the amount uploaded since unchoked (not just in the last round) std::int64_t const u1 = lhs->uploaded_since_unchoked(); diff --git a/src/enum_net.cpp b/src/enum_net.cpp index 4ae73cf0389..22e9088435b 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -299,7 +299,7 @@ namespace { if (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0) return -1; - // get the socket's port ID so that we can verify it in the repsonse + // get the socket's port ID so that we can verify it in the response sockaddr_nl sock_addr; socklen_t sock_addr_len = sizeof(sock_addr); if (::getsockname(sock, reinterpret_cast(&sock_addr), &sock_addr_len) < 0) diff --git a/src/file_storage.cpp b/src/file_storage.cpp index 36f181b8b3b..37dd153f996 100644 --- a/src/file_storage.cpp +++ b/src/file_storage.cpp @@ -1226,7 +1226,7 @@ namespace { TORRENT_ASSERT(piece_length() >= 16 * 1024); // use this vector to track the new ordering of files - // this allows the use of STL algorthims despite them + // this allows the use of STL algorithms despite them // not supporting a custom swap functor aux::vector new_order(end_file()); for (auto i : file_range()) @@ -1246,7 +1246,7 @@ namespace { std::sort(new_order.begin(), new_order.end() , [this](file_index_t l, file_index_t r) { - // assuming m_paths are unqiue! + // assuming m_paths are unique! auto const& lf = m_files[l]; auto const& rf = m_files[r]; if (lf.path_index != rf.path_index) diff --git a/src/file_view_pool.cpp b/src/file_view_pool.cpp index 8fc550357b7..b56d33fb3a6 100644 --- a/src/file_view_pool.cpp +++ b/src/file_view_pool.cpp @@ -277,7 +277,7 @@ namespace libtorrent { namespace aux { } catch (storage_error& se) { - // opening the file failed. If it was becase the directory was + // opening the file failed. If it was because the directory was // missing, create it and try again. Otherwise, propagate the // error if (!(m & open_mode::write) diff --git a/src/gzip.cpp b/src/gzip.cpp index c09087d167a..9757dd7fe6d 100644 --- a/src/gzip.cpp +++ b/src/gzip.cpp @@ -128,7 +128,7 @@ namespace { int const method = buffer[2]; int const flags = buffer[3]; - // check for reserved flag and make sure it's compressed with the correct metod + // check for reserved flag and make sure it's compressed with the correct method // we only support deflate if (method != 8 || (flags & FRESERVED) != 0) return -1; diff --git a/src/ip_notifier.cpp b/src/ip_notifier.cpp index 15a05836552..1cf08d922c5 100644 --- a/src/ip_notifier.cpp +++ b/src/ip_notifier.cpp @@ -124,8 +124,8 @@ struct ip_change_notifier_impl final : ip_change_notifier void async_wait(std::function cb) override { - post(m_ios, [cb]() - { cb(make_error_code(boost::system::errc::not_supported)); }); + post(m_ios, [cb1=std::move(cb)]() + { cb1(make_error_code(boost::system::errc::not_supported)); }); } void cancel() override {} @@ -153,10 +153,10 @@ struct ip_change_notifier_impl final : ip_change_notifier void async_wait(std::function cb) override { m_socket.async_receive(boost::asio::buffer(m_buf) - , [cb=std::move(cb), this] (error_code const& ec, std::size_t const bytes_transferred) + , [cb1=std::move(cb), this] (error_code const& ec, std::size_t const bytes_transferred) { - if (ec) cb(ec); - else this->on_notify(int(bytes_transferred), std::move(cb)); + if (ec) cb1(ec); + else this->on_notify(int(bytes_transferred), std::move(cb1)); }); } @@ -172,7 +172,7 @@ struct ip_change_notifier_impl final : ip_change_notifier int family; std::array data; }; - // maps if_index to the most recently advertized local address + // maps if_index to the most recently advertised local address // this is used to filter duplicate updates std::unordered_map m_state; @@ -216,10 +216,10 @@ struct ip_change_notifier_impl final : ip_change_notifier if (!pertinent) { m_socket.async_receive(boost::asio::buffer(m_buf) - , [cb=std::move(cb), this] (error_code const& ec, std::size_t const bytes_transferred) + , [cb1=std::move(cb), this] (error_code const& ec, std::size_t const bytes_transferred) { - if (ec) cb(ec); - else this->on_notify(int(bytes_transferred), std::move(cb)); + if (ec) cb1(ec); + else this->on_notify(int(bytes_transferred), std::move(cb1)); }); } else diff --git a/src/kademlia/node_id.cpp b/src/kademlia/node_id.cpp index d255ca288f5..0b153d49ff3 100644 --- a/src/kademlia/node_id.cpp +++ b/src/kademlia/node_id.cpp @@ -207,7 +207,14 @@ node_id generate_prefix_mask(int const bits) TORRENT_ASSERT(bits <= 160); node_id mask; std::size_t b = 0; +#if defined __GNUC__ && __GNUC__ == 12 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif for (; int(b) < bits - 7; b += 8) mask[b / 8] |= 0xff; +#if defined __GNUC__ && __GNUC__ == 12 +#pragma GCC diagnostic pop +#endif if (bits < 160) mask[b / 8] |= (0xff << (8 - (bits & 7))) & 0xff; return mask; } diff --git a/src/merkle_tree.cpp b/src/merkle_tree.cpp index 0fc8afe41d1..ccf9bc68a4f 100644 --- a/src/merkle_tree.cpp +++ b/src/merkle_tree.cpp @@ -159,7 +159,7 @@ namespace { TORRENT_ASSERT(first_piece < int(mask.size())); TORRENT_ASSERT(end_piece <= int(mask.size())); - // if the mask convers all pieces, and nothing below that layer, go + // if the mask covers all pieces, and nothing below that layer, go // straight to piece_layer mode and validate if (std::all_of(mask.begin() + first_piece, mask.begin() + end_piece, identity()) diff --git a/src/mmap_disk_io.cpp b/src/mmap_disk_io.cpp index 9cc6600dd20..7e9ddb5352d 100644 --- a/src/mmap_disk_io.cpp +++ b/src/mmap_disk_io.cpp @@ -1021,7 +1021,7 @@ TORRENT_EXPORT std::unique_ptr mmap_disk_io_constructor( // TODO: Perhaps the job queue could be traversed and all jobs for this // piece could be cancelled. If there are no threads currently writing - // to this piece, we could skip the fence alltogether + // to this piece, we could skip the fence altogether add_fence_job(j); } diff --git a/src/pe_crypto.cpp b/src/pe_crypto.cpp index 9bb5e0eca7e..b05abea7880 100644 --- a/src/pe_crypto.cpp +++ b/src/pe_crypto.cpp @@ -73,7 +73,14 @@ namespace libtorrent { if (end < begin + 96) { int const len = int(end - begin); +#if defined __GNUC__ && __GNUC__ == 12 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif std::memmove(begin + 96 - len, begin, aux::numeric_cast(len)); +#if defined __GNUC__ && __GNUC__ == 12 +#pragma GCC diagnostic pop +#endif std::memset(begin, 0, aux::numeric_cast(96 - len)); } return ret; diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 839e196eb08..c37a5e95ba3 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -5523,7 +5523,7 @@ namespace libtorrent { { case set_block_hash_result::block_hash_failed: // If the hash failed immediately at the leaf layer it means that - // the chuck hash is known so this peer definately sent bad data. + // the chuck hash is known so this peer definitely sent bad data. t->piece_failed(r.piece, std::vector{r.start / default_block_size}); TORRENT_ASSERT(m_disconnecting); return; diff --git a/src/peer_list.cpp b/src/peer_list.cpp index 2fbc4ddf509..1786a2b5308 100644 --- a/src/peer_list.cpp +++ b/src/peer_list.cpp @@ -161,7 +161,9 @@ namespace libtorrent { for (auto const p : m_peers) m_peer_allocator.free_peer_entry(p); m_peers.clear(); + m_candidate_cache.clear(); m_num_connect_candidates = 0; + m_num_seeds = 0; } peer_list::~peer_list() @@ -466,7 +468,7 @@ namespace libtorrent { const bool was_conn_cand = is_connect_candidate(*p); p->connection = c; - // now that we're connected, no need to assume ther peer is a seed + // now that we're connected, no need to assume the peer is a seed // anymore. We'll soon know. p->maybe_upload_only = false; if (was_conn_cand) update_connect_candidates(-1); diff --git a/src/piece_picker.cpp b/src/piece_picker.cpp index 0b172146c1b..fb8819db435 100644 --- a/src/piece_picker.cpp +++ b/src/piece_picker.cpp @@ -3113,7 +3113,7 @@ namespace { void piece_picker::record_downloading_piece(piece_index_t const p) { // if a single piece is large enough, don't bother with the affinity of - // adjecent pieces. + // adjacent pieces. if (blocks_per_piece() >= max_piece_affinity_extent) return; piece_extent_t const this_extent = extent_for(p); @@ -3137,7 +3137,7 @@ namespace { // if at least one piece in this extent has a different priority than // the one we just started downloading, don't create an affinity for - // adjecent pieces. This probably means the pieces belong to different + // adjacent pieces. This probably means the pieces belong to different // files, or that some other mechanism determining the priority should // take precedence. if (piece_priority(piece) != this_prio) return; @@ -3153,7 +3153,7 @@ namespace { // limit the number of extent affinities active at any given time to limit // the cost of checking them. Also, don't replace them, commit to - // finishing them before starting another extent. This is analoguous to + // finishing them before starting another extent. This is analogous to // limiting the number of partial pieces. } @@ -3191,12 +3191,12 @@ namespace { if (prio >= 0 && !m_dirty) update(prio, p.index); // if the piece extent affinity is enabled, (maybe) record downloading a - // block from this piece to make other peers prefer adjecent pieces + // block from this piece to make other peers prefer adjacent pieces // if reverse is set, don't encourage other peers to pick nearby // pieces, as that's assumed to be low priority. // if time critical mode is enabled, we're likely to either download // adjacent pieces anyway, but more importantly, we don't want to - // create artificially higher priority for adjecent pieces if they + // create artificially higher priority for adjacent pieces if they // aren't important or urgent if (options & piece_extent_affinity) record_downloading_piece(block.piece_index); diff --git a/src/posix_storage.cpp b/src/posix_storage.cpp index 4ce84cf7720..cfed5daae2f 100644 --- a/src/posix_storage.cpp +++ b/src/posix_storage.cpp @@ -61,6 +61,7 @@ namespace aux { posix_storage::posix_storage(storage_params const& p) : m_files(p.files) , m_save_path(p.path) + , m_file_priority(p.priorities) , m_part_file_name("." + to_hex(p.info_hash) + ".parts") { if (p.mapped_files) m_mapped_files.reset(new file_storage(*p.mapped_files)); diff --git a/src/puff.cpp b/src/puff.cpp index d100416d8eb..14fd66a242b 100644 --- a/src/puff.cpp +++ b/src/puff.cpp @@ -628,7 +628,7 @@ local int fixed(struct state *s) * are themselves compressed using Huffman codes and run-length encoding. In * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means * that length, and the symbols 16, 17, and 18 are run-length instructions. - * Each of 16, 17, and 18 are follwed by extra bits to define the length of + * Each of 16, 17, and 18 are followed by extra bits to define the length of * the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10 * zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols * are common, hence the special coding for zero lengths. diff --git a/src/read_resume_data.cpp b/src/read_resume_data.cpp index eff654a9d65..9f6e626beaa 100644 --- a/src/read_resume_data.cpp +++ b/src/read_resume_data.cpp @@ -145,6 +145,10 @@ namespace { ret.ti->internal_set_comment(rd.dict_find_string_value("comment", "")); } } + else + { + ec = errors::mismatching_info_hash; + } } #if TORRENT_ABI_VERSION < 3 diff --git a/src/resolver.cpp b/src/resolver.cpp index 33096ad5273..d61ad3ef7f0 100644 --- a/src/resolver.cpp +++ b/src/resolver.cpp @@ -50,7 +50,8 @@ namespace aux { , m_timeout(seconds(1200)) {} - void resolver::callback(resolver_interface::callback_t h +namespace { + void callback(resolver_interface::callback_t h , error_code const& ec, std::vector
const& ips) { try { @@ -59,6 +60,7 @@ namespace aux { TORRENT_ASSERT_FAIL(); } } +} void resolver::on_lookup(error_code const& ec, tcp::resolver::results_type ips , std::string const& hostname) @@ -134,7 +136,7 @@ namespace aux { address const ip = make_address(host, ec); if (!ec) { - post(m_ios, [this, h, ec, ip]{ callback(h, ec, std::vector
{ip}); }); + post(m_ios, [h, ec, ip]{ callback(h, ec, std::vector
{ip}); }); return; } ec.clear(); @@ -147,7 +149,7 @@ namespace aux { || i->second.last_seen + m_timeout >= time_now()) { std::vector
ips = i->second.addresses; - post(m_ios, [this, h, ec, ips] { callback(h, ec, ips); }); + post(m_ios, [h, ec, ips] { callback(h, ec, ips); }); return; } } @@ -160,7 +162,7 @@ namespace aux { || k->second.last_seen + m_timeout >= time_now()) { error_code error_code = k->second.error; - post(m_ios, [this, h, error_code] { callback(h, error_code, {}); }); + post(m_ios, [h, error_code] { callback(h, error_code, {}); }); return; } } @@ -168,7 +170,7 @@ namespace aux { if (flags & resolver_interface::cache_only) { // we did not find a cache entry, fail the lookup - post(m_ios, [this, h] { + post(m_ios, [h] { callback(h, boost::asio::error::host_not_found, std::vector
{}); }); return; diff --git a/src/session.cpp b/src/session.cpp index e0428bfa255..db43896ae8c 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -53,6 +53,7 @@ namespace libtorrent { constexpr feature_flags_t plugin::tick_feature; constexpr feature_flags_t plugin::dht_request_feature; constexpr feature_flags_t plugin::alert_feature; + constexpr feature_flags_t plugin::unknown_torrent_feature; #endif namespace aux { diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 9b6bf96af44..b1efa6d1e3e 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -17,6 +17,7 @@ Copyright (c) 2020, Fonic Copyright (c) 2020, Paul-Louis Ageneau Copyright (c) 2022, Vladimir Golovnev (glassez) Copyright (c) 2022, thrnz +Copyright (c) 2023, Joris Carrier All rights reserved. Redistribution and use in source and binary forms, with or without @@ -992,6 +993,8 @@ bool ssl_server_name_callback(ssl::stream_handle_type stream_handle, std::string m_ses_extensions[plugins_tick_idx].push_back(ext); if (features & plugin::dht_request_feature) m_ses_extensions[plugins_dht_request_idx].push_back(ext); + if (features & plugin::unknown_torrent_feature) + m_ses_extensions[plugins_unknown_torrent_idx].push_back(ext); if (features & plugin::alert_feature) m_alerts.add_extension(ext); session_handle h(shared_from_this()); @@ -2613,7 +2616,7 @@ namespace { span const buf = packet.data; if (!packet.hostname.empty()) { - // only the tracker manager supports receiveing UDP packets + // only the tracker manager supports receiving UDP packets // from hostnames. If it won't handle it, no one else will // either m_tracker_manager.incoming_packet(packet.hostname, buf); @@ -3084,9 +3087,15 @@ namespace { return; } + bool want_on_unknown_torrent = false; +#ifndef TORRENT_DISABLE_EXTENSIONS + want_on_unknown_torrent = !m_ses_extensions[plugins_unknown_torrent_idx].empty(); +#endif + // check if we have any active torrents + // or if there is an extension that wants on_unknown_torrent // if we don't reject the connection - if (m_torrents.empty()) + if (m_torrents.empty() && !want_on_unknown_torrent) { #ifndef TORRENT_DISABLE_LOGGING session_log("<== INCOMING CONNECTION [ rejected, there are no torrents ]"); @@ -3138,9 +3147,10 @@ namespace { // if we don't have any active torrents, there's no // point in accepting this connection. If, however, // the setting to start up queued torrents when they - // get an incoming connection is enabled, we cannot + // get an incoming connection is enabled or if there is + // an extension that wants on_unknown_torrent, we cannot // perform this check. - if (!m_settings.get_bool(settings_pack::incoming_starts_queued_torrents)) + if (!m_settings.get_bool(settings_pack::incoming_starts_queued_torrents) && !want_on_unknown_torrent) { bool has_active_torrent = std::any_of(m_torrents.begin(), m_torrents.end() , [](std::shared_ptr const& i) @@ -3736,7 +3746,7 @@ namespace { // has reached its local limit for (auto const& t : m_torrents) { - // ths disconnect logic is disabled for torrents with + // this disconnect logic is disabled for torrents with // too low connection limit int const max = std::min(t->max_connections() , std::numeric_limits::max() / 100); @@ -5697,8 +5707,11 @@ namespace { listen_socket->external_address.cast_vote(external_ip, source_router, address()); } - if (proto == portmap_protocol::tcp) listen_socket->tcp_port_mapping[transport].port = port; - else if (proto == portmap_protocol::udp) listen_socket->udp_port_mapping[transport].port = port; + // need to check whether this mapping is for one of session ports (it could also be a user mapping) + if ((proto == portmap_protocol::tcp) && (listen_socket->tcp_port_mapping[transport].mapping == mapping)) + listen_socket->tcp_port_mapping[transport].port = port; + else if ((proto == portmap_protocol::udp) && (listen_socket->udp_port_mapping[transport].mapping == mapping)) + listen_socket->udp_port_mapping[transport].port = port; if (!ec && m_alerts.should_post()) { @@ -6597,7 +6610,7 @@ namespace { } ADD_OUTSTANDING_ASYNC("session_impl::on_dht_announce"); - int delay = std::max(m_settings.get_int(settings_pack::dht_announce_interval) + int delay = std::max(1000 * m_settings.get_int(settings_pack::dht_announce_interval) / std::max(int(m_torrents.size()), 1), 1); if (!m_dht_torrents.empty()) @@ -6605,10 +6618,10 @@ namespace { // we have prioritized torrents that need // an initial DHT announce. Don't wait too long // until we announce those. - delay = std::min(4, delay); + delay = std::min(4000, delay); } - m_dht_announce_timer.expires_after(seconds(delay)); + m_dht_announce_timer.expires_after(milliseconds(delay)); m_dht_announce_timer.async_wait([this](error_code const& e) { wrap(&session_impl::on_dht_announce, e); }); #endif diff --git a/src/session_stats.cpp b/src/session_stats.cpp index bbc179ce61c..d31125b2bac 100644 --- a/src/session_stats.cpp +++ b/src/session_stats.cpp @@ -520,7 +520,7 @@ namespace { // the buffer sizes accepted by // socket send and receive calls respectively. // The larger the buffers are, the more efficient, - // because it reqire fewer system calls per byte. + // because it require fewer system calls per byte. // The size is 1 << n, where n is the number // at the end of the counter name. i.e. // 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, @@ -584,7 +584,7 @@ namespace { stats[i].type = metrics[i].value_index >= counters::num_stats_counters ? metric_type_t::gauge : metric_type_t::counter; } - return std::move(stats); + return TORRENT_RVO(stats); } int find_metric_idx(string_view name) diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index bf368e3587a..6d401c8389b 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -148,7 +148,7 @@ constexpr int DISK_WRITE_MODE = settings_pack::enable_os_cache; SET(proxy_username, "", &session_impl::update_proxy), SET(proxy_password, "", &session_impl::update_proxy), SET(i2p_hostname, "", &session_impl::update_i2p_bridge), - SET(peer_fingerprint, "-LT2090-", nullptr), + SET(peer_fingerprint, "-LT20A0-", nullptr), SET(dht_bootstrap_nodes, "dht.libtorrent.org:25401", &session_impl::update_dht_bootstrap_nodes) }}); diff --git a/src/sha1.cpp b/src/sha1.cpp index ec314b93328..78424ab6624 100644 --- a/src/sha1.cpp +++ b/src/sha1.cpp @@ -205,8 +205,8 @@ void SHA1_update(sha1_ctx* context, u8 const* data, size_t len) #elif BOOST_ENDIAN_LITTLE_BYTE internal_update(context, data, len); #else - // select different functions depending on endianess - // and figure out the endianess runtime + // select different functions depending on endianness + // and figure out the endianness runtime if (is_big_endian()) internal_update(context, data, len); else @@ -307,9 +307,9 @@ By Arvid Norberg 2- uses C99 types with size guarantees from boost 3- if none of BOOST_BIG_ENDIAN or BOOST_LITTLE_ENDIAN - are defined, endianess is determined + are defined, endianness is determined at runtime. templates are used to duplicate - the transform function for each endianess + the transform function for each endianness 4- using anonymous namespace to avoid external linkage on internal functions 5- using standard C++ includes diff --git a/src/ssl.cpp b/src/ssl.cpp index 489701750f7..3aaf3f11798 100644 --- a/src/ssl.cpp +++ b/src/ssl.cpp @@ -100,6 +100,8 @@ void set_server_name_callback(context_handle_type c, server_name_callback_type c #if defined __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wold-style-cast" +#pragma clang diagnostic ignored "-Wcast-function-type-strict" +#pragma clang diagnostic ignored "-Wunknown-warning-option" #endif SSL_CTX_set_tlsext_servername_callback(c, cb); SSL_CTX_set_tlsext_servername_arg(c, arg); diff --git a/src/storage_utils.cpp b/src/storage_utils.cpp index 239ab256aa4..bef1219ce3e 100644 --- a/src/storage_utils.cpp +++ b/src/storage_utils.cpp @@ -1,5 +1,6 @@ /* +Copyright (c) 2023, Vladimir Golovnev Copyright (c) 2016-2022, Arvid Norberg Copyright (c) 2017-2018, Alden Torres Copyright (c) 2017-2018, Steven Siloti @@ -199,6 +200,12 @@ namespace libtorrent { namespace aux { } } + if (flags == move_flags_t::reset_save_path) + return { status_t::need_full_check, new_save_path }; + + if (flags == move_flags_t::reset_save_path_unchecked) + return { status_t::no_error, new_save_path }; + // indices of all files we ended up copying. These need to be deleted // later aux::vector copied_files(std::size_t(f.num_files()), false); diff --git a/src/time.cpp b/src/time.cpp index e58d52b323f..23ea3928b3d 100644 --- a/src/time.cpp +++ b/src/time.cpp @@ -39,7 +39,7 @@ namespace libtorrent { namespace aux { time_point time_now() { return clock_type::now(); } time_point32 time_now32() { return time_point_cast(clock_type::now()); } - // for simplying implementation + // for simplifying implementation using std::chrono::system_clock; diff --git a/src/torrent.cpp b/src/torrent.cpp index e99dfc63318..5bf07c221a1 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2440,9 +2440,9 @@ bool is_downloading_state(int const st) span v2_span(hashes); m_ses.disk_thread().async_hash(m_storage, m_checking_piece, v2_span, flags - , [self = shared_from_this(), hashes = std::move(hashes)] + , [self = shared_from_this(), hashes1 = std::move(hashes)] (piece_index_t p, sha1_hash const& h, storage_error const& error) mutable - { self->on_piece_hashed(std::move(hashes), p, h, error); }); + { self->on_piece_hashed(std::move(hashes1), p, h, error); }); ++m_checking_piece; if (m_checking_piece >= m_torrent_file->end_piece()) break; } @@ -7205,7 +7205,7 @@ namespace { ret.verified_leaf_hashes.reserve(num_files); for (auto const& t : m_merkle_trees) { - // use stuctured binding in C++17 + // use structured binding in C++17 aux::vector mask; std::vector sparse_tree; std::tie(sparse_tree, mask) = t.build_sparse_vector(); @@ -9088,7 +9088,7 @@ namespace { void torrent::set_max_uploads(int limit, bool const state_update) { TORRENT_ASSERT(is_single_thread()); - // TODO: perhaps 0 should actially mean 0 + // TODO: perhaps 0 should actually mean 0 if (limit <= 0) limit = (1 << 24) - 1; if (int(m_max_uploads) == limit) return; if (state_update) state_updated(); @@ -9105,7 +9105,7 @@ namespace { void torrent::set_max_connections(int limit, bool const state_update) { TORRENT_ASSERT(is_single_thread()); - // TODO: perhaps 0 should actially mean 0 + // TODO: perhaps 0 should actually mean 0 if (limit <= 0) limit = (1 << 24) - 1; if (int(m_max_connections) == limit) return; if (state_update) state_updated(); @@ -10366,7 +10366,6 @@ namespace { int num_peers = 0; int num_downloaders = 0; int missing_pieces = 0; - int num_interested = 0; for (auto const p : m_connections) { TORRENT_INCREMENT(m_iterating_connections); @@ -10382,8 +10381,6 @@ namespace { if (p->share_mode()) continue; if (p->upload_only()) continue; - if (p->is_peer_interested()) ++num_interested; - ++num_downloaders; missing_pieces += pieces_in_torrent - p->num_have_pieces(); } @@ -11335,9 +11332,9 @@ namespace { span v2_span(hashes); m_ses.disk_thread().async_hash(m_storage, piece, v2_span, flags - , [self = shared_from_this(), hashes = std::move(hashes)] + , [self = shared_from_this(), hashes1 = std::move(hashes)] (piece_index_t p, sha1_hash const& h, storage_error const& error) mutable - { self->on_piece_verified(std::move(hashes), p, h, error); }); + { self->on_piece_verified(std::move(hashes1), p, h, error); }); m_picker->started_hash_job(piece); m_ses.deferred_submit_jobs(); } diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp index 6f7415128f8..c255e7a7282 100644 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -484,7 +484,7 @@ namespace libtorrent { { aux::vector ret; sync_call(&torrent::file_progress, std::ref(ret), flags); - return std::move(ret); + return TORRENT_RVO(ret); } void torrent_handle::post_file_progress(file_progress_flags_t const flags) const @@ -542,7 +542,7 @@ namespace libtorrent { aux::vector ret; auto retp = &ret; sync_call(&torrent::piece_priorities, retp); - return std::move(ret); + return TORRENT_RVO(ret); } #if TORRENT_ABI_VERSION == 1 @@ -598,7 +598,7 @@ namespace libtorrent { aux::vector ret; auto retp = &ret; sync_call(&torrent::file_priorities, retp); - return std::move(ret); + return TORRENT_RVO(ret); } #if TORRENT_ABI_VERSION == 1 diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index d64387a59bf..df1f7711ed8 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -377,7 +377,7 @@ namespace { // calculations of the size of the merkle tree (which is all 'int' // indices) if (file_size < 0 - || (file_size / default_block_size) >= std::numeric_limits::max() / 2 + || (file_size / default_block_size) >= file_storage::max_num_pieces || file_size > file_storage::max_file_size) { ec = errors::torrent_invalid_length; @@ -1162,12 +1162,7 @@ namespace { // extract piece length std::int64_t const piece_length = info.dict_find_int_value("piece length", -1); - // limit the piece length at INT_MAX / 2 to get a bit of headroom. We - // commonly compute the number of blocks per pieces by adding - // block_size - 1 before dividing by block_size. That would overflow with - // a piece size of INT_MAX. This limit is still an unreasonably large - // piece size anyway. - if (piece_length <= 0 || piece_length > std::numeric_limits::max() / 2) + if (piece_length <= 0 || piece_length > file_storage::max_piece_size) { ec = errors::torrent_missing_piece_length; return false; @@ -1319,8 +1314,7 @@ namespace { // we want this division to round upwards, that's why we have the // extra addition - if (files.total_size() / files.piece_length() >= - std::numeric_limits::max()) + if (files.total_size() / files.piece_length() > file_storage::max_num_pieces) { ec = errors::too_many_pieces_in_torrent; // mark the torrent as invalid diff --git a/src/torrent_peer.cpp b/src/torrent_peer.cpp index 9bf75e4a0e4..5cf72763025 100644 --- a/src/torrent_peer.cpp +++ b/src/torrent_peer.cpp @@ -85,10 +85,12 @@ namespace libtorrent { { if (e1.port() > e2.port()) swap(e1, e2); - std::uint32_t p; - auto ptr = reinterpret_cast(&p); + std::array buf; + auto ptr = buf.data(); aux::write_uint16(e1.port(), ptr); aux::write_uint16(e2.port(), ptr); + std::uint32_t p; + std::memcpy(&p, buf.data(), 4); ret = crc32c_32(p); } else if (aux::is_v6(e1)) diff --git a/src/ut_metadata.cpp b/src/ut_metadata.cpp index 25b351e0160..205b9521753 100644 --- a/src/ut_metadata.cpp +++ b/src/ut_metadata.cpp @@ -76,7 +76,7 @@ namespace { send_buffer_limit = 0x4000 * 10, // this is the max number of requests we'll queue - // up. If we get more requests tha this, we'll + // up. If we get more requests than this, we'll // start rejecting them, claiming we don't have // metadata. If the torrent is greater than 16 MiB, // we may hit this case (and the client requesting diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index f55e4e22510..2adfe4c4451 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -259,7 +259,7 @@ void utp_socket_impl::update_mtu_limits() m_mtu_ceiling = m_mtu_floor; // the path MTU may have changed. Perform another search - // dont' start all the way from start, just half way down. + // don't start all the way from start, just half way down. m_mtu_floor = ((TORRENT_INET_MIN_MTU - TORRENT_IPV4_HEADER - TORRENT_UDP_HEADER) + m_mtu_ceiling) / 2; UTP_LOGV("%8p: reducing MTU floor\n", static_cast(this)); @@ -1983,7 +1983,9 @@ bool utp_socket_impl::resend_packet(packet* p, bool fast_resend) // plus one since we have fast-resend as well, which doesn't // necessarily trigger by a timeout - TORRENT_ASSERT(p->num_transmissions < m_sm.num_resends() + 1); + // the fast-resend path does not check for too many resends, that's only in + // the time-out path + TORRENT_ASSERT_VAL(fast_resend || p->num_transmissions < m_sm.num_resends() + 1, m_sm.num_resends()); TORRENT_ASSERT(p->size - p->header_size >= 0); if (p->need_resend) m_bytes_in_flight += p->size - p->header_size; @@ -2324,7 +2326,7 @@ bool utp_socket_impl::consume_incoming_data( // number of queued up bytes, waiting for the upper layer, // exceeds the advertised receive window, start ignoring // more data packets - UTP_LOG("%8p: ERROR: our advertized window is not honored. " + UTP_LOG("%8p: ERROR: our advertised window is not honored. " "recv_buf: %d buffered_in: %d max_size: %d\n" , static_cast(this), m_receive_buffer_size, m_buffered_incoming_bytes, m_receive_buffer_capacity); return false; @@ -3304,7 +3306,7 @@ void utp_socket_impl::do_ledbat(const int acked_bytes, const int delay { m_slow_start = false; m_ssthres = (m_cwnd >> 16); - UTP_LOGV("%8p: cwnd > advertized wnd (%u) slow_start -> 0\n" + UTP_LOGV("%8p: cwnd > advertised wnd (%u) slow_start -> 0\n" , static_cast(this), m_adv_wnd); } */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 26d58e6b0bd..22563c5d8c8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR) # Configurable policies: <= CMP0097 -# Our tests contain printf formating checks therefore we disable GCC format string errors: +# Our tests contain printf formatting checks therefore we disable GCC format string errors: if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") check_cxx_compiler_flag("-Wno-error=format-truncation" _WNO_ERROR_FORMAT_TRUNCATION) if (_WNO_ERROR_FORMAT_TRUNCATION) diff --git a/test/http_proxy.py b/test/http_proxy.py index 6e076958d3e..f80f57ed7a6 100755 --- a/test/http_proxy.py +++ b/test/http_proxy.py @@ -44,7 +44,7 @@ def read_to_end_of_chunks(file_like): """Reads a chunked-encoded stream from a file-like object. This will read up to the end of the chunked encoding, including chunk - delimeters, trailers, and the terminal empty line. + delimiters, trailers, and the terminal empty line. The stream will be returned as an iterator of bytes objects. The split between bytes objects is arbitrary. diff --git a/test/main.cpp b/test/main.cpp index 59c5fc69600..e10fd944542 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -53,7 +53,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #ifdef _WIN32 -#include "libtorrent/aux_/windows.hpp" // fot SetErrorMode +#include "libtorrent/aux_/windows.hpp" // for SetErrorMode #include // for _dup and _dup2 #include // for _getpid #include diff --git a/test/ssl/cert_request.pem b/test/ssl/cert_request.pem deleted file mode 100644 index b386c9a0894..00000000000 --- a/test/ssl/cert_request.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBsTCCARoCAQAwXDELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx -ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEVMBMGA1UEAwwMdGVz -dCB0b3JyZW50MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClM6eDsvQiXVj7 -ZCrWko+PmlJUMBzPjTbDvSfLfw8zGH3OjPJev1lf3JCPRAGu8CRVFLPZg2RZUfLi -9dITBThnTD2T9/5sHeNpxAU0JW7FPETHay+Q4B1abuYJ+nPmdLbdaiegQjJgoAcH -GlYi6YPNM5n5B8y9vA+k3DOFTAXnLwIDAQABoBUwEwYJKoZIhvcNAQkHMQYMBHRl -c3QwDQYJKoZIhvcNAQEFBQADgYEAJuhp3OEKPqYfF2pz/BooTU5cu/bcgy21M6IM -rEzQSIBO5bNxetK3VlVaclC+QlKMDN5efHw1PiAZPXGGD3BfZyNtf1xEH7urCDqy -McGog59bL/wOwUqGwq5iq18e05XPyrc6JgZUwjKLFu3lSP6FkW0z8c1dbLrMduL+ -M9dvHdk= ------END CERTIFICATE REQUEST----- diff --git a/test/ssl/dhparams.pem b/test/ssl/dhparams.pem index c2424ebbc98..e806efe47a4 100644 --- a/test/ssl/dhparams.pem +++ b/test/ssl/dhparams.pem @@ -1,13 +1,13 @@ -----BEGIN DH PARAMETERS----- -MIICCAKCAgEAgUUnkLfIClLl/0PxqGuLytphYV+h7Z8FroJqY5RQrKVH7dFFfLVT -IKDd75w3ShN/CBAIl/V6s7knqks6R0ll8QLUZYsWhyidvMFBKtZE0x+wsXkTtNhI -1MawUU7OdDQabZyOHxI0H6uCkmUCRB7RMkxk42jkDyNoF/8dHR2mysRT/n6bnW8M -Bsqm7cI4LdacPuFXNNkyWkp1WufPlVAZR7SfqA7BGANN5ECUZG6oJiL38GdPBfYo -gCW1FPVCZ47vDw7LsDUN3YT4KLRD873kTklX77utK6wCIQweQObe4uLd5/32xTDN -+9AlcjY85axPcMuNw1XhrlZnElNuyxuje+YdFtAaKsSfMC1rd5CYdxdCuRjiLG/q -KwxnzGrb8SMmZNF/PZpq4oY6nO6KAD492zs/82ygnR30XnKpGcoI55yD33ctCHPB -1xzzwzpy2LWJ4kDgQGPESEQZ2R0Nc11mpyimErOc7FBYujIl0wd12xvyOPSs4FH9 -6BlGvg1LQmZGVKt9ksIOBT8ThyKhtjuWr3/A47JFKkirEttMNdBE7J0BVu6ACtTD -99FgISicCUg0UYuR1PSWIyqiWxHlQ4fNUzpFD+/7O300Da3iAbON5KwqWZdPGAIz -DvMBPYZBEn1esL71R6gJQH4hzO9FMvTpNph/qI7F2quDGFK9K+YBhPcCAQI= +MIICCAKCAgEAusZ496/9z7kgXOTCwhmv+teCvMey0fPRxNBi9UdarAah5mU5i0O7 +2PVQ/WgrBpGTCNoN3mj8U4ZFUUrnyLTl5rEcyoICseZOefpCmKUMYQSDy18i0B0V +rRPTTrApfYmAmvapLAHIDaWVImnOccIg05Ou++C5qv+xnJv3zk6D+RiR/tahB035 +wZH1+EpP5fuZTw2RaOb5t/pojWhVACGIzH/xCcJWEOzSE1RQSk0MNx1ntRcwwvBY +hhLikp878h24iLNvbRuk4K/AwnwahpmHs8FkfEzC0NeLJIkN9j1O+jeLzhl6zNZm +cgplMe8A0FlF5ukqEBG9ON5VkWiR1Z4P0iMaTcxVHZ3rlGCs4AkBRlnaZ5vaZYHg +SMqSDaJ/KGEA/ioRMDBR8YG5rl2XZD/Ap105Z7/mVbdVmCtpAUGtSBXXprqp5XuL +wNFGiCOwuWmtenz+SNgQTpyK+GbpIZ980/wM/plakyywOw5sg0G0LSAJGe2Ktn/G +2qfCAk374cqvuT5WdF3TueQvTpDZlgeqGK3K/l9MSVh7pfxrGb9kOYOwQVKihX8L +PtyiBofaH54NjM9BJMmXcAk2PlQwL+UUDzOpPRZKnrgG38idNHIGoTSedPnv3x5m +QErBNFVyGHaWC+Fs3vrqtkoafPeNy4OXXyWQQo2bfwB02ubqUZzLT6cCAQI= -----END DH PARAMETERS----- diff --git a/test/ssl/invalid_peer_certificate.pem b/test/ssl/invalid_peer_certificate.pem index 72ec2238597..d852a1afd56 100644 --- a/test/ssl/invalid_peer_certificate.pem +++ b/test/ssl/invalid_peer_certificate.pem @@ -2,81 +2,78 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - 53:ec:a5:6d:e0:33:0b:3f:1b:64:64:9f:8c:a2:65:7e:c1:9b:c5:ca + 43:6f:28:43:34:d0:47:6c:74:fa:23:42:47:b0:af:13:73:0e:1b:13 Signature Algorithm: sha256WithRSAEncryption Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=test Validity - Not Before: Jun 12 13:35:50 2021 GMT - Not After : Jun 12 13:35:50 2022 GMT + Not Before: Jun 14 10:54:46 2022 GMT + Not After : Jun 14 10:54:46 2023 GMT Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=* Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) + Public-Key: (2048 bit) Modulus: - 00:d2:50:62:10:8e:4b:e9:fa:74:e7:53:97:ea:25: - b1:26:53:5a:ed:f6:a6:72:5e:9a:0f:8a:09:e2:b2: - dd:f9:bc:10:b1:de:9a:bd:e6:64:d9:0f:c1:b3:ed: - 42:d8:f7:9f:52:f6:49:38:1d:5d:f9:cc:8c:7e:c8: - ef:8e:f7:e8:e1:7c:9c:13:e1:32:72:a7:b9:df:68: - 1f:9d:88:82:09:4c:e0:7c:bb:9c:74:bf:9d:51:57: - f3:94:f8:80:d4:80:5f:ee:1c:98:a5:43:08:25:42: - b2:9b:1b:2a:2a:13:86:80:68:f8:ea:5d:d1:d7:50: - 9f:35:49:f9:9c:0b:a8:17:23:b1:b9:26:6c:32:00: - 82:3c:51:f2:bb:c6:1a:3d:5e:14:ce:1d:b4:b9:98: - cb:54:3a:21:f5:d1:40:75:c5:05:86:3b:ed:7e:87: - 79:ba:74:56:46:65:48:41:d0:9e:23:7b:dd:c7:b4: - c0:df:36:c8:01:03:b6:96:03:27:bd:6c:8e:64:33: - 5a:f8:dd:49:7f:c2:d1:d2:a8:c7:3f:5e:63:78:28: - 3b:d4:c4:87:fe:13:16:96:f4:89:81:c0:fc:98:8a: - 54:8a:14:21:7f:7b:21:fc:f5:c8:37:0e:94:6b:a2: - a5:53:7e:13:27:cf:6b:a5:0b:f8:f4:53:fa:5e:6d: - d3:25 + 00:cf:e5:ad:21:34:68:44:4c:ee:da:3e:ca:91:55: + e9:cf:fc:c9:04:bd:ff:25:47:e4:5e:72:76:a9:3c: + b0:76:48:d7:7d:f9:2c:80:31:d3:bf:36:86:cd:14: + 8f:bf:ff:10:3d:48:0f:4c:f2:5c:29:27:73:7b:c9: + fe:a1:2d:cd:45:16:9c:ea:ef:10:28:86:81:f0:5b: + db:19:a1:e0:45:ca:0e:c9:a9:dd:18:0d:1a:45:78: + 40:17:01:5a:e7:da:fb:31:38:94:6e:25:0a:70:0a: + 11:3d:91:e1:ea:f7:15:75:11:8b:5d:c3:51:d4:91: + ee:94:ab:0f:a5:a6:66:0e:10:30:bb:60:55:60:c2: + 51:80:b7:58:b2:80:96:bf:23:36:f6:8c:0c:8b:63: + 10:47:2f:7c:89:b2:c3:e3:4e:c2:72:74:85:ef:60: + 8c:ac:54:58:2c:bb:17:98:61:60:ad:43:38:a3:f3: + 22:2a:4c:a6:42:8e:c1:f9:1c:06:21:c7:24:bf:91: + 09:bf:64:87:ee:9d:17:aa:03:41:cd:b2:eb:4e:df: + f5:e8:6a:c6:96:b2:d3:a5:96:ab:16:4f:04:31:46: + 03:75:cd:4a:e9:e1:ee:e4:59:14:24:4e:dc:d7:95: + ef:4b:b8:03:2b:f5:d6:0f:72:8e:78:21:4b:9b:18: + 37:c7 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE - Netscape Comment: - OpenSSL Generated Certificate X509v3 Subject Key Identifier: - 2C:FE:68:9B:AD:6D:20:F5:37:62:AA:3C:FE:D8:70:94:47:75:87:1D + 9C:E1:70:C1:91:FA:A9:14:E3:C9:26:C6:DE:A4:84:8D:7A:E7:4C:B1 X509v3 Authority Key Identifier: - keyid:AA:B5:9C:D4:9C:C9:0C:A7:C8:55:0C:9E:98:EE:55:03:52:00:D9:08 - + 90:74:F2:7B:0D:0F:62:6C:DD:37:ED:A0:2B:AF:D7:3C:FC:EA:F3:9D Signature Algorithm: sha256WithRSAEncryption - 97:36:30:a3:b2:44:1f:d2:cc:27:64:22:85:31:9d:03:93:10: - 7b:bc:dc:05:76:49:aa:71:a1:70:11:2c:0d:63:6a:5f:0b:9e: - 3a:eb:f0:dc:d8:32:54:c5:13:3b:a0:76:b5:9b:f6:62:f7:1a: - 7b:b7:a4:2b:b4:0e:b3:f2:86:fa:22:94:ab:0f:34:2d:10:98: - 8a:62:c2:25:33:12:45:96:ae:e9:95:74:49:5b:86:5d:42:a5: - b7:b3:ca:e2:1d:9a:a5:81:09:ff:39:ee:fa:98:81:a7:ad:85: - 69:1a:ef:d1:73:15:04:b1:82:6e:8f:5b:5b:f7:03:16:0b:47: - df:a5:c6:78:26:c6:2a:09:09:3a:9b:8b:ee:2e:3e:14:f7:97: - 4d:af:1b:d0:8f:07:7c:e2:6b:5a:b5:d0:3b:cc:e6:8e:97:81: - 7b:eb:82:63:f5:cc:42:59:4b:47:ff:2b:ec:f8:0a:55:a5:b6: - 15:ba:1d:34:f5:59:11:dd:2a:13:72:b2:98:40:66:45:00:bf: - b3:65:17:6b:c2:15:ca:53:0a:01:26:c3:8f:09:cf:56:78:33: - 41:cc:2a:62:cd:38:9d:16:a3:ec:cf:f5:59:bf:5f:ab:2b:2a: - e6:12:f5:27:f5:30:9d:80:fb:20:4d:a6:f6:a5:6f:48:e9:59: - dc:8c:3c:72 + Signature Value: + 52:76:79:d7:ee:da:06:a9:1b:dd:6a:4b:66:01:e7:90:ce:14: + 70:21:b7:09:8b:83:43:7b:0a:17:53:7f:6b:f7:e7:74:71:3c: + 1b:1b:44:8f:21:c6:a4:4d:54:10:1d:13:89:a7:2e:d0:0a:91: + 03:01:9a:5b:bb:bd:61:27:a2:05:40:a0:0a:1b:02:71:dc:75: + f7:10:3d:00:c8:f7:15:77:fc:f6:83:99:de:4c:57:8c:81:0b: + 21:5a:43:03:bf:4e:a3:9d:c7:2a:58:6c:76:9e:14:b1:81:0f: + 8b:e2:a8:85:cd:3a:52:af:c0:4e:3c:87:1d:56:2e:14:c9:c0: + d2:ba:cd:df:e4:36:f5:41:55:b1:8e:4e:d7:f4:b7:8b:f6:62: + cc:31:3c:44:20:a6:cd:75:f8:0e:a1:88:5c:ea:04:94:6c:e9: + ee:f4:04:d9:49:31:78:51:90:1f:02:ee:05:73:28:e8:d0:cc: + a2:f0:65:1e:1a:df:08:89:1f:23:57:24:1b:ff:a1:0f:b6:8b: + d9:13:bd:6e:7a:00:c5:cf:56:2c:1a:28:e4:57:04:36:15:a2: + bb:eb:a9:35:f6:72:04:9b:45:cb:db:36:50:a7:9c:3f:28:24: + ce:53:29:3c:1b:fe:73:87:bb:87:ba:e3:ab:d7:46:91:cf:7e: + 32:ff:c0:a3 -----BEGIN CERTIFICATE----- -MIIDrjCCApagAwIBAgIUU+ylbeAzCz8bZGSfjKJlfsGbxcowDQYJKoZIhvcNAQEL +MIIDgDCCAmigAwIBAgIUQ28oQzTQR2x0+iNCR7CvE3MOGxMwDQYJKoZIhvcNAQEL BQAwVDELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDENMAsGA1UEAwwEdGVzdDAeFw0yMTA2 -MTIxMzM1NTBaFw0yMjA2MTIxMzM1NTBaMFExCzAJBgNVBAYTAkFVMRMwEQYDVQQI +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDENMAsGA1UEAwwEdGVzdDAeFw0yMjA2 +MTQxMDU0NDZaFw0yMzA2MTQxMDU0NDZaMFExCzAJBgNVBAYTAkFVMRMwEQYDVQQI DApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx -CjAIBgNVBAMMASowggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSUGIQ -jkvp+nTnU5fqJbEmU1rt9qZyXpoPignist35vBCx3pq95mTZD8Gz7ULY959S9kk4 -HV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7YFVgwlGAt1iygJa/Izb2jAyL +YxBHL3yJssPjTsJydIXvYIysVFgsuxeYYWCtQzij8yIqTKZCjsH5HAYhxyS/kQm/ +ZIfunReqA0HNsutO3/XoasaWstOllqsWTwQxRgN1zUrp4e7kWRQkTtzXle9LuAMr +9dYPco54IUubGDfHAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYDVR0OBBYEFJzhcMGR ++qkU48kmxt6khI1650yxMB8GA1UdIwQYMBaAFJB08nsND2Js3TftoCuv1zz86vOd +MA0GCSqGSIb3DQEBCwUAA4IBAQBSdnnX7toGqRvdaktmAeeQzhRwIbcJi4NDewoX +U39r9+d0cTwbG0SPIcakTVQQHROJpy7QCpEDAZpbu71hJ6IFQKAKGwJx3HX3ED0A +yPcVd/z2g5neTFeMgQshWkMDv06jnccqWGx2nhSxgQ+L4qiFzTpSr8BOPIcdVi4U +ycDSus3f5Db1QVWxjk7X9LeL9mLMMTxEIKbNdfgOoYhc6gSUbOnu9ATZSTF4UZAf +Au4Fcyjo0Myi8GUeGt8IiR8jVyQb/6EPtovZE71uegDFz1YsGijkVwQ2FaK766k1 +9nIEm0XL2zZQp5w/KCTOUyk8G/5zh7uHuuOr10aRz34y/8Cj -----END CERTIFICATE----- diff --git a/test/ssl/invalid_peer_private_key.pem b/test/ssl/invalid_peer_private_key.pem index 211b01077c3..e2395389307 100644 --- a/test/ssl/invalid_peer_private_key.pem +++ b/test/ssl/invalid_peer_private_key.pem @@ -1,30 +1,30 @@ -----BEGIN ENCRYPTED PRIVATE KEY----- -MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIbgK6pdYRqXECAggA -MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECAbZQRhGG/qyBIIEyCq9SEHTmnEk -OsaBZaeoHfjG8dzZY2axOELULAmDQdVzedp9rJqfuj42SkVs8MVfVY6Y6wprd1Ik -48uOSwFyLECsWhRpSheIjX5ae6WbQv0IefguqLm/CnaAJs1YBU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au +jnEgSRaRE3Hi3G9cTr48dI7k1CHxhTRKWLUUxSYbXCJ2QxWXbPjMjr/TN1ZeUrU1 +SIECgFXULAt+uyV9IKeViA== -----END ENCRYPTED PRIVATE KEY----- diff --git a/test/ssl/peer_certificate.pem b/test/ssl/peer_certificate.pem index d852a1afd56..15b4daa760f 100644 --- a/test/ssl/peer_certificate.pem +++ b/test/ssl/peer_certificate.pem @@ -2,78 +2,78 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - 43:6f:28:43:34:d0:47:6c:74:fa:23:42:47:b0:af:13:73:0e:1b:13 + 06:e7:e4:64:c9:d9:48:85:6e:8f:60:e2:28:e4:1b:6e:9c:0c:ea:53 Signature Algorithm: sha256WithRSAEncryption Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=test Validity - Not Before: Jun 14 10:54:46 2022 GMT - Not After : Jun 14 10:54:46 2023 GMT + Not Before: Feb 18 17:07:04 2024 GMT + Not After : Dec 2 17:07:04 2297 GMT Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=* Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:cf:e5:ad:21:34:68:44:4c:ee:da:3e:ca:91:55: - e9:cf:fc:c9:04:bd:ff:25:47:e4:5e:72:76:a9:3c: - b0:76:48:d7:7d:f9:2c:80:31:d3:bf:36:86:cd:14: - 8f:bf:ff:10:3d:48:0f:4c:f2:5c:29:27:73:7b:c9: - fe:a1:2d:cd:45:16:9c:ea:ef:10:28:86:81:f0:5b: - db:19:a1:e0:45:ca:0e:c9:a9:dd:18:0d:1a:45:78: - 40:17:01:5a:e7:da:fb:31:38:94:6e:25:0a:70:0a: - 11:3d:91:e1:ea:f7:15:75:11:8b:5d:c3:51:d4:91: - ee:94:ab:0f:a5:a6:66:0e:10:30:bb:60:55:60:c2: - 51:80:b7:58:b2:80:96:bf:23:36:f6:8c:0c:8b:63: - 10:47:2f:7c:89:b2:c3:e3:4e:c2:72:74:85:ef:60: - 8c:ac:54:58:2c:bb:17:98:61:60:ad:43:38:a3:f3: - 22:2a:4c:a6:42:8e:c1:f9:1c:06:21:c7:24:bf:91: - 09:bf:64:87:ee:9d:17:aa:03:41:cd:b2:eb:4e:df: - f5:e8:6a:c6:96:b2:d3:a5:96:ab:16:4f:04:31:46: - 03:75:cd:4a:e9:e1:ee:e4:59:14:24:4e:dc:d7:95: - ef:4b:b8:03:2b:f5:d6:0f:72:8e:78:21:4b:9b:18: - 37:c7 + 00:c6:51:76:70:d9:58:47:9e:63:e1:eb:3f:8a:ba: + 1b:c6:88:74:ec:83:24:07:3f:31:e8:d6:85:8f:c3: + f0:e0:25:a5:c2:56:c6:52:c2:f2:7f:78:ac:ea:60: + c2:15:63:75:c5:b9:94:b9:0e:3a:36:61:95:4c:70: + ae:4e:f7:bc:0a:64:5b:81:f8:b1:f4:1a:f4:f8:40: + db:68:b4:b3:d6:1c:e0:5a:66:c9:28:c2:f8:10:37: + 91:f3:97:8a:3c:75:d6:9a:5c:ea:2b:7d:e5:31:6b: + 7e:59:85:8e:ff:79:36:99:cd:eb:bd:89:e1:97:46: + 24:15:1f:09:2c:16:2d:23:5e:0e:dd:67:85:2d:2a: + dc:34:3d:6b:f7:16:f5:ad:4f:c9:3d:d4:98:90:5f: + 94:65:0f:f1:ed:d6:64:ba:d6:0e:d6:47:c0:4f:ac: + 87:ad:43:85:b8:35:43:74:45:ed:b9:c7:9b:49:2c: + 80:b5:ac:9b:d2:75:9e:54:7c:37:7b:25:da:66:24: + eb:3b:0c:60:f4:cb:a6:e5:42:67:2a:4b:98:68:6d: + 5f:ff:ac:34:c1:f1:f8:c8:d7:47:ea:f3:28:b3:6c: + 97:ee:22:17:83:4a:53:d6:32:45:f6:86:46:f6:41: + 75:10:87:f6:b0:d4:30:d5:90:c2:48:c4:f7:b7:a6: + 56:a9 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE X509v3 Subject Key Identifier: - 9C:E1:70:C1:91:FA:A9:14:E3:C9:26:C6:DE:A4:84:8D:7A:E7:4C:B1 + DA:BC:2B:AD:A5:5D:31:71:F5:15:15:8E:BF:6B:95:98:C3:63:54:91 X509v3 Authority Key Identifier: - 90:74:F2:7B:0D:0F:62:6C:DD:37:ED:A0:2B:AF:D7:3C:FC:EA:F3:9D + E8:2D:53:4D:3D:32:F9:74:EC:60:5A:D8:8D:7D:D2:A0:F1:71:4E:B1 Signature Algorithm: sha256WithRSAEncryption Signature Value: - 52:76:79:d7:ee:da:06:a9:1b:dd:6a:4b:66:01:e7:90:ce:14: - 70:21:b7:09:8b:83:43:7b:0a:17:53:7f:6b:f7:e7:74:71:3c: - 1b:1b:44:8f:21:c6:a4:4d:54:10:1d:13:89:a7:2e:d0:0a:91: - 03:01:9a:5b:bb:bd:61:27:a2:05:40:a0:0a:1b:02:71:dc:75: - f7:10:3d:00:c8:f7:15:77:fc:f6:83:99:de:4c:57:8c:81:0b: - 21:5a:43:03:bf:4e:a3:9d:c7:2a:58:6c:76:9e:14:b1:81:0f: - 8b:e2:a8:85:cd:3a:52:af:c0:4e:3c:87:1d:56:2e:14:c9:c0: - d2:ba:cd:df:e4:36:f5:41:55:b1:8e:4e:d7:f4:b7:8b:f6:62: - cc:31:3c:44:20:a6:cd:75:f8:0e:a1:88:5c:ea:04:94:6c:e9: - ee:f4:04:d9:49:31:78:51:90:1f:02:ee:05:73:28:e8:d0:cc: - a2:f0:65:1e:1a:df:08:89:1f:23:57:24:1b:ff:a1:0f:b6:8b: - d9:13:bd:6e:7a:00:c5:cf:56:2c:1a:28:e4:57:04:36:15:a2: - bb:eb:a9:35:f6:72:04:9b:45:cb:db:36:50:a7:9c:3f:28:24: - ce:53:29:3c:1b:fe:73:87:bb:87:ba:e3:ab:d7:46:91:cf:7e: - 32:ff:c0:a3 + 40:42:e1:34:e4:3f:e9:1c:7c:c0:9f:2a:10:94:15:7e:13:91: + 7a:bb:6a:95:62:32:7a:1a:9c:ee:73:3f:f0:64:5c:95:b6:a7: + 33:7f:e0:3c:0a:51:d2:39:f3:0a:29:23:d3:3d:ab:df:3c:64: + fe:92:16:b0:b5:ff:85:af:ff:41:5d:50:0f:9b:d9:ee:3d:b9: + 3e:81:ad:98:07:d0:fe:3a:b4:9e:61:8b:4a:ad:db:3a:24:85: + 9c:93:61:bc:b2:6f:8b:e5:e1:8b:83:8a:f0:10:b8:6d:cd:a6: + 7b:8d:06:1e:12:11:b9:ae:cf:69:b4:0c:e1:7a:34:bd:87:70: + 19:f2:0d:76:bc:28:b3:1f:ce:64:b4:c8:d7:e0:fe:54:01:eb: + e6:3a:ae:4e:63:1b:08:64:74:5a:38:f9:b2:a5:64:8e:98:c2: + a4:51:cf:89:85:2a:db:79:97:5a:23:5c:d8:27:2c:a3:d7:ae: + 24:f9:27:cb:5a:a3:5a:59:70:ab:13:46:02:8e:e7:ed:b2:ea: + 5f:ef:28:cb:a2:73:10:4d:87:be:2e:68:09:89:42:dc:1b:17: + f6:73:da:1a:41:3d:76:3d:fa:af:b2:8a:b4:8b:50:f9:98:46: + 68:ee:3c:ac:e9:60:9b:bc:26:8d:ef:b0:88:d3:89:ae:3e:c4: + 44:42:5e:7e -----BEGIN CERTIFICATE----- -MIIDgDCCAmigAwIBAgIUQ28oQzTQR2x0+iNCR7CvE3MOGxMwDQYJKoZIhvcNAQEL +MIIDgjCCAmqgAwIBAgIUBufkZMnZSIVuj2DiKOQbbpwM6lMwDQYJKoZIhvcNAQEL BQAwVDELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDENMAsGA1UEAwwEdGVzdDAeFw0yMjA2 -MTQxMDU0NDZaFw0yMzA2MTQxMDU0NDZaMFExCzAJBgNVBAYTAkFVMRMwEQYDVQQI -DApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQx -CjAIBgNVBAMMASowggEiMA0GCSqG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BKjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMZR +dnDZWEeeY+HrP4q6G8aIdOyDJAc/MejWhY/D8OAlpcJWxlLC8n94rOpgwhVjdcW5 +lLkOOjZhlUxwrk73vApkW4H4sfQa9PhA22i0s9Yc4FpmySjC+BA3kfOXijx11ppc +6it95TFrflmFjv95NpnN672J4ZdGJBUfCSwWLSNeDt1nhS0q3DQ9a/cW9a1PyT3U +mJBflGUP8e3WZLrWDtZHwE+sh61Dhbg1Q3RF7bnHm0ksgLWsm9J1nlR8N3sl2mYk +6zsMYPTLpuVCZypLmGhtX/+sNMHx+MjXR+rzKLNsl+4iF4NKU9YyRfaGRvZBdRCH +9rDUMNWQwkjE97emVqkCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNVHQ4EFgQU2rwr +raVdMXH1FRWOv2uVmMNjVJEwHwYDVR0jBBgwFoAU6C1TTT0y+XTsYFrYjX3SoPFx +TrEwDQYJKoZIhvcNAQELBQADggEBAEBC4TTkP+kcfMCfKhCUFX4TkXq7apViMnoa +nO5zP/BkXJW2pzN/4DwKUdI58wopI9M9q988ZP6SFrC1/4Wv/0FdUA+b2e49uT6B +rZgH0P46tJ5hi0qt2zokhZyTYbyyb4vl4YuDivAQuG3NpnuNBh4SEbmuz2m0DOF6 +NL2HcBnyDXa8KLMfzmS0yNfg/lQB6+Y6rk5jGwhkdFo4+bKlZI6YwqRRz4mFKtt5 +l1ojXNgnLKPXriT5J8tao1pZcKsTRgKO5+2y6l/vKMuicxBNh74uaAmJQtwbF/Zz +2hpBPXY9+q+yirSLUPmYRmjuPKzpYJu8Jo3vsIjTia4+xERCXn4= -----END CERTIFICATE----- diff --git a/test/ssl/peer_private_key.pem b/test/ssl/peer_private_key.pem index e2395389307..4c5fb0db45e 100644 --- a/test/ssl/peer_private_key.pem +++ b/test/ssl/peer_private_key.pem @@ -1,30 +1,30 @@ -----BEGIN ENCRYPTED PRIVATE KEY----- -MIIFHDBOBgkqhkiG9w0BB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My/2EKpsbu4MdrPQP/yEABbEilgImdQzRoXbf +w/3duG3mc6njd0hcx77Ry4uqiVVyjkX6SSC0sczD6uzVpYjM5ne0uVws4Xhr4d1Q +GcyH2XEJ8tyCWL3Tf1z8RPr7Ion7qZ/r353CKCq1GKUccccG5jdtRAycsOm+QFvi +usx3lmHiXeH0wapWLvzU5VEYbK6dybgsg1YJfO6oNKyk9m01QWYgelyqN8VL+ZbM +M/YnwZVvVr/72mRxZulVx85d9GozGN5fD8tX7WyWta5Z8SdLlfwdl1ER0lEW5URa +Tsc86Gg3p6K/lJBJUJOhWQ== -----END ENCRYPTED PRIVATE KEY----- diff --git a/test/ssl/regenerate_test_certificate.sh b/test/ssl/regenerate_test_certificate.sh index c0cc8652404..ea1329fe874 100755 --- a/test/ssl/regenerate_test_certificate.sh +++ b/test/ssl/regenerate_test_certificate.sh @@ -2,34 +2,32 @@ set -e -cp peer_certificate.pem invalid_peer_certificate.pem -cp peer_private_key.pem invalid_peer_private_key.pem - printf "\n\n ======== \e[33muse common name: * \e[0m=========\n\n" -openssl req -newkey rsa:4096 -nodes -keyout server_key.pem -x509 -days 1097 -out server_cert.pem +openssl req -newkey rsa:4096 -nodes -keyout server_key.pem -x509 -days 99999 -out server_cert.pem cat server_key.pem server_cert.pem >server.pem -PATH=/opt/homebrew/Cellar/openssl@3/3.0.3/bin:/opt/homebrew/etc/openssl@1.1/misc:$PATH:/usr/local/etc/openssl/misc:/usr/lib/ssl/misc - rm -rf demoCA +mkdir demoCA +mkdir demoCA/private +mkdir demoCA/newcerts +touch demoCA/index.txt -printf "\n\n ======== \e[33muse passphrase: \"test\" \e[0m=========\n\n" printf "\n\n ======== \e[33muse common name: \"test\" \e[0m=========\n\n" -CA.pl -newca -extra-cmd rsa:4096 +openssl req -new -keyout ./demoCA/private/cakey.pem -out ./demoCA/careq.pem -passout pass:test +openssl ca -create_serial -out ./demoCA/cacert.pem -days 99999 -batch -keyfile ./demoCA/private/cakey.pem -selfsign -extensions v3_ca -passin pass:test -infiles ./demoCA/careq.pem cp ./demoCA/cacert.pem root_ca_cert.pem cp ./demoCA/private/cakey.pem root_ca_private.pem -printf "\n\n ======== \e[33muse passphrase: \"test\" \e[0m=========\n\n" printf "\n\n ======== \e[33muse common name: * \e[0m=========\n\n" -CA.pl -newreq -extra-cmd rsa:4096 +openssl req -new -keyout newkey.pem -out newreq.pem -passin pass:test -passout pass:test cp newkey.pem peer_private_key.pem -CA.pl -sign +openssl ca -policy policy_anything -out newcert.pem -days 99999 -passin pass:test -infiles newreq.pem cp newcert.pem peer_certificate.pem diff --git a/test/ssl/root_ca_cert.pem b/test/ssl/root_ca_cert.pem index b7291cc933d..fe13f09246a 100644 --- a/test/ssl/root_ca_cert.pem +++ b/test/ssl/root_ca_cert.pem @@ -2,78 +2,78 @@ Certificate: Data: Version: 3 (0x2) Serial Number: - 43:6f:28:43:34:d0:47:6c:74:fa:23:42:47:b0:af:13:73:0e:1b:12 + 06:e7:e4:64:c9:d9:48:85:6e:8f:60:e2:28:e4:1b:6e:9c:0c:ea:52 Signature Algorithm: sha256WithRSAEncryption Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=test Validity - Not Before: Jun 14 10:54:23 2022 GMT - Not After : Jun 13 10:54:23 2025 GMT + Not Before: Feb 18 17:06:58 2024 GMT + Not After : Dec 2 17:06:58 2297 GMT Subject: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd, CN=test Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: - 00:a9:c4:bc:dc:b0:0a:53:09:e3:4b:85:1d:37:6f: - 16:73:93:3f:74:ca:45:2d:bd:f8:93:c9:f3:fe:a2: - 1f:b3:f9:e8:1a:ab:43:03:5a:5d:14:8b:ea:8f:1a: - 5f:d7:56:0a:2c:15:0a:c9:70:54:23:8b:d3:68:4e: - f5:3b:be:48:06:0f:c4:68:9d:ba:53:bb:72:1e:f0: - 92:c5:80:4f:e5:14:8a:12:38:4e:69:e3:65:99:d4: - f4:69:2d:f9:86:f5:07:8f:3b:9c:d7:11:26:96:e7: - 19:9b:98:80:1c:74:96:6b:1f:69:fc:34:bd:f5:58: - 4c:68:d0:78:86:47:a4:a7:48:02:88:3c:31:55:c1: - e5:cf:97:3f:55:d8:f1:d0:85:e0:86:f4:a7:86:bb: - 99:16:7e:bc:ba:db:b7:49:08:be:c1:05:d2:5d:46: - 28:ee:66:c9:42:82:5f:4d:0e:3d:18:c9:2a:02:17: - 4f:30:01:12:19:f0:0b:45:c6:df:0e:6b:62:23:d8: - c5:28:4a:84:33:29:13:0b:3b:20:d5:98:d5:08:cb: - bb:0f:c3:f4:cb:d9:30:b3:40:0a:1c:c8:a9:45:1f: - 5d:3a:93:38:8e:80:04:54:f8:ef:98:53:6c:86:b1: - bf:6a:1a:53:c1:b1:40:f5:2e:30:f4:3d:4c:e5:19: - b6:13 + 00:aa:3b:15:49:5d:1f:12:73:17:ec:f8:e1:35:2c: + f1:72:c7:b8:0a:68:43:44:0c:43:e0:dc:ea:cb:60: + 28:0b:00:6d:f9:4c:a1:90:8b:95:9d:50:87:9d:a9: + 3f:30:3f:e5:58:4e:7c:34:03:4e:ae:16:6f:d3:44: + 21:1f:39:25:b1:7b:88:b6:30:64:47:b8:5c:cd:da: + de:b0:5d:67:2b:8a:45:12:63:9b:40:5d:73:cd:ce: + 4e:c8:5f:11:e7:8b:f2:f1:b0:27:85:3e:d2:51:67: + 92:02:72:79:a4:89:ac:d5:8a:69:cd:9a:f7:a3:28: + ab:27:f0:60:55:cb:e9:71:5f:71:2a:dc:9f:de:85: + a0:77:0a:ea:dd:bf:9d:6e:43:b8:9d:df:7b:06:47: + 0f:3d:49:1d:7e:bc:47:90:1f:4d:ca:74:34:f8:af: + c2:e7:a4:fd:48:9b:7e:c0:ce:03:36:7a:ba:79:59: + 1f:e6:a1:a0:48:6a:94:39:0c:00:cb:d1:4d:71:dd: + d2:6e:2f:36:71:4d:98:c7:1e:2d:03:81:95:2f:f7: + 84:31:cd:a6:08:5b:1d:96:c7:3c:01:92:4f:33:e9: + 1e:13:a7:64:c2:f4:94:54:d7:d7:e3:6c:0c:45:dc: + 02:b2:1e:ff:19:f1:75:07:50:42:25:b7:06:ef:c1: + ac:df Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - 90:74:F2:7B:0D:0F:62:6C:DD:37:ED:A0:2B:AF:D7:3C:FC:EA:F3:9D + E8:2D:53:4D:3D:32:F9:74:EC:60:5A:D8:8D:7D:D2:A0:F1:71:4E:B1 X509v3 Authority Key Identifier: - 90:74:F2:7B:0D:0F:62:6C:DD:37:ED:A0:2B:AF:D7:3C:FC:EA:F3:9D + E8:2D:53:4D:3D:32:F9:74:EC:60:5A:D8:8D:7D:D2:A0:F1:71:4E:B1 X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption Signature Value: - 16:81:df:d2:85:73:03:62:0c:af:a3:1a:be:fa:32:9f:1a:f3: - 89:5f:d6:e6:3f:87:b9:11:f2:c1:1c:4e:eb:ca:3e:61:41:f3: - 8f:af:02:c4:f6:31:ed:58:a4:62:26:aa:fc:47:38:0a:76:ed: - 44:d0:2d:8c:9a:d1:b4:ae:b3:12:f6:d0:06:59:c0:92:21:da: - 57:a6:bd:59:ae:64:db:cf:a8:43:20:a1:b0:17:1d:96:9a:5f: - 57:0b:9d:50:1e:9f:99:6c:c0:94:94:68:5f:9c:7a:f7:a6:67: - dc:f2:46:9d:bb:98:f3:91:8a:33:5c:97:62:3a:6d:ea:96:d9: - 91:82:93:cf:92:70:39:21:5a:96:a9:4d:81:94:2e:ef:bc:ed: - 31:ec:ef:74:cd:0d:33:d6:6a:79:e7:93:40:7c:27:ab:4a:ff: - a8:4c:13:a1:96:6b:7a:65:b5:2a:1e:17:94:c3:2a:8f:ba:09: - bd:67:60:ec:3f:3b:b9:6e:fb:12:70:f4:c6:be:59:40:81:9b: - 07:19:f3:54:df:bc:2d:c5:1e:d4:a9:b7:db:d9:27:ad:45:90: - 62:91:99:95:31:d6:64:80:86:a0:76:ae:86:0e:59:68:26:72: - 58:fd:c5:ed:14:fa:4e:c8:94:f5:46:07:ae:62:55:b4:e8:6c: - c9:1f:8d:15 + 74:2e:95:7c:65:c9:25:7c:e7:24:67:c6:28:f4:30:3d:58:71: + 02:c8:64:ec:52:79:9b:6e:1e:d9:57:7b:c0:58:5f:d5:b1:b4: + 79:33:da:fb:7e:8a:7b:44:63:05:d8:d0:bb:bb:75:be:a3:a7: + 7e:64:f4:cb:ad:1e:a6:12:ab:dc:c3:4d:80:10:df:38:c4:bc: + 17:6c:fc:52:96:c5:9b:6c:23:47:59:d1:2d:5c:2c:91:b1:c0: + f1:27:8f:8a:5e:23:64:fe:f3:9e:f6:96:0f:c5:f5:7c:e2:4c: + 6f:8e:2d:76:4f:84:9e:3e:38:c0:81:d9:f0:e2:d4:24:cd:d8: + 5f:d0:aa:f5:ac:b6:f2:c6:00:f4:61:96:b3:bb:92:30:1f:93: + da:ee:b6:e2:64:8f:57:5a:7b:ff:03:33:64:55:7e:f9:f5:c3: + b4:bc:93:96:9b:13:b5:d9:56:56:38:56:15:06:07:3c:13:a7: + 7d:e6:c3:06:43:de:d6:4a:1b:6d:69:69:e3:29:7b:ec:5f:c7: + e5:cd:71:90:ab:5c:1d:95:87:ae:03:44:6b:68:91:ab:ab:7b: + 65:a0:5e:23:52:85:ea:6d:7c:42:aa:f0:e7:69:e1:f7:0e:e3: + 9e:38:3e:6e:0e:95:2f:37:36:09:a5:d7:97:c1:ed:9e:c4:93: + 7f:7d:02:7a -----BEGIN CERTIFICATE----- -MIIDiTCCAnGgAwIBAgIUQ28oQzTQR2x0+iNCR7CvE3MOGxIwDQYJKoZIhvcNAQEL +MIIDizCCAnOgAwIBAgIUBufkZMnZSIVuj2DiKOQbbpwM6lIwDQYJKoZIhvcNAQEL BQAwVDELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgU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fcO4544Pm4OlS83Ngml15fB7Z7Ek399Ano= -----END CERTIFICATE----- diff --git a/test/ssl/root_ca_private.pem b/test/ssl/root_ca_private.pem index 021f8f36a5e..8d35242076c 100644 --- a/test/ssl/root_ca_private.pem +++ b/test/ssl/root_ca_private.pem @@ -1,30 +1,30 @@ -----BEGIN ENCRYPTED PRIVATE KEY----- -MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIC4c7DMtL1P8CAggA -MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECHeDOFTxSUPrBIIEyFEPRkjqhQDD -tOxdyKFx+i0IGWAzTiicnwiOH96TLqYB25E9VPGGxpFgmyRDW0umtPccRq4FAeLN -2btu6pd8RsFWnqtyvT84avcHazj8URQXi7alhgjvg2130LsXlJmk3rcQaWr01c86 -BPHSMicJfVEtxHYsM3aKhp2Cp3+aKDQIbcV/b9XrojRKpGjtwVWvVMXQi/83O486 -9/tS9hjiksawPhN5nNlMbtJHfFHRjsb6tBaRktTuUAeTGcf+Wsb2GtkczrzgCZC2 -tS3n/qZLvvzeSIPhdI6xQEG5NiWj+EYDd5O1jS2m61xLEjV8Kykq8sugrAwzuc7z -c3VLHPrTwbqRLvcwY/epf7RWn7dz9rGynhWfIbc7qyWEHrEKgekPgTRgfwn45bac -arrNlV/3HM6OW67tdaHFWI3wPBXhtsL4UyAY4X+ghVR8Qw78nH9Iw0D+OxaV5lco -tRflMBYTygjjI0rSxjEyiGyJaIW7LwzIsKOmHwM93cecd+mMqtpGbAGaBeenpzpJ -e49JajUNB717prMa1q3ovPvo8w96FrDwJZJnrEnwTU5QUF2S3hWrfBBpHjemTtCp -tAeRlDw2eJfN7UEnfwrU3sOITEeCE8jV3yMAPbNRPnlM7i/4GwGF7EHdFmg48W5X -NFI1Vk7oZkJ6pCLDRst1ZV9fljCF06rH+WfxeH0l4epFg0wEVlFq/lC+ra3fz3US -669VJuJ7O0VMN6vPCaENcEkpUp5ZKh/yKL3FDv0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QuQv +2L5mMQD3cmyGOFSDIW3ux/6EqmPHttrxECrxJppmAv1L18UufT8RNCIgUxaqFdMy +JEiM7WbrcLJXShfdrbfp/gvUxBqDsWHRlg1QPkOzJS6zT5+mbBMMoLctfWt7UQ9v +NV7mZ9GuMF55+qKvliBZ9tzKVNNoVXsSlL6VIEQjs++o7cEG9RPi4hCgpq8U8/j8 +5L63T2mc9kWyQ4e/BNzIp/LjFgaOJNM8lza6JFSHnv/FPdsF58EnihCtYL9a3ryE +a+IVF3GmUOFz32wlr175xpI+kwrzwUMW8o5s7t0UjyKBYbArkCSO8nvlqFQB2aYQ +rVK21AkuPV3py0a/XJ4gKdzea989NX2xCpeB3L5pM6O1+9soCj7PrkuCk5GdM8ys +FbfgCkIBjGO4Lyh75B8/khldbCGVraIGVfO6uvuczYedxa1PEeA2q/c33Jr+Ur1J +DTykLnUa6xV+TYmlbH7+jcmiKV1tugMeeyZ32+OEdwjhdZXvkT+UawfJ/gu7sl3l +VgNSbCQrENnh1ZIV/41s9Q== -----END ENCRYPTED PRIVATE KEY----- diff --git a/test/ssl/server.pem b/test/ssl/server.pem index 150561b9402..3dfe4c802e8 100644 --- a/test/ssl/server.pem +++ b/test/ssl/server.pem @@ -1,79 +1,84 @@ -----BEGIN PRIVATE KEY----- -MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC0Lof4BSUxZ752 -OQWsVe0bnNMF4529tn5OnUzUMGAWBDK+WxBjm/4VASKLDEW1KLUFTz6NHoqCHyu0 -EF5rqG6IN40HFy8IYW/gSCx88bNAxc3ZStk7eblZXziuDG7wRQKFqJP0RcBAQpZi -l63G8m0yE2lRwPqpGkRhdMqi/7T1lFIRc1WJALHEFhZvMsX70zV9K6JKcL4Mt17l -UrRqeRGiAaQPsevihPGj3yqQ5HjojbsBE3HD7d30palsgzykACyklZ2Ov/MoKMp8 -Et+0RW91ZLYHkZuew1om/gQybx8FpICa1UkEbSWdg5XkDajC48N+7Qgqhkw8sOS5 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LnOqqzUH+xKe3Hm4RIjjy +jKThOafSJrot2jpToFMvPCz+XfYb0dWD96V6nerA4tvxqIF/miQmlF/7An/EBxf8 +69X4ZsgLUP7QkZ692556fEQNlOwAJsscN593AgMBAAGjUzBRMB0GA1UdDgQWBBRr +lkVUIVVzNKohI2dbVZ7jDeH4izAfBgNVHSMEGDAWgBRrlkVUIVVzNKohI2dbVZ7j +DeH4izAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4ICAQCHnirTq5xz +zsyzKrV1er3QkExZ72L7pZoshanCy1MQCY6cs9/uT/s7k510UZFfacrOLVTF+Oq/ +aqZSFlIlOfnR8mZQkrGdsrUm+lrgcKFsowXXSY4nBQbT6kC7q+3VKfmxY/OsUCIL +daGRE0uYV/p2BNZMBakoCHe1ZGV2F+TQ4usDN+AXqdOu8fAV+LwQZoX6oqUJuTth +lpc6aa0+oumeRJJofKSDm1Q+GdQxAiICC683qCcaBFQPao21jZvmOcWexvS+nfmH +uQc713g8odVTdjGtnJTyi2hlAmxzkVz6/n5Tr8Y1h5IkSr3X42GjJqjWJiF5ZIBb +bSj8eS51++ybhvpZBE8ToVDIJwiXO2BoaYAR5Dg5uixEBR86BqQ8j4yBLm8SI+A9 +Cwlp4szZ8kJmGxU1MyT2niWxnv2ynKmqvhlHPo03WvfDRBYTFiVbpW6ZwpXSt/j4 +b8ahNz6VMzLvPpqwnKb4p+jH2pIKk9kZP8GGpMmZ8TZzifF948jd7bx3kavCrGGq +qyF6aDMUf1MUfXmmS++Utk/94dbGbeGVJG3HgAhRj51+8hquofjAWugYFRPcKfs+ +BlJbfGVLX8/SoRmYgGfMfISJlc8XgBx/AHjsEYvjkgfdbOtsHQOMs/6YzHHJ+98S +ZerkRfBfhKOJpnW3dzKtwLGTJCYA+XRzLA== -----END CERTIFICATE----- diff --git a/test/test_bdecode.cpp b/test/test_bdecode.cpp index 8ea03102de3..4a93f7c6af9 100644 --- a/test/test_bdecode.cpp +++ b/test/test_bdecode.cpp @@ -1201,7 +1201,7 @@ TORRENT_TEST(non_owning_refs) } // test that a partial parse can be still be printed up to the -// point where it faild +// point where it failed TORRENT_TEST(partial_parse) { char b[] = "d1:ai1e1:b3:foo1:cli1ei2ee1:dd1:xi1-eee"; diff --git a/test/test_copy_file.cpp b/test/test_copy_file.cpp index b4a9761121a..8e252b8cea4 100644 --- a/test/test_copy_file.cpp +++ b/test/test_copy_file.cpp @@ -120,7 +120,7 @@ bool fs_supports_sparse_files() static fsword_t const ufs = 0x00011954; static const std::set sparse_filesystems{ EXT4_SUPER_MAGIC, EXT3_SUPER_MAGIC, XFS_SUPER_MAGIC, fsword_t(BTRFS_SUPER_MAGIC) - , ufs, REISERFS_SUPER_MAGIC + , ufs, REISERFS_SUPER_MAGIC, TMPFS_MAGIC }; printf("filesystem: %ld\n", long(st.f_type)); return sparse_filesystems.count(st.f_type); diff --git a/test/test_dht.cpp b/test/test_dht.cpp index 9cd566c26ae..64627e7c1a2 100644 --- a/test/test_dht.cpp +++ b/test/test_dht.cpp @@ -305,7 +305,7 @@ void send_dht_request(node& node, char const* msg, udp::endpoint const& ep { if (i == g_sent_packets.end()) { - TEST_ERROR("not response from DHT node"); + TEST_ERROR("no response from DHT node"); return; } @@ -2576,7 +2576,7 @@ TORRENT_TEST(traversal_done) TEST_ERROR(t.error_string); continue; } - char tok[11]; + char tok[15]; std::snprintf(tok, sizeof(tok), "%02d", i); msg_args args; @@ -3215,7 +3215,7 @@ TORRENT_TEST(read_only_node) sett.set_bool(settings_pack::dht_read_only, false); send_dht_request(node, "get", source, &response); - // sender should be added to repacement bucket + // sender should be added to replacement bucket TEST_EQUAL(std::get<1>(node.size()), 1); g_sent_packets.clear(); diff --git a/test/test_http_connection.cpp b/test/test_http_connection.cpp index 232fa5f8585..63a54567252 100644 --- a/test/test_http_connection.cpp +++ b/test/test_http_connection.cpp @@ -240,7 +240,7 @@ TORRENT_TEST(socks5_pw_proxy_ssl) { run_suite("https", settings_pack::socks5_pw) #endif // USE_SSL TORRENT_TEST(http_proxy) { run_suite("http", settings_pack::http); } -TORRENT_TEST(http__pwproxy) { run_suite("http", settings_pack::http_pw); } +TORRENT_TEST(http_pwproxy) { run_suite("http", settings_pack::http_pw); } TORRENT_TEST(socks5_proxy) { run_suite("http", settings_pack::socks5); } TORRENT_TEST(socks5_pw_proxy) { run_suite("http", settings_pack::socks5_pw); } diff --git a/test/test_http_parser.cpp b/test/test_http_parser.cpp index 12a2d03463b..76f091d6774 100644 --- a/test/test_http_parser.cpp +++ b/test/test_http_parser.cpp @@ -749,7 +749,7 @@ TORRENT_TEST(missing_chunked_header) "\r\n" "\n"; - // make the inpout not be null terminated. If the parser reads off the end, + // make the input not be null terminated. If the parser reads off the end, // address sanitizer will trigger char chunked_input[sizeof(input)-1]; std::memcpy(chunked_input, input, sizeof(chunked_input)); diff --git a/test/test_peer_list.cpp b/test/test_peer_list.cpp index d101fbf9297..f54b2bd7b63 100644 --- a/test/test_peer_list.cpp +++ b/test/test_peer_list.cpp @@ -388,7 +388,7 @@ TORRENT_TEST(update_peer_port) } // test incoming connection -// and update_peer_port, causing collission +// and update_peer_port, causing collision TORRENT_TEST(update_peer_port_collide) { torrent_state st = init_state(); @@ -1206,6 +1206,38 @@ TORRENT_TEST(peer_info_set_i2p_destination) } #endif +TORRENT_TEST(clear_peers) +{ + torrent_state st = init_state(); + st.max_peerlist_size = 5; + mock_torrent t(&st); + peer_list p(allocator); + t.m_p = &p; + + torrent_peer* peer1 = add_peer(p, st, ep("10.0.0.1", 8080)); + TEST_CHECK(peer1); + p.set_seed(peer1, true); + + torrent_peer* peer2 = add_peer(p, st, ep("10.0.0.2", 8080)); + TEST_CHECK(peer2); + + torrent_peer* peer3 = add_peer(p, st, ep("10.0.0.3", 8080)); + TEST_CHECK(peer3); + + p.connect_one_peer(1, &st); + + TEST_EQUAL(p.num_peers(), 3); + TEST_EQUAL(p.num_candidate_cache(), 2); + TEST_EQUAL(p.num_connect_candidates(), 3); + TEST_EQUAL(p.num_seeds(), 1); + + p.clear(); + TEST_EQUAL(p.num_peers(), 0); + TEST_EQUAL(p.num_candidate_cache(), 0); + TEST_EQUAL(p.num_connect_candidates(), 0); + TEST_EQUAL(p.num_seeds(), 0); +} + // TODO: test erasing peers // TODO: test update_peer_port with allow_multiple_connections_per_ip and without // TODO: test add i2p peers diff --git a/test/test_piece_picker.cpp b/test/test_piece_picker.cpp index 427593ae60e..9b8f3b3d215 100644 --- a/test/test_piece_picker.cpp +++ b/test/test_piece_picker.cpp @@ -437,7 +437,7 @@ TORRENT_TEST(get_downloaders) } // if we ask for downloaders for a piece that's not - // curently being downloaded, we get zeroes back + // currently being downloaded, we get zeroes back { std::vector d = p->get_downloaders(1_piece); @@ -1281,7 +1281,7 @@ TORRENT_TEST(picking_downloading_blocks) // don't pick both busy pieces, if there are already other blocks picked TEST_EQUAL(picked.size(), 7 * blocks_per_piece - 2); - // make sure we still pick from a partial piece even when prefering whole pieces + // make sure we still pick from a partial piece even when preferring whole pieces picked.clear(); p->pick_pieces(string2vec(" * "), picked, 1, blocks_per_piece, nullptr , piece_picker::rarest_first @@ -1575,7 +1575,7 @@ TORRENT_TEST(bitfield_optimization) TORRENT_TEST(seed_optimization) { - // test seed optimizaton + // test seed optimization auto p = setup_picker("0000000000000000", " ", "", ""); // make sure it's not dirty @@ -2717,7 +2717,7 @@ TORRENT_TEST(piece_extent_affinity_large_pieces) TORRENT_TEST(piece_extent_affinity_active_limit) { // an extent is two pieces wide, 6 extents total. - // make ure we limit the number of extents to 5 + // make sure we limit the number of extents to 5 int const blocks = 128; auto const have_none = " "; diff --git a/test/test_privacy.cpp b/test/test_privacy.cpp index 60e989b7c66..365dbd23718 100644 --- a/test/test_privacy.cpp +++ b/test/test_privacy.cpp @@ -115,7 +115,7 @@ session_proxy test_proxy(settings_pack::proxy_type_t proxy_type, flags_t flags) sett.set_bool(settings_pack::enable_outgoing_utp, false); // in non-anonymous mode we circumvent/ignore the proxy if it fails - // wheras in anonymous mode, we just fail + // whereas in anonymous mode, we just fail sett.set_str(settings_pack::proxy_hostname, "non-existing.com"); sett.set_int(settings_pack::proxy_type, proxy_type); sett.set_bool(settings_pack::proxy_peer_connections, !(flags & dont_proxy_peers)); diff --git a/test/test_read_resume.cpp b/test/test_read_resume.cpp index a11f41a42cf..92ad515d8a9 100644 --- a/test/test_read_resume.cpp +++ b/test/test_read_resume.cpp @@ -168,27 +168,6 @@ TORRENT_TEST(read_resume_missing_file_format) TEST_EQUAL(ec, error_code(errors::invalid_file_tag)); } -TORRENT_TEST(read_resume_mismatching_torrent) -{ - entry rd; - - rd["file-format"] = "libtorrent resume file"; - rd["file-version"] = 1; - rd["info-hash"] = "abcdefghijklmnopqrst"; - entry& info = rd["info"]; - info["piece length"] = 16384 * 16; - info["name"] = "test"; - - - std::vector resume_data; - bencode(std::back_inserter(resume_data), rd); - - // the info-hash field does not match the torrent in the "info" field, so it - // will be ignored - add_torrent_params atp = read_resume_data(resume_data); - TEST_CHECK(!atp.ti); -} - namespace { std::shared_ptr generate_torrent() { @@ -238,6 +217,48 @@ TORRENT_TEST(read_resume_torrent) TEST_EQUAL(atp.ti->name(), ti->name()); } +TORRENT_TEST(mismatching_v1_hash) +{ + std::shared_ptr ti = generate_torrent(); + + entry rd; + rd["file-format"] = "libtorrent resume file"; + rd["file-version"] = 1; + rd["info-hash"] = "abababababababababab"; + rd["info-hash2"] = ti->info_hashes().v2; + rd["info"] = bdecode(ti->info_section()); + + std::vector resume_data; + bencode(std::back_inserter(resume_data), rd); + + // the info-hash field does not match the torrent in the "info" field, so it + // will be ignored + error_code ec; + add_torrent_params atp = read_resume_data(resume_data, ec); + TEST_CHECK(ec == errors::mismatching_info_hash); +} + +TORRENT_TEST(mismatching_v2_hash) +{ + std::shared_ptr ti = generate_torrent(); + + entry rd; + rd["file-format"] = "libtorrent resume file"; + rd["file-version"] = 1; + rd["info-hash"] = ti->info_hashes().v1; + rd["info-hash2"] = "abababababababababababababababab"; + rd["info"] = bdecode(ti->info_section()); + + std::vector resume_data; + bencode(std::back_inserter(resume_data), rd); + + // the info-hash field does not match the torrent in the "info" field, so it + // will be ignored + error_code ec; + add_torrent_params atp = read_resume_data(resume_data, ec); + TEST_CHECK(ec == errors::mismatching_info_hash); +} + namespace { void test_roundtrip(add_torrent_params input) diff --git a/test/test_remap_files.cpp b/test/test_remap_files.cpp index d7faea366f2..51f58631a9a 100644 --- a/test/test_remap_files.cpp +++ b/test/test_remap_files.cpp @@ -173,7 +173,7 @@ void test_remap_files(storage_mode_t storage_mode = storage_mode_sparse) TEST_CHECK(all_of(files)); TEST_CHECK(all_of(passed)); - // just because we can read them back throught libtorrent, doesn't mean the + // just because we can read them back through libtorrent, doesn't mean the // files have hit disk yet (because of the cache). Retry a few times to try // to pick up the files for (auto i = 0_file; i < file_index_t(int(remap_file_sizes.size())); ++i) diff --git a/test/test_resume.cpp b/test/test_resume.cpp index db41725de08..6aad19e6764 100644 --- a/test/test_resume.cpp +++ b/test/test_resume.cpp @@ -1756,7 +1756,7 @@ TORRENT_TEST(unfinished_pieces_check_all) TORRENT_TEST(unfinished_pieces_finished) { - // make sure that a piece that isn't maked as "have", but whose blocks are + // make sure that a piece that isn't marked as "have", but whose blocks are // all downloaded gets checked and turn into "have". test_unfinished_pieces([](torrent_info const& ti, add_torrent_params& atp) { @@ -1767,7 +1767,7 @@ TORRENT_TEST(unfinished_pieces_finished) TORRENT_TEST(unfinished_pieces_all_finished) { - // make sure that a piece that isn't maked as "have", but whose blocks are + // make sure that a piece that isn't marked as "have", but whose blocks are // all downloaded gets checked and turn into "have". test_unfinished_pieces([](torrent_info const& ti, add_torrent_params& atp) { diff --git a/test/test_settings_pack.cpp b/test/test_settings_pack.cpp index 36e2c74967d..9981239fc16 100644 --- a/test/test_settings_pack.cpp +++ b/test/test_settings_pack.cpp @@ -194,7 +194,7 @@ TORRENT_TEST(clear_single_string) sp.clear(settings_pack::user_agent); // when cleared, we'll get the default value - TEST_EQUAL(sp.get_str(settings_pack::user_agent), "libtorrent/2.0.9.0"); + TEST_EQUAL(sp.get_str(settings_pack::user_agent), "libtorrent/2.0.10.0"); } TORRENT_TEST(duplicates) diff --git a/test/test_similar_torrent.cpp b/test/test_similar_torrent.cpp index 676ba2b79ca..36bb5e8dca4 100644 --- a/test/test_similar_torrent.cpp +++ b/test/test_similar_torrent.cpp @@ -285,7 +285,7 @@ TORRENT_TEST(shared_files_seed_mode_v1) TORRENT_TEST(shared_files_seed_mode_v1_no_files) { - // no files on disk, just an (incorrect) promise of beeing in seed mode + // no files on disk, just an (incorrect) promise of being in seed mode // creating the hard links will fail TEST_CHECK(test(st::no_files | st::seed_mode, v1 | canon, v1 | canon) == bools({false, false})); } diff --git a/test/test_ssl.cpp b/test/test_ssl.cpp index cc22946bd2e..833a4b1c412 100644 --- a/test/test_ssl.cpp +++ b/test/test_ssl.cpp @@ -306,8 +306,8 @@ void test_ssl(int const test_idx, bool const use_utp) } std::string const now = time_now_string(); - std::printf("%s: EXPECT: %s\n", now.c_str(), test.expected_to_complete ? "SUCCEESS" : "FAILURE"); - std::printf("%s: RESULT: %s\n", now.c_str(), tor2.status().is_seeding ? "SUCCEESS" : "FAILURE"); + std::printf("%s: EXPECT: %s\n", now.c_str(), test.expected_to_complete ? "SUCCESS" : "FAILURE"); + std::printf("%s: RESULT: %s\n", now.c_str(), tor2.status().is_seeding ? "SUCCESS" : "FAILURE"); TEST_EQUAL(tor2.status().is_seeding, test.expected_to_complete); // this allows shutting down the sessions in parallel diff --git a/test/test_storage.cpp b/test/test_storage.cpp index 46363f0e5d2..77a0cc9244d 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -852,7 +852,7 @@ void test_fastresume(bool const test_deprecated) p.storage_mode = storage_mode_sparse; torrent_handle h = ses.add_torrent(std::move(p), ec); - std::printf("expecting fastresume to be rejected becase the files were removed"); + std::printf("expecting fastresume to be rejected because the files were removed"); alert const* a = wait_for_alert(ses, fastresume_rejected_alert::alert_type , "ses"); // we expect the fast resume to be rejected because the files were removed @@ -1323,7 +1323,7 @@ TORRENT_TEST(readwrite_zero_size_files) template void test_move_storage_to_self() { - // call move_storage with the path to the exising storage. should be a no-op + // call move_storage with the path to the existing storage. should be a no-op std::string const save_path = current_working_directory(); std::string const test_path = complete("temp_storage"); delete_dirs(test_path); @@ -1387,6 +1387,48 @@ void test_move_storage_into_self() , combine_path("_folder3", "test4.tmp"))))); } +template +void test_move_storage_reset(move_flags_t const flags) +{ + std::string const save_path = current_working_directory(); + std::string const test_path = complete("temp_storage2"); + delete_dirs(test_path); + + aux::session_settings set; + file_storage fs; + std::vector buf; + typename file_pool_type::type fp; + io_context ios; + auto s = setup_torrent(fs, fp, buf, save_path, set); + + span const b = {&buf[0], 4}; + storage_error se; + TEST_EQUAL(se.ec, boost::system::errc::success); + write(s, set, b, 1_piece, 0, aux::open_mode::write, se); + + std::string const root = combine_path(save_path, "temp_storage"); + TEST_CHECK(exists(combine_path(root, combine_path("folder2", "test3.tmp")))); + TEST_CHECK(exists(combine_path(root, combine_path("_folder3", "test4.tmp")))); + std::string const root2 = combine_path(test_path, "temp_storage"); + TEST_CHECK(!exists(combine_path(root2, combine_path("folder2", "test3.tmp")))); + TEST_CHECK(!exists(combine_path(root2, combine_path("_folder3", "test4.tmp")))); + TEST_EQUAL(se.ec, boost::system::errc::success); + + std::string new_path; + status_t ret; + std::tie(ret, new_path) = s->move_storage(test_path, flags, se); + TEST_EQUAL(new_path, test_path); + TEST_EQUAL(se.ec, boost::system::errc::success); + std::cerr << "file: " << se.file() << '\n'; + std::cerr << "op: " << int(se.operation) << '\n'; + std::cerr << "ec: " << se.ec.message() << '\n'; + + // the root directory is created, but none of the files are moved + TEST_CHECK(exists(test_path)); + TEST_CHECK(!exists(combine_path(root2, combine_path("folder2", "test3.tmp")))); + TEST_CHECK(!exists(combine_path(root2, combine_path("_folder3", "test4.tmp")))); +} + #if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE TORRENT_TEST(move_default_storage_to_self) { @@ -1398,6 +1440,11 @@ TORRENT_TEST(move_default_storage_into_self) test_move_storage_into_self(); } +TORRENT_TEST(move_default_storage_reset) +{ + test_move_storage_reset(move_flags_t::reset_save_path); + test_move_storage_reset(move_flags_t::reset_save_path_unchecked); +} #endif TORRENT_TEST(move_posix_storage_to_self) @@ -1410,6 +1457,12 @@ TORRENT_TEST(move_posix_storage_into_self) test_move_storage_into_self(); } +TORRENT_TEST(move_posix_storage_reset) +{ + test_move_storage_reset(move_flags_t::reset_save_path); + test_move_storage_reset(move_flags_t::reset_save_path_unchecked); +} + TORRENT_TEST(storage_paths_string_pooling) { file_storage file_storage; diff --git a/test/test_string.cpp b/test/test_string.cpp index 1e8e50f0165..f5c0b513037 100644 --- a/test/test_string.cpp +++ b/test/test_string.cpp @@ -224,7 +224,7 @@ std::string to_str(std::vector const& v) return std::string(v.begin(), v.end()); } -// convert the standard base64 alphabet to the i2p aphabet +// convert the standard base64 alphabet to the i2p alphabet std::string transcode_alphabet(std::string in) { std::string ret; diff --git a/test/test_torrent.cpp b/test/test_torrent.cpp index 1c2ed256ff1..964a52fd465 100644 --- a/test/test_torrent.cpp +++ b/test/test_torrent.cpp @@ -186,14 +186,16 @@ void test_large_piece_size(int const size) std::vector buf; bencode(std::back_inserter(buf), torrent); - add_torrent_params atp = load_torrent_buffer(buf); - atp.save_path = "."; - - lt::session ses; - auto h = ses.add_torrent(std::move(atp)); - TEST_CHECK(h.status().errc == error_code(lt::errors::invalid_piece_size)); - h.clear_error(); - TEST_CHECK(h.status().errc == error_code(lt::errors::invalid_piece_size)); + try + { + add_torrent_params atp = load_torrent_buffer(buf); + // we expect this to fail with an exception + TEST_CHECK(false); + } + catch (lt::system_error const& e) + { + TEST_CHECK(e.code() == error_code(lt::errors::torrent_missing_piece_length)); + } } } // anonymous namespace diff --git a/test/test_torrent_info.cpp b/test/test_torrent_info.cpp index eba46eb5325..df0d996acc8 100644 --- a/test/test_torrent_info.cpp +++ b/test/test_torrent_info.cpp @@ -398,6 +398,10 @@ static test_torrent_t const test_torrents[] = TEST_CHECK((ti->nodes() == std::vector{np("127.0.0.1", 6881), np("192.168.1.1", 6881)})); } }, + { "large_piece_size.torrent", [](torrent_info const* ti) { + TEST_EQUAL(ti->piece_length(), (32767 * 0x4000)); + } + }, }; struct test_failing_torrent_t @@ -980,7 +984,7 @@ void sanity_check(std::shared_ptr const& ti) // for it, it's still no good. piece_picker pp(ti->total_size(), ti->piece_length()); - TEST_CHECK(ti->piece_length() < std::numeric_limits::max() / 2); + TEST_CHECK(ti->piece_length() <= file_storage::max_piece_size); TEST_EQUAL(ti->v1(), ti->info_hashes().has_v1()); TEST_EQUAL(ti->v2(), ti->info_hashes().has_v2()); } @@ -1132,7 +1136,7 @@ std::vector> const test_cases {"test/temporary.txt", 0x4000, {}, "test/temporary.txt"}, {"test/Temporary.txt", 0x4000, {}, "test/Temporary.1.txt"}, {"test/TeMPorArY.txT", 0x4000, {}, "test/TeMPorArY.2.txT"}, - // a file with the same name in a seprate directory is fine + // a file with the same name in a separate directory is fine {"test/test/TEMPORARY.TXT", 0x4000, {}, "test/test/TEMPORARY.TXT"}, }, { diff --git a/test/test_torrents/large_piece_size.torrent b/test/test_torrents/large_piece_size.torrent new file mode 100644 index 00000000000..e19e87404bc --- /dev/null +++ b/test/test_torrents/large_piece_size.torrent @@ -0,0 +1 @@ +d10:created by10:libtorrent13:creation datei1359599503e4:infod6:lengthi425e4:name4:temp12:piece lengthi536854528e6:pieces20:����&��JW�}�A4u,����ee diff --git a/test/test_tracker.cpp b/test/test_tracker.cpp index f46f011eb63..5092141fa25 100644 --- a/test/test_tracker.cpp +++ b/test/test_tracker.cpp @@ -644,7 +644,7 @@ TORRENT_TEST(tracker_proxy) namespace { void test_stop_tracker_timeout(int const timeout) { - // trick the min interval so that the stopped anounce is permitted immediately + // trick the min interval so that the stopped announce is permitted immediately // after the initial announce int port = start_web_server(false, false, true, -1); diff --git a/test/web_server.py b/test/web_server.py index 6df85813819..589c33373f5 100644 --- a/test/web_server.py +++ b/test/web_server.py @@ -220,7 +220,9 @@ def inner_do_GET(self): http_handler.protocol_version = 'HTTP/1.1' httpd = http_server_with_timeout(('127.0.0.1', port), http_handler) if use_ssl: - httpd.socket = ssl.wrap_socket(httpd.socket, certfile='../ssl/server.pem', server_side=True) + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + ctx.load_cert_chain("../ssl/server.pem") + httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True) while True: httpd.handle_request() diff --git a/tools/vmstat.py b/tools/vmstat.py index 75796fddac1..13ec91654c0 100644 --- a/tools/vmstat.py +++ b/tools/vmstat.py @@ -174,7 +174,6 @@ def add_counter(key: str, val: float) -> None: val = val / time_delta output[key] = [val] else: - if m.cumulative: raw_val = val val = (val - output[key + "-raw"][-1]) / time_delta @@ -209,7 +208,6 @@ def add_counter(key: str, val: float) -> None: # Locked: 0 kB else: - import psutil def capture_sample( @@ -231,7 +229,6 @@ def capture_sample( output["time"].append(timestamp) for key in dir(mem): - if key not in metrics: if not key.startswith("_") and key not in [ "pagefile", @@ -259,7 +256,6 @@ def capture_sample( output[key].append(val) for key in dir(io_cnt): - if key not in metrics: if not key.startswith("_") and key not in [ "pagefile", @@ -286,7 +282,6 @@ def capture_sample( def print_output_to_file(out: Dict[str, List[int]], filename: str) -> List[str]: - if out == {}: return []