diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 20:47:03 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-29 20:47:03 +0200 |
commit | ca1c034012f15fcebf1cf918f578afbcfe028ea7 (patch) | |
tree | 16e4f590aed0fe5498add0bb880bd4367eaffdbd /module | |
parent | requestobject and working interface to the core (diff) | |
download | pyload-ca1c034012f15fcebf1cf918f578afbcfe028ea7.tar.xz |
little request fix
Diffstat (limited to 'module')
-rw-r--r-- | module/remote/RequestHandler.py | 14 | ||||
-rw-r--r-- | module/remote/RequestObject.py | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py index 09ad5b548..1405fd3eb 100644 --- a/module/remote/RequestHandler.py +++ b/module/remote/RequestHandler.py @@ -30,7 +30,7 @@ class RequestHandler: if obj.command == "exec": func = getattr(self.core, obj.function) - obj.response = func() + obj.response = func(*obj.args) else: obj.response = "antwort" @@ -38,11 +38,15 @@ class RequestHandler: def decrypt(self, dec_str): - dec_str = base64.standard_b64decode(dec_str) - dec_str = self.aes.decrypt(dec_str) + try: + dec_str = base64.standard_b64decode(dec_str) + dec_str = self.aes.decrypt(dec_str) - dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] - obj = cPickle.loads(dec_str) + dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] + obj = cPickle.loads(dec_str) + except: + obj = RequestObject() + return obj def encrypt(self, obj): diff --git a/module/remote/RequestObject.py b/module/remote/RequestObject.py index 77322663a..86e803e9c 100644 --- a/module/remote/RequestObject.py +++ b/module/remote/RequestObject.py @@ -3,7 +3,7 @@ """ authored by: RaNaN -this module handels the incoming requests +represents the object for interaction """ |