set non supported error for v2 torrents

This commit is contained in:
orignal committed 2026-10-08 10:01:55 -04:00
1 parent 3117883a05
commit 3e44ff4c82
2 files changed
+12 -1

No files matched your search

+10
View File
@@ -587,6 +587,16 @@ namespace torrents
}
else if (key == "files")
return ParseFiles (buf);
else if (key == "meta version")
{
auto [value, l] = ExtractInteger (buf);
if (l && value != 1)
{
LogPrint (eLogError, "Torrents: Torrent version ", value, " is not supprted");
m_Error = eTorrentErrorNonSupportedVersion;
}
return l;
}
return 0;
});
if (!len)
+2 -1
View File
@@ -239,12 +239,13 @@ namespace torrents
{
eTorrentErrorNoError = 0,
eTorrentErrorMalformedMetaInfo = 1,
eTorrentErrorNonSupportedVersion = 2,
eNumTorrentErrors
};
constexpr std::array<std::string_view, eNumTorrentErrors> TorrentErrorStr
{
"", "Malformed metaInfo"
"", "Malformed metaInfo", "Non supported version"
};
using RequestedBlock = std::tuple<uint32_t, uint32_t, uint32_t>; // (index, offset, len)