THRIFT-535. py: Twisted Thrift protocol max length is too small (fix off-by-one error...
authorEsteve Fernandez <esteve@apache.org>
Fri, 17 Jul 2009 18:35:52 +0000 (18:35 +0000)
committerEsteve Fernandez <esteve@apache.org>
Fri, 17 Jul 2009 18:35:52 +0000 (18:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@795187 13f79535-47bb-0310-9956-ffa450edef68

lib/py/src/transport/TTwisted.py

index 7b24232..a1ba150 100644 (file)
@@ -57,7 +57,7 @@ class TCallbackTransport(TMessageSenderTransport):
 
 class ThriftClientProtocol(basic.Int32StringReceiver):
 
-    MAX_LENGTH = 2 ** 31
+    MAX_LENGTH = 2 ** 31 - 1
 
     def __init__(self, client_class, iprot_factory, oprot_factory=None):
         self._client_class = client_class
@@ -101,7 +101,7 @@ class ThriftClientProtocol(basic.Int32StringReceiver):
 
 class ThriftServerProtocol(basic.Int32StringReceiver):
 
-    MAX_LENGTH = 2 ** 31
+    MAX_LENGTH = 2 ** 31 - 1
 
     def dispatch(self, msg):
         self.sendString(msg)