@@ -179,8 +179,8 @@ protected void consumeDelegatedTasks() {
179179 }
180180
181181 protected void createBuffers ( SSLSession session ) {
182- int appBufferMax = session .getApplicationBufferSize ();
183182 int netBufferMax = session .getPacketBufferSize ();
183+ int appBufferMax = Math .max (session .getApplicationBufferSize (), netBufferMax );
184184
185185 if ( inData == null ) {
186186 inData = ByteBuffer .allocate ( appBufferMax );
@@ -209,9 +209,9 @@ public int write( ByteBuffer src ) throws IOException {
209209 return 0 ;
210210 }
211211 // assert ( bufferallocations > 1 ); //see #190
212- if ( bufferallocations <= 1 ) {
213- createBuffers ( sslEngine .getSession () );
214- }
212+ // if( bufferallocations <= 1 ) {
213+ // createBuffers( sslEngine.getSession() );
214+ // }
215215 int num = socketChannel .write ( wrap ( src ) );
216216 return num ;
217217
@@ -239,9 +239,9 @@ public int read( ByteBuffer dst ) throws IOException {
239239 }
240240 }
241241 // assert ( bufferallocations > 1 ); //see #190
242- if ( bufferallocations <= 1 ) {
243- createBuffers ( sslEngine .getSession () );
244- }
242+ // if( bufferallocations <= 1 ) {
243+ // createBuffers( sslEngine.getSession() );
244+ // }
245245 /* 1. When "dst" is smaller than "inData" readRemaining will fill "dst" with data decoded in a previous read call.
246246 * 2. When "inCrypt" contains more data than "inData" has remaining space, unwrap has to be called on more time(readRemaining)
247247 */
0 commit comments