Merge pull request #2817 from fuzeman/feature/dev_rtorrent
[rtorrent] Fixed bug which caused large torrents to fail
This commit is contained in:
commit
78bf1d274e
2 files changed
+4
-4
No files matched your search
@@ -267,7 +267,7 @@ def _encode_dict(data):
|
|||||||
def encode(data):
|
def encode(data):
|
||||||
if isinstance(data, bool):
|
if isinstance(data, bool):
|
||||||
return False
|
return False
|
||||||
elif isinstance(data, int):
|
elif isinstance(data, (int, long)):
|
||||||
return _encode_int(data)
|
return _encode_int(data)
|
||||||
elif isinstance(data, bytes):
|
elif isinstance(data, bytes):
|
||||||
return _encode_string(data)
|
return _encode_string(data)
|
||||||
|
|||||||
@@ -90,10 +90,10 @@ class TorrentParser():
|
|||||||
def _calc_info_hash(self):
|
def _calc_info_hash(self):
|
||||||
self.info_hash = None
|
self.info_hash = None
|
||||||
if "info" in self._torrent_decoded.keys():
|
if "info" in self._torrent_decoded.keys():
|
||||||
info_encoded = bencode.encode(self._torrent_decoded["info"])
|
info_encoded = bencode.encode(self._torrent_decoded["info"])
|
||||||
|
|
||||||
if info_encoded:
|
if info_encoded:
|
||||||
self.info_hash = hashlib.sha1(info_encoded).hexdigest().upper()
|
self.info_hash = hashlib.sha1(info_encoded).hexdigest().upper()
|
||||||
|
|
||||||
return(self.info_hash)
|
return(self.info_hash)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user