Merge pull request #2817 from fuzeman/feature/dev_rtorrent

[rtorrent] Fixed bug which caused large torrents to fail
This commit is contained in:
Ruud Burger committed 2014-02-06 14:04:46 +01:00
commit 78bf1d274e
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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)