fixede bug appearing when loading a torrent containing a piece length of 0

This commit is contained in:
Arvid Norberg 2006-09-23 21:43:26 +00:00
parent fe0d570f05
commit 5e254ffea6
2 changed files with 2 additions and 0 deletions

View File

@ -1,3 +1,4 @@
* fixed bug causing a crash with a torrent with piece length 0
* added an extension to the DHT network protocol to support the
exchange of nodes with IPv6 addresses.
* modified the ip_filter api slightly to support IPv6

View File

@ -207,6 +207,7 @@ namespace libtorrent
// extract piece length
m_piece_length = (int)info["piece length"].integer();
if (m_piece_length <= 0) throw std::runtime_error("invalid torrent. piece length <= 0");
// extract file name (or the directory name if it's a multifile libtorrent)
if (entry const* e = info.find_key("name.utf-8"))