diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/PluginThread.py | 9 | ||||
-rw-r--r-- | module/remote/thriftbackend/Socket.py | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index 84ddc6115..1fe1363bc 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -181,17 +181,16 @@ class DownloadThread(PluginThread): continue - except Retry: + except Retry, e: - #todo: ouput - - self.m.log.info(_("Download restarted: %s") % pyfile.name) + reason = e.args[0] + self.m.log.info(_("Download restarted: %(name)s | %(msg)s") % {"name" : pyfile.name, "msg": reason}) self.queue.put(pyfile) continue except Fail, e: - msg = e.message + msg = e.args[0] if msg == "offline": pyfile.setStatus("offline") diff --git a/module/remote/thriftbackend/Socket.py b/module/remote/thriftbackend/Socket.py index 3f837bdae..2243f9df2 100644 --- a/module/remote/thriftbackend/Socket.py +++ b/module/remote/thriftbackend/Socket.py @@ -4,6 +4,8 @@ import sys import socket import errno +from time import sleep + from thrift.transport.TSocket import TSocket, TServerSocket, TTransportException WantReadError = Exception #overwritten when ssl is used @@ -29,14 +31,15 @@ class SecureSocketConnection: try: return self.__dict__["connection"].send(buff) except WantReadError: + sleep(0.1) return self.send(buff) def recv(self, buff): try: return self.__dict__["connection"].recv(buff) except WantReadError: - return "" -# return self.recv(buff) + sleep(0.1) + return self.recv(buff) class Socket(TSocket): def __init__(self, host='localhost', port=7228, ssl=False): @@ -45,7 +48,6 @@ class Socket(TSocket): def open(self): if self.ssl: - #TODO check SSL = __import__("OpenSSL", globals(), locals(), "SSL", -1).SSL WantReadError = SSL.WantReadError ctx = SSL.Context(SSL.SSLv23_METHOD) |