Ensure hybrid torrents are parsed correctly. (#3388)

This commit is contained in:
Colin B
2022-07-02 10:16:34 -07:00
committed by GitHub
parent e9d34519ff
commit 5e43731bcf
3 changed files with 13 additions and 18 deletions

View File

@@ -242,21 +242,8 @@ struct MetainfoHandler final : public transmission::benc::BasicHandler<MaxBencDe
if (state_ == State::FileTree) // bittorrent v2 format
{
if (!addFile(context))
{
return false;
}
file_subpath_.popdir();
if (file_subpath_ == "."sv)
{
file_subpath_.clear();
}
if (pathIs(InfoKey, FileTreeKey))
{
state_ = State::UsePath;
}
// v2, ignore for today
tr_logAddInfo("'file tree' is ignored");
}
else if (state_ == State::Files) // bittorrent v1 format
{

View File

@@ -10,7 +10,7 @@ function(AddShowTest name file_basename)
)
endfunction()
AddShowTest(transmission-show-bittorrent-v2 bittorrent-v2-test)
# disabled AddShowTest(transmission-show-bittorrent-v2 bittorrent-v2-test)
AddShowTest(transmission-show-bittorrent-v2-hybrid-test bittorrent-v2-hybrid-test)
AddShowTest(transmission-show-inner-sanctum Inner_Sanctum_movie_archive)
AddShowTest(transmission-show-thor Thor_and_the_Amazon_Women.avi)

View File

@@ -9,15 +9,23 @@ GENERAL
Created by: libtorrent
Created on: Wed Jun 03 08:45:06 2020
Piece Count: 1709
Piece Count: 1715
Piece Size: 512.0 KiB
Total Size: 895.5 MB
Total Size: 898.6 MB
Privacy: Public torrent
TRACKERS
FILES
bittorrent-v1-v2-hybrid-test/.pad/129434 (129.4 kB)
bittorrent-v1-v2-hybrid-test/.pad/227380 (227.4 kB)
bittorrent-v1-v2-hybrid-test/.pad/280339 (280.3 kB)
bittorrent-v1-v2-hybrid-test/.pad/442368 (442.4 kB)
bittorrent-v1-v2-hybrid-test/.pad/464896 (464.9 kB)
bittorrent-v1-v2-hybrid-test/.pad/507162 (507.2 kB)
bittorrent-v1-v2-hybrid-test/.pad/510995 (511.0 kB)
bittorrent-v1-v2-hybrid-test/.pad/524227 (524.2 kB)
bittorrent-v1-v2-hybrid-test/Darkroom (Stellar, 1994, Amiga ECS) HQ.mp4 (6.54 MB)
bittorrent-v1-v2-hybrid-test/Spaceballs-StateOfTheArt.avi (20.51 MB)
bittorrent-v1-v2-hybrid-test/cncd_fairlight-ceasefire_(all_falls_down)-1080p.mp4 (342.2 MB)