You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by gn...@apache.org on 2013/07/18 17:42:21 UTC

[1/2] git commit: [SSHD-237] SSHD may send an exit-status after the channel being closed

Updated Branches:
  refs/heads/master afdfca0e5 -> dafc60810


[SSHD-237] SSHD may send an exit-status after the channel being closed

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

Branch: refs/heads/master
Commit: a6854b846399ffe5c4bc6105f2e10c0a36779dc0
Parents: afdfca0
Author: Guillaume Nodet <gn...@apache.org>
Authored: Thu Jul 18 17:40:44 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Thu Jul 18 17:40:44 2013 +0200

----------------------------------------------------------------------
 .../org/apache/sshd/server/channel/ChannelSession.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/a6854b84/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java b/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
index dd21656..bf4ae77 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
@@ -552,11 +552,13 @@ public class ChannelSession extends AbstractServerChannel {
     }
 
     protected void closeShell(int exitValue) throws IOException {
-        if (!closing) {
-            sendEof();
-            sendExitStatus(exitValue);
-            // TODO: We should wait for all streams to be consumed before closing the channel
-            close(false);
+        synchronized (lock) {
+            if (!closing) {
+                sendEof();
+                sendExitStatus(exitValue);
+                // TODO: We should wait for all streams to be consumed before closing the channel
+                close(false);
+            }
         }
     }
 


[2/2] git commit: [SSHD-138] Improve ScpTest testWithGanymede

Posted by gn...@apache.org.
[SSHD-138] Improve ScpTest testWithGanymede

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

Branch: refs/heads/master
Commit: dafc60810e5aa93bfd7ea9ec443ac32628c41d81
Parents: a6854b8
Author: Guillaume Nodet <gn...@apache.org>
Authored: Thu Jul 18 17:42:13 2013 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Thu Jul 18 17:42:13 2013 +0200

----------------------------------------------------------------------
 .../src/test/java/org/apache/sshd/ScpTest.java     | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/dafc6081/sshd-core/src/test/java/org/apache/sshd/ScpTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/ScpTest.java b/sshd-core/src/test/java/org/apache/sshd/ScpTest.java
index 6f8ddb3..8007281 100644
--- a/sshd-core/src/test/java/org/apache/sshd/ScpTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/ScpTest.java
@@ -171,11 +171,20 @@ public class ScpTest {
         final Properties props = new Properties();
         props.setProperty("test", "test-passed");
         File f = new File("target/scp/gan");
-        scp_client.put(toBytes(props, ""), "test.properties", "target/scp/gan");
+        f.mkdirs();
         assertTrue(f.exists());
-        scp_client.put(toBytes(props, ""), "test2.properties", "target/scp/gan");
-        assertTrue(f.exists());
-        f.delete();
+
+        String name = "test.properties";
+        scp_client.put(toBytes(props, ""), name, "target/scp/gan");
+        assertTrue(new File(f, name).exists());
+        assertTrue(new File(f, name).delete());
+
+        name = "test2.properties";
+        scp_client.put(toBytes(props, ""), name, "target/scp/gan");
+        assertTrue(new File(f, name).exists());
+        assertTrue(new File(f, name).delete());
+
+        assertTrue(f.delete());
         conn.close();
     }