diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-13 23:10:00 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-02-13 23:10:00 +0100 |
commit | 624b210b8b46e07826762a610dd2d6d7c0b4a121 (patch) | |
tree | 150365b9122caf0ed8287684416a1818d0153443 /module/remote/thriftbackend | |
parent | collector size (diff) | |
download | pyload-624b210b8b46e07826762a610dd2d6d7c0b4a121.tar.xz |
little SO fix
Diffstat (limited to 'module/remote/thriftbackend')
-rw-r--r-- | module/remote/thriftbackend/ThriftClient.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/module/remote/thriftbackend/ThriftClient.py b/module/remote/thriftbackend/ThriftClient.py index 67474b2bb..16bba7d1f 100644 --- a/module/remote/thriftbackend/ThriftClient.py +++ b/module/remote/thriftbackend/ThriftClient.py @@ -41,7 +41,7 @@ class ThriftClient: #connection reset by peer, probably wants ssl try: self.createConnection(host, port, True) - #set timeout or a ssl socket will block when query none ssl server + #set timeout or a ssl socket will block when querying none ssl server self.socket.setTimeout(10) except ImportError: @@ -52,7 +52,7 @@ class ThriftClient: correct = self.client.login(user, password) finally: self.socket.setTimeout(None) - + if not correct: self.transport.close() raise WrongLogin @@ -64,6 +64,8 @@ class ThriftClient: protocol = Protocol(self.transport) self.client = Pyload.Client(protocol) + def close(self): + self.transport.close() def __getattr__(self, item): return getattr(self.client, item) @@ -81,3 +83,5 @@ if __name__ == "__main__": data = client.getPackageData(p.pid) print data print "Package Name: ", data.name + + client.close()
\ No newline at end of file |