stop failed downloader outside of GetStream

This commit is contained in:
Jack Robison 2017-09-27 17:25:21 -04:00
parent b0a3771ccf
commit 250855d45d
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF

View file

@ -76,7 +76,7 @@ class GetStream(object):
Check if we've got the first data blob in the stream yet Check if we've got the first data blob in the stream yet
""" """
self.timeout_counter += 1 self.timeout_counter += 1
if self.timeout_counter >= self.timeout: if self.timeout_counter > self.timeout:
if not self.data_downloading_deferred.called: if not self.data_downloading_deferred.called:
self.data_downloading_deferred.errback(DownloadDataTimeout(self.sd_hash)) self.data_downloading_deferred.errback(DownloadDataTimeout(self.sd_hash))
@ -213,9 +213,8 @@ class GetStream(object):
try: try:
yield self.data_downloading_deferred yield self.data_downloading_deferred
except Exception as err: except DownloadDataTimeout as err:
self.downloader.stop()
safe_stop_looping_call(self.checker) safe_stop_looping_call(self.checker)
raise raise err
defer.returnValue((self.downloader, self.finished_deferred)) defer.returnValue((self.downloader, self.finished_deferred))