@@ -743,8 +743,8 @@ private synchronized int SendAppData(ByteBuffer[] in, int ofst, int len)
743743 /* Get total input data size, store input array positions */
744744 for (i = ofst ; i < ofst + len ; i ++) {
745745 totalIn += in [i ].remaining ();
746- pos [i ] = in [i ].position ();
747- limit [i ] = in [i ].limit ();
746+ pos [i - ofst ] = in [i ].position ();
747+ limit [i - ofst ] = in [i ].limit ();
748748 }
749749
750750 /* Allocate static buffer for application data, clear before use */
@@ -766,7 +766,7 @@ private synchronized int SendAppData(ByteBuffer[] in, int ofst, int len)
766766 in [i ].limit (in [i ].position () + bufChunk ); /* set limit */
767767 this .staticAppDataBuf .put (in [i ]); /* get data */
768768 inputLeft -= bufChunk ;
769- in [i ].limit (limit [i ]); /* reset limit */
769+ in [i ].limit (limit [i - ofst ]); /* reset limit */
770770
771771 if (inputLeft == 0 ) {
772772 break ; /* reached data size needed, stop reading */
@@ -787,7 +787,7 @@ private synchronized int SendAppData(ByteBuffer[] in, int ofst, int len)
787787 if (ret <= 0 ) {
788788 /* error, reset in[] positions for next call */
789789 for (i = ofst ; i < ofst + len ; i ++) {
790- in [i ].position (pos [i ]);
790+ in [i ].position (pos [i - ofst ]);
791791 }
792792 }
793793
0 commit comments