76 lines
4.0 KiB
Diff
76 lines
4.0 KiB
Diff
|
--- apache-sshd-2.4.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2020-07-16 23:25:44.981904289 +0200
|
||
|
+++ apache-sshd-2.4.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2020-07-16 23:49:34.043250054 +0200
|
||
|
@@ -362,13 +362,13 @@
|
||
|
if (debugEnabled) {
|
||
|
log.debug("handleReadCycleCompletion({}) read {} bytes", this, result);
|
||
|
}
|
||
|
- buffer.flip();
|
||
|
+ ((java.nio.Buffer)buffer).flip();
|
||
|
|
||
|
IoHandler handler = getIoHandler();
|
||
|
handler.messageReceived(this, bufReader);
|
||
|
if (!closeFuture.isClosed()) {
|
||
|
// re-use reference for next iteration since we finished processing it
|
||
|
- buffer.clear();
|
||
|
+ ((java.nio.Buffer)buffer).clear();
|
||
|
doReadCycle(buffer, completionHandler);
|
||
|
} else {
|
||
|
if (debugEnabled) {
|
||
|
--- apache-sshd-2.4.0/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpRemotePathChannel.java 2020-07-16 23:25:44.961904157 +0200
|
||
|
+++ apache-sshd-2.4.0/sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/SftpRemotePathChannel.java 2020-07-16 23:38:16.702818800 +0200
|
||
|
@@ -20,6 +20,7 @@
|
||
|
package org.apache.sshd.client.subsystem.sftp;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
+import java.nio.Buffer;
|
||
|
import java.nio.ByteBuffer;
|
||
|
import java.nio.MappedByteBuffer;
|
||
|
import java.nio.channels.AsynchronousCloseException;
|
||
|
@@ -123,7 +124,7 @@
|
||
|
int read = sftp.read(handle, curPos, wrap.array(), wrap.arrayOffset() + wrap.position(), wrap.remaining());
|
||
|
if (read > 0) {
|
||
|
if (wrap == buffer) {
|
||
|
- wrap.position(wrap.position() + read);
|
||
|
+ ((Buffer)wrap).position(wrap.position() + read);
|
||
|
} else {
|
||
|
buffer.put(wrap.array(), wrap.arrayOffset(), read);
|
||
|
}
|
||
|
@@ -191,7 +192,7 @@
|
||
|
int written = wrap.remaining();
|
||
|
sftp.write(handle, curPos, wrap.array(), wrap.arrayOffset() + wrap.position(), written);
|
||
|
if (wrap == buffer) {
|
||
|
- wrap.position(wrap.position() + written);
|
||
|
+ ((Buffer)wrap).position(wrap.position() + written);
|
||
|
}
|
||
|
curPos += written;
|
||
|
totalWritten += written;
|
||
|
--- apache-sshd-2.4.0/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java 2020-07-16 23:25:44.961904157 +0200
|
||
|
+++ apache-sshd-2.4.0/sshd-sftp/src/main/java/org/apache/sshd/server/subsystem/sftp/AbstractSftpSubsystemHelper.java 2020-07-16 23:51:17.255925762 +0200
|
||
|
@@ -980,7 +980,7 @@
|
||
|
if (remainLen < digestBuf.length) {
|
||
|
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
|
||
|
}
|
||
|
- bb.clear(); // prepare for next read
|
||
|
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
|
||
|
|
||
|
int readLen = channel.read(bb);
|
||
|
if (readLen < 0) {
|
||
|
@@ -1005,7 +1005,7 @@
|
||
|
if (remainLen < digestBuf.length) {
|
||
|
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
|
||
|
}
|
||
|
- bb.clear(); // prepare for next read
|
||
|
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
|
||
|
|
||
|
int readLen = channel.read(bb);
|
||
|
if (readLen < 0) {
|
||
|
@@ -1140,7 +1140,7 @@
|
||
|
if (remainLen < digestBuf.length) {
|
||
|
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
|
||
|
}
|
||
|
- bb.clear(); // prepare for next read
|
||
|
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
|
||
|
|
||
|
int readLen = channel.read(bb);
|
||
|
if (readLen < 0) {
|