THRIFT-5432 TSaslTransport throw TTransportException of MaxMessageSize reached
Client: java
Patch: GuangMing Lu
diff --git a/lib/java/src/org/apache/thrift/transport/TSaslTransport.java b/lib/java/src/org/apache/thrift/transport/TSaslTransport.java
index b106c70..b22469d 100644
--- a/lib/java/src/org/apache/thrift/transport/TSaslTransport.java
+++ b/lib/java/src/org/apache/thrift/transport/TSaslTransport.java
@@ -72,7 +72,7 @@
/**
* Buffer for input.
*/
- private TMemoryInputTransport readBuffer = new TMemoryInputTransport();
+ private TMemoryInputTransport readBuffer;
/**
* Buffer for output.
@@ -89,6 +89,7 @@
protected TSaslTransport(TTransport underlyingTransport) throws TTransportException {
super(Objects.isNull(underlyingTransport.getConfiguration()) ? new TConfiguration() : underlyingTransport.getConfiguration());
this.underlyingTransport = underlyingTransport;
+ this.readBuffer = new TMemoryInputTransport(underlyingTransport.getConfiguration());
}
/**
@@ -104,6 +105,7 @@
super(Objects.isNull(underlyingTransport.getConfiguration()) ? new TConfiguration() : underlyingTransport.getConfiguration());
sasl = new SaslParticipant(saslClient);
this.underlyingTransport = underlyingTransport;
+ this.readBuffer = new TMemoryInputTransport(underlyingTransport.getConfiguration());
}
protected void setSaslServer(SaslServer saslServer) {