summaryrefslogtreecommitdiffstats
path: root/pyload/remote/thriftbackend/Transport.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 17:20:59 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-13 17:20:59 +0200
commite00ef98491f79ae8aa972ae1473dae4a7b78c07e (patch)
tree31be0c7cdcebb61525bcc387bcf15d265a1c494a /pyload/remote/thriftbackend/Transport.py
parentFix except (diff)
downloadpyload-e00ef98491f79ae8aa972ae1473dae4a7b78c07e.tar.xz
Cleanup
Diffstat (limited to 'pyload/remote/thriftbackend/Transport.py')
-rw-r--r--pyload/remote/thriftbackend/Transport.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pyload/remote/thriftbackend/Transport.py b/pyload/remote/thriftbackend/Transport.py
index 7db4ba9d7..7ecb16746 100644
--- a/pyload/remote/thriftbackend/Transport.py
+++ b/pyload/remote/thriftbackend/Transport.py
@@ -6,6 +6,7 @@ from thrift.transport.TZlibTransport import TZlibTransport
class Transport(TBufferedTransport):
DEFAULT_BUFFER = 4096
+
def __init__(self, trans, rbuf_size = DEFAULT_BUFFER):
TBufferedTransport.__init__(self, trans, rbuf_size)
self.handle = trans.handle
@@ -14,12 +15,14 @@ class Transport(TBufferedTransport):
class TransportCompressed(TZlibTransport):
DEFAULT_BUFFER = 4096
+
def __init__(self, trans, rbuf_size = DEFAULT_BUFFER):
TZlibTransport.__init__(self, trans, rbuf_size)
self.handle = trans.handle
self.remoteaddr = trans.handle.getpeername()
class TransportFactory(object):
+
def getTransport(self, trans):
buffered = Transport(trans)
return buffered
@@ -28,6 +31,7 @@ class TransportFactoryCompressed(object):
_last_trans = None
_last_z = None
+
def getTransport(self, trans, compresslevel=9):
if trans == self._last_trans:
return self._last_z