summaryrefslogtreecommitdiffstats
path: root/pyload/remote/thriftbackend/Transport.py
diff options
context:
space:
mode:
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