remove file size limit in torrent_info filename constructor (#1126)

This commit is contained in:
Arvid Norberg 2016-09-21 19:54:42 -07:00 committed by GitHub
parent c6c507c402
commit b20b3ad1ac
2 changed files with 2 additions and 6 deletions

View File

@ -1,3 +1,4 @@
* remove file size limit in torrent_info filename constructor
* fix tail-padding for last file in create_torrent
* don't send user-agent in metadata http downloads or UPnP requests when
in anonymous mode

View File

@ -643,18 +643,13 @@ namespace libtorrent
}
int load_file(std::string const& filename, std::vector<char>& v
, error_code& ec, int limit = 8000000)
, error_code& ec)
{
ec.clear();
file f;
if (!f.open(filename, file::read_only, ec)) return -1;
boost::int64_t s = f.get_size(ec);
if (ec) return -1;
if (s > limit)
{
ec = errors::metadata_too_large;
return -2;
}
v.resize(std::size_t(s));
if (s == 0) return 0;
file::iovec_t b = {&v[0], size_t(s) };