You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by lg...@apache.org on 2018/08/26 05:51:48 UTC

[6/6] mina-sshd git commit: [SSHD-839] Fixed incorrect copy loop in PortForwardingLoadTest#testLocalForwardingPayload

[SSHD-839] Fixed incorrect copy loop in PortForwardingLoadTest#testLocalForwardingPayload


Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/3495f728
Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/3495f728
Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/3495f728

Branch: refs/heads/master
Commit: 3495f7287ef3ec29e6cef6748bae335056da101d
Parents: 463658a
Author: Goldstein Lyor <ly...@cb4.com>
Authored: Wed Aug 22 14:26:22 2018 +0300
Committer: Goldstein Lyor <ly...@cb4.com>
Committed: Sun Aug 26 08:50:42 2018 +0300

----------------------------------------------------------------------
 .../org/apache/sshd/common/forward/PortForwardingLoadTest.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/3495f728/sshd-core/src/test/java/org/apache/sshd/common/forward/PortForwardingLoadTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/common/forward/PortForwardingLoadTest.java b/sshd-core/src/test/java/org/apache/sshd/common/forward/PortForwardingLoadTest.java
index dc90b6d..e37ff7b 100644
--- a/sshd-core/src/test/java/org/apache/sshd/common/forward/PortForwardingLoadTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/common/forward/PortForwardingLoadTest.java
@@ -252,7 +252,7 @@ public class PortForwardingLoadTest extends BaseTestSupport {
                                          OutputStream sockOut = s.getOutputStream()) {
 
                                         for (int writeSize = 0, lastReport = 0; writeSize < outBytes.length;) {
-                                            int l = sockIn.read(buf);
+                                            int l = inputCopy.read(buf);
                                             if (l < 0) {
                                                 break;
                                             }
@@ -332,6 +332,7 @@ public class PortForwardingLoadTest extends BaseTestSupport {
 
     private static void assertPayloadEquals(String message, byte[] expectedBytes, byte[] actualBytes) {
         assertEquals(message + ": mismatched payload length", expectedBytes.length, actualBytes.length);
+
         for (int index = 0; index < expectedBytes.length; index++) {
             if (expectedBytes[index] == actualBytes[index]) {
                 continue;