peer is offline if download fails

This commit is contained in:
j 2016-02-04 18:37:19 +05:30
parent 8c5f21c83d
commit 46ee94813f

View file

@ -355,6 +355,7 @@ class Node(Thread):
r = self._opener.open(url, timeout=self.TIMEOUT*2) r = self._opener.open(url, timeout=self.TIMEOUT*2)
except: except:
logger.debug('download failed %s', url, exc_info=True) logger.debug('download failed %s', url, exc_info=True)
self.online = False
return False return False
code = r.getcode() code = r.getcode()
if code == 200: if code == 200: