mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 02:11:43 +00:00
set non supported error for v2 torrents
This commit is contained in:
1 parent
3117883a05
commit
3e44ff4c82
2 files changed
+12
-1
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user