Skip to content

Commit

Permalink
Fix #3444, support single file hybrid torrents. (#3446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanzaa committed Jul 14, 2022
1 parent 39d442b commit c3db52e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libtransmission/torrent-metainfo.cc
Expand Up @@ -244,6 +244,7 @@ struct MetainfoHandler final : public transmission::benc::BasicHandler<MaxBencDe
{
// v2, ignore for today
tr_logAddInfo("'file tree' is ignored");
state_ = State::UsePath;
}
else if (state_ == State::Files) // bittorrent v1 format
{
Expand All @@ -254,6 +255,10 @@ struct MetainfoHandler final : public transmission::benc::BasicHandler<MaxBencDe

file_subpath_.clear();
}
else if (state_ == State::PieceLayers)
{
state_ = State::UsePath;
}

return depth() > 0;
}
Expand Down
1 change: 1 addition & 0 deletions tests/utils/CMakeLists.txt
Expand Up @@ -15,3 +15,4 @@ AddShowTest(transmission-show-bittorrent-v2-hybrid-test bittorrent-v2-hybrid-tes
AddShowTest(transmission-show-inner-sanctum Inner_Sanctum_movie_archive)
AddShowTest(transmission-show-thor Thor_and_the_Amazon_Women.avi)
AddShowTest(transmission-show-ubuntu ubuntu-20.04.3-desktop-amd64.iso)
AddShowTest(transmission-show-ubuntu-hybrid hybrid-single-ubuntu-20.04.3-desktop-amd64.iso)
@@ -0,0 +1,25 @@
Name: ubuntu-20.04.3-desktop-amd64.iso
File: assets/hybrid-single-ubuntu-20.04.3-desktop-amd64.iso.torrent

GENERAL

Name: ubuntu-20.04.3-desktop-amd64.iso
Hash v1: c4b7a178451f4f1a5154ffe1e780b168d6482e98
Hash v2: e07f234e9d32eda230d13b7d28bfc07ddd324aa2653c51ed966e9dbadaaa8fa9
Created by: Unknown
Created on: Unknown

Piece Count: 11719
Piece Size: 256.0 KiB
Total Size: 3.07 GB
Privacy: Public torrent

TRACKERS

Tier #1
http://example.com/announce

FILES

ubuntu-20.04.3-desktop-amd64.iso (3.07 GB)

Binary file not shown.

0 comments on commit c3db52e

Please sign in to comment.