summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-14 17:19:39 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-14 17:19:39 +0200
commit2243437714e8fa2f2054e13b626057b86bd7562a (patch)
treef8fe7459ca552d16caacc33b4fc6e12e47fc70bc /module
parentforget sleep (diff)
downloadpyload-2243437714e8fa2f2054e13b626057b86bd7562a.tar.xz
ssl fix
Diffstat (limited to 'module')
-rw-r--r--module/PluginThread.py9
-rw-r--r--module/remote/thriftbackend/Socket.py8
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)