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 2014/06/04 23:46:18 UTC

[1/2] git commit: Remove experimental modules from default build

Repository: mina-sshd
Updated Branches:
  refs/heads/master fff695ecf -> f1381667d


Remove experimental modules from default build

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

Branch: refs/heads/master
Commit: f543c74f665dcd231a3f9e5c3c1f33bdff18a1f3
Parents: fff695e
Author: Guillaume Nodet <gn...@apache.org>
Authored: Wed Jun 4 22:52:34 2014 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Wed Jun 4 22:52:34 2014 +0200

----------------------------------------------------------------------
 pom.xml | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f543c74f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 92d65aa..d97d4a5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -298,10 +298,18 @@
         <projectRoot>${basedir}</projectRoot>
     </properties>
 
+    <profiles>
+        <profile>
+            <id>experimental</id>
+            <modules>
+                <module>sshd-pam</module>
+                <module>sshd-sftp</module>
+            </modules>
+        </profile>
+    </profiles>
+
     <modules>
         <module>sshd-core</module>
-        <module>sshd-pam</module>
-        <module>sshd-sftp</module>
         <module>sshd-git</module>
         <module>assembly</module>
     </modules>


[2/2] git commit: [SSHD-329] Client channels tend to use in/out instead of invertedOut/invertedIn

Posted by gn...@apache.org.
[SSHD-329] Client channels tend to use in/out instead of invertedOut/invertedIn

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

Branch: refs/heads/master
Commit: f1381667de2ba2444b34412e32e9ad99ff3415ab
Parents: f543c74
Author: Guillaume Nodet <gn...@apache.org>
Authored: Wed Jun 4 23:42:15 2014 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Wed Jun 4 23:45:32 2014 +0200

----------------------------------------------------------------------
 .../apache/sshd/agent/unix/AgentForwardedChannel.java   |  6 +++---
 .../sshd/client/channel/AbstractClientChannel.java      |  9 +++++++++
 .../apache/sshd/client/channel/ChannelDirectTcpip.java  | 12 +++++++-----
 .../sshd/common/forward/DefaultTcpipForwarder.java      |  4 ++--
 .../apache/sshd/common/forward/TcpipClientChannel.java  |  2 +-
 .../org/apache/sshd/server/x11/X11ForwardSupport.java   |  6 +++---
 .../test/java/org/apache/sshd/PortForwardingTest.java   |  6 +++---
 7 files changed, 28 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
index c57739c..4f097e4 100644
--- a/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
+++ b/sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentForwardedChannel.java
@@ -46,8 +46,8 @@ public class AgentForwardedChannel extends AbstractClientChannel implements Runn
                 } else if (result < Status.APR_SUCCESS) {
                     AgentServerProxy.throwException(result);
                 }
-                getOut().write(buf, 0, result);
-                getOut().flush();
+                getInvertedIn().write(buf, 0, result);
+                getInvertedIn().flush();
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -62,7 +62,7 @@ public class AgentForwardedChannel extends AbstractClientChannel implements Runn
 
     @Override
     protected synchronized void doOpen() throws IOException {
-        out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
+        invertedIn = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java b/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
index 37def96..1e89c84 100644
--- a/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
+++ b/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
@@ -67,6 +67,10 @@ public abstract class AbstractClientChannel extends AbstractChannel implements C
         return invertedIn;
     }
 
+    /**
+     * @deprecated Use {@link #getInvertedOut()} instead
+     */
+    @Deprecated
     public InputStream getIn() {
         return in;
     }
@@ -79,6 +83,10 @@ public abstract class AbstractClientChannel extends AbstractChannel implements C
         return invertedOut;
     }
 
+    /**
+     * @deprecated Use {@link #getInvertedIn()} instead
+     */
+    @Deprecated
     public OutputStream getOut() {
         return out;
     }
@@ -91,6 +99,7 @@ public abstract class AbstractClientChannel extends AbstractChannel implements C
         return invertedErr;
     }
 
+    @Deprecated
     public OutputStream getErr() {
         return err;
     }

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelDirectTcpip.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelDirectTcpip.java b/sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelDirectTcpip.java
index 408963b..66d3456 100644
--- a/sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelDirectTcpip.java
+++ b/sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelDirectTcpip.java
@@ -19,8 +19,6 @@
 package org.apache.sshd.client.channel;
 
 import java.io.IOException;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
@@ -30,6 +28,8 @@ import org.apache.sshd.common.SshConstants;
 import org.apache.sshd.common.SshException;
 import org.apache.sshd.common.SshdSocketAddress;
 import org.apache.sshd.common.channel.ChannelOutputStream;
+import org.apache.sshd.common.channel.ChannelPipedInputStream;
+import org.apache.sshd.common.channel.ChannelPipedOutputStream;
 import org.apache.sshd.common.util.Buffer;
 
 /**
@@ -41,7 +41,7 @@ public class ChannelDirectTcpip extends AbstractClientChannel {
 
     private final SshdSocketAddress local;
     private final SshdSocketAddress remote;
-    private final PipedOutputStream pipe = new PipedOutputStream();
+    private ChannelPipedOutputStream pipe;
 
     public ChannelDirectTcpip(SshdSocketAddress local, SshdSocketAddress remote) {
         super("direct-tcpip");
@@ -81,8 +81,10 @@ public class ChannelDirectTcpip extends AbstractClientChannel {
 
     @Override
     protected void doOpen() throws IOException {
-        out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
-        in = new PipedInputStream(pipe);
+        invertedIn = out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
+        ChannelPipedInputStream pis = new ChannelPipedInputStream(localWindow);
+        pipe = new ChannelPipedOutputStream(pis);
+        invertedOut = in = pis;
     }
 
     public OpenFuture open() throws IOException {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
index 8c94d03..57e73f0 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/forward/DefaultTcpipForwarder.java
@@ -206,8 +206,8 @@ public class DefaultTcpipForwarder extends CloseableUtils.AbstractInnerCloseable
         Buffer buffer = new Buffer();
         buffer.putBuffer(message);
         channel.waitFor(ClientChannel.OPENED | ClientChannel.CLOSED, Long.MAX_VALUE);
-        channel.getOut().write(buffer.array(), buffer.rpos(), buffer.available());
-        channel.getOut().flush();
+        channel.getInvertedIn().write(buffer.array(), buffer.rpos(), buffer.available());
+        channel.getInvertedIn().flush();
     }
 
     public void exceptionCaught(IoSession session, Throwable cause) throws Exception {

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/common/forward/TcpipClientChannel.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/common/forward/TcpipClientChannel.java b/sshd-core/src/main/java/org/apache/sshd/common/forward/TcpipClientChannel.java
index 50534b2..479fb24 100644
--- a/sshd-core/src/main/java/org/apache/sshd/common/forward/TcpipClientChannel.java
+++ b/sshd-core/src/main/java/org/apache/sshd/common/forward/TcpipClientChannel.java
@@ -96,7 +96,7 @@ public class TcpipClientChannel extends AbstractClientChannel {
 
     @Override
     protected synchronized void doOpen() throws IOException {
-        out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
+        invertedIn = out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/main/java/org/apache/sshd/server/x11/X11ForwardSupport.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/main/java/org/apache/sshd/server/x11/X11ForwardSupport.java b/sshd-core/src/main/java/org/apache/sshd/server/x11/X11ForwardSupport.java
index 047d207..f43f528 100644
--- a/sshd-core/src/main/java/org/apache/sshd/server/x11/X11ForwardSupport.java
+++ b/sshd-core/src/main/java/org/apache/sshd/server/x11/X11ForwardSupport.java
@@ -167,8 +167,8 @@ public class X11ForwardSupport extends CloseableUtils.AbstractInnerCloseable imp
         ChannelForwardedX11 channel = (ChannelForwardedX11) session.getAttribute(ChannelForwardedX11.class);
         Buffer buffer = new Buffer();
         buffer.putBuffer(message);
-        channel.getOut().write(buffer.array(), buffer.rpos(), buffer.available());
-        channel.getOut().flush();
+        channel.getInvertedIn().write(buffer.array(), buffer.rpos(), buffer.available());
+        channel.getInvertedIn().flush();
     }
 
     public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
@@ -204,7 +204,7 @@ public class X11ForwardSupport extends CloseableUtils.AbstractInnerCloseable imp
 
         @Override
         protected synchronized void doOpen() throws IOException {
-            out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
+            invertedIn = out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/f1381667/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
----------------------------------------------------------------------
diff --git a/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java b/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
index 43303ea..f41f753 100644
--- a/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
@@ -280,10 +280,10 @@ public class PortForwardingTest extends BaseTest {
         ChannelDirectTcpip channel = session.createDirectTcpipChannel(local, remote);
         channel.open().await();
 
-        channel.getOut().write("Hello".getBytes());
-        channel.getOut().flush();
+        channel.getInvertedIn().write("Hello".getBytes());
+        channel.getInvertedIn().flush();
         byte[] buf = new byte[1024];
-        int n = channel.getIn().read(buf);
+        int n = channel.getInvertedOut().read(buf);
         String res = new String(buf, 0, n);
         assertEquals("Hello", res);
         channel.close(false);