svn commit: r831369 - in /mina/sshd/trunk: ./ sshd-core/ sshd-core/src/main/java/org/apache/sshd/client/channel/ sshd-core/src/main/java/org/apache/sshd/common/ sshd-core/src/main/java/org/apache/sshd/server/channel/ sshd-core/src/main/java/org/apache/...

View: New views
1 Messages — Rating Filter:   Alert me  

svn commit: r831369 - in /mina/sshd/trunk: ./ sshd-core/ sshd-core/src/main/java/org/apache/sshd/client/channel/ sshd-core/src/main/java/org/apache/sshd/common/ sshd-core/src/main/java/org/apache/sshd/server/channel/ sshd-core/src/main/java/org/apache/...

by gnodet-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Author: gnodet
Date: Fri Oct 30 16:17:45 2009
New Revision: 831369

URL: http://svn.apache.org/viewvc?rev=831369&view=rev
Log:
SSHD-40: Slightly refactor the Channel api to avoid a call to future.await() in ChannelDirectTcpip which can cause a deadlock exception to be thrown.  This should fix the last problems on tcpip port forwarding hopefully

Added:
    mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/
    mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/
    mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/SttySupportTest.java
      - copied, changed from r831266, mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/util/SttySupportTest.java
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-1.txt
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-2.txt
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/util/
Removed:
    mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/util/SttySupportTest.java
    mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/client/
Modified:
    mina/sshd/trunk/pom.xml
    mina/sshd/trunk/sshd-core/pom.xml
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/common/Channel.java
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/AbstractServerChannel.java
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelDirectTcpip.java
    mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/session/ServerSession.java
    mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java

Modified: mina/sshd/trunk/pom.xml
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/pom.xml?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/pom.xml (original)
+++ mina/sshd/trunk/pom.xml Fri Oct 30 16:17:45 2009
@@ -134,6 +134,11 @@
                 <artifactId>jpam</artifactId>
                 <version>1.1</version>
             </dependency>
+            <dependency>
+                <groupId>commons-httpclient</groupId>
+                <artifactId>commons-httpclient</artifactId>
+                <version>3.1</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

Modified: mina/sshd/trunk/sshd-core/pom.xml
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/pom.xml?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/pom.xml (original)
+++ mina/sshd/trunk/sshd-core/pom.xml Fri Oct 30 16:17:45 2009
@@ -83,6 +83,11 @@
             <artifactId>jline</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/client/channel/AbstractClientChannel.java Fri Oct 30 16:17:45 2009
@@ -171,6 +171,10 @@
         return openFuture;
     }
 
+    public OpenFuture open(int recipient, int rwsize, int rmpsize, Buffer buffer) {
+        throw new IllegalStateException();
+    }
+
     public void handleOpenSuccess(int recipient, int rwsize, int rmpsize, Buffer buffer) {
         synchronized (lock) {
             this.recipient = recipient;

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/common/Channel.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/common/Channel.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/common/Channel.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/common/Channel.java Fri Oct 30 16:17:45 2009
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 
+import org.apache.sshd.client.future.OpenFuture;
 import org.apache.sshd.common.channel.Window;
 import org.apache.sshd.common.future.CloseFuture;
 import org.apache.sshd.common.util.Buffer;
@@ -55,8 +56,21 @@
 
     void init(Session session, int id) throws IOException;
 
+    /**
+     * For a server channel, this method will actually open the channel
+     */
+    OpenFuture open(int recipient, int rwsize, int rmpsize, Buffer buffer);
+
+    /**
+     * For a client channel, this method will be called internally by the session when the confirmation
+     * has been received.
+     */
     void handleOpenSuccess(int recipient, int rwsize, int rmpsize, Buffer buffer) throws IOException;
 
+    /**
+     * For a client channel, this method will be called internally by the session when
+     * the server has rejected this channel opening.
+     */
     void handleOpenFailure(Buffer buffer) throws IOException;
 
 }

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/AbstractServerChannel.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/AbstractServerChannel.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/AbstractServerChannel.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/AbstractServerChannel.java Fri Oct 30 16:17:45 2009
@@ -20,6 +20,8 @@
 
 import java.io.IOException;
 
+import org.apache.sshd.client.future.DefaultOpenFuture;
+import org.apache.sshd.client.future.OpenFuture;
 import org.apache.sshd.common.SshConstants;
 import org.apache.sshd.common.channel.AbstractChannel;
 import org.apache.sshd.common.util.Buffer;
@@ -33,18 +35,25 @@
 
     protected boolean exitStatusSent;
 
-    public void handleOpenSuccess(int recipient, int rwsize, int rmpsize, Buffer buffer) throws IOException {
+    public OpenFuture open(int recipient, int rwsize, int rmpsize, Buffer buffer) {
         this.recipient = recipient;
         this.remoteWindow.init(rwsize, rmpsize);
         configureWindow();
-        doInit(buffer);
+        return doInit(buffer);
+    }
+
+    public void handleOpenSuccess(int recipient, int rwsize, int rmpsize, Buffer buffer) throws IOException {
+        throw new IllegalStateException();
     }
 
     public void handleOpenFailure(Buffer buffer) {
         throw new IllegalStateException();
     }
 
-    protected void doInit(Buffer buffer) throws IOException {
+    protected OpenFuture doInit(Buffer buffer) {
+        OpenFuture f = new DefaultOpenFuture(this);
+        f.setOpened();
+        return f;
     }
 
     protected void sendExitStatus(int v) throws IOException {

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelDirectTcpip.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelDirectTcpip.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelDirectTcpip.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelDirectTcpip.java Fri Oct 30 16:17:45 2009
@@ -25,11 +25,14 @@
 
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.future.ConnectFuture;
+import org.apache.mina.core.future.IoFutureListener;
 import org.apache.mina.core.service.IoConnector;
 import org.apache.mina.core.service.IoHandler;
 import org.apache.mina.core.service.IoHandlerAdapter;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.transport.socket.nio.NioSocketConnector;
+import org.apache.sshd.client.future.DefaultOpenFuture;
+import org.apache.sshd.client.future.OpenFuture;
 import org.apache.sshd.common.Channel;
 import org.apache.sshd.common.NamedFactory;
 import org.apache.sshd.common.SshConstants;
@@ -64,7 +67,8 @@
     public ChannelDirectTcpip() {
     }
 
-    protected void doInit(Buffer buffer) throws IOException {
+    protected OpenFuture doInit(Buffer buffer) {
+        final OpenFuture f = new DefaultOpenFuture(this);
         String hostToConnect = buffer.getString();
         int portToConnect = buffer.getInt();
         String originatorIpAddress = buffer.getString();
@@ -86,11 +90,18 @@
         };
         connector.setHandler(handler);
         ConnectFuture future = connector.connect(new InetSocketAddress(hostToConnect, portToConnect));
-        try {
-            ioSession = future.await().getSession();
-        } catch (InterruptedException e) {
-            throw (IOException) new InterruptedIOException().initCause(e);
-        }
+        future.addListener(new IoFutureListener<ConnectFuture>() {
+            public void operationComplete(ConnectFuture future) {
+                if (future.isConnected()) {
+                    ioSession = future.getSession();
+                    f.setOpened();
+                } else if (future.getException() != null) {
+                    close(false);
+                    f.setException(future.getException());
+                }
+            }
+        });
+        return f;
     }
 
     public CloseFuture close(boolean immediately) {

Modified: mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/session/ServerSession.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/session/ServerSession.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/session/ServerSession.java (original)
+++ mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/session/ServerSession.java Fri Oct 30 16:17:45 2009
@@ -26,6 +26,7 @@
 import java.util.TimerTask;
 
 import org.apache.mina.core.session.IoSession;
+import org.apache.sshd.client.future.OpenFuture;
 import org.apache.sshd.common.Channel;
 import org.apache.sshd.common.FactoryManager;
 import org.apache.sshd.common.KeyExchange;
@@ -33,6 +34,7 @@
 import org.apache.sshd.common.SshConstants;
 import org.apache.sshd.common.SshException;
 import org.apache.sshd.common.future.CloseFuture;
+import org.apache.sshd.common.future.SshFutureListener;
 import org.apache.sshd.common.session.AbstractSession;
 import org.apache.sshd.common.util.Buffer;
 import org.apache.sshd.server.ServerFactoryManager;
@@ -356,9 +358,9 @@
 
     private void channelOpen(Buffer buffer) throws Exception {
         String type = buffer.getString();
-        int id = buffer.getInt();
-        int rwsize = buffer.getInt();
-        int rmpsize = buffer.getInt();
+        final int id = buffer.getInt();
+        final int rwsize = buffer.getInt();
+        final int rmpsize = buffer.getInt();
 
         log.info("Received SSH_MSG_CHANNEL_OPEN {}", type);
 
@@ -381,13 +383,7 @@
             return;
         }
 
-        Channel channel = null;
-        for (NamedFactory<Channel> factory : getServerFactoryManager().getChannelFactories()) {
-            if (factory.getName().equals(type)) {
-                channel = factory.create();
-                break;
-            }
-        }
+        final Channel channel = NamedFactory.Utils.create(getServerFactoryManager().getChannelFactories(), type);
         if (channel == null) {
             Buffer buf = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
             buf.putInt(id);
@@ -398,16 +394,32 @@
             return;
         }
 
-        int channelId = getNextChannelId();
+        final int channelId = getNextChannelId();
         channels.put(channelId, channel);
         channel.init(this, channelId);
-        channel.handleOpenSuccess(id, rwsize, rmpsize, buffer);
-        Buffer buf = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
-        buf.putInt(id);
-        buf.putInt(channelId);
-        buf.putInt(channel.getLocalWindow().getSize());
-        buf.putInt(channel.getLocalWindow().getPacketSize());
-        writePacket(buf);
+        channel.open(id, rwsize, rmpsize, buffer).addListener(new SshFutureListener<OpenFuture>() {
+            public void operationComplete(OpenFuture future) {
+                try {
+                    if (future.isOpened()) {
+                        Buffer buf = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
+                        buf.putInt(id);
+                        buf.putInt(channelId);
+                        buf.putInt(channel.getLocalWindow().getSize());
+                        buf.putInt(channel.getLocalWindow().getPacketSize());
+                        writePacket(buf);
+                    } else if (future.getException() != null) {
+                        Buffer buf = createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN_FAILURE);
+                        buf.putInt(id);
+                        buf.putInt(0);
+                        buf.putString("Error opening channel: " + future.getException().getMessage());
+                        buf.putString("");
+                        writePacket(buf);
+                    }
+                } catch (IOException e) {
+                    exceptionCaught(e);
+                }
+            }
+        });
     }
 
     private void globalRequest(Buffer buffer) throws Exception {

Modified: mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java?rev=831369&r1=831368&r2=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java (original)
+++ mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java Fri Oct 30 16:17:45 2009
@@ -18,14 +18,18 @@
  */
 package org.apache.sshd;
 
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.Logger;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.UserInfo;
+import java.io.*;
+import java.net.*;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+
+import com.jcraft.jsch.*;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpVersion;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
+import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.service.IoAcceptor;
 import org.apache.mina.core.service.IoHandlerAdapter;
@@ -36,9 +40,11 @@
 import org.apache.sshd.util.EchoShellFactory;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Port forwarding tests
@@ -101,37 +107,7 @@
 
     @Test
     public void testRemoteForwarding() throws Exception {
-        JSch sch = new JSch();
-        sch.setLogger(new Logger() {
-            public boolean isEnabled(int i) {
-                return true;
-            }
-
-            public void log(int i, String s) {
-                System.out.println("Log(jsch," + i + "): " + s);
-            }
-        });
-        Session session = sch.getSession("sshd", "localhost", sshPort);
-        session.setUserInfo(new UserInfo() {
-            public String getPassphrase() {
-                return null;
-            }
-            public String getPassword() {
-                return "sshd";
-            }
-            public boolean promptPassword(String message) {
-                return true;
-            }
-            public boolean promptPassphrase(String message) {
-                return false;
-            }
-            public boolean promptYesNo(String message) {
-                return true;
-            }
-            public void showMessage(String message) {
-            }
-        });
-        session.connect();
+        Session session = createSession();
 
         int forwardedPort = getFreePort();
         session.setPortForwardingR(forwardedPort, "localhost", echoPort);
@@ -153,12 +129,32 @@
 
     @Test
     public void testLocalForwarding() throws Exception {
+        Session session = createSession();
+
+        int forwardedPort = getFreePort();
+        session.setPortForwardingL(forwardedPort, "localhost", echoPort);
+
+        Socket s = new Socket("localhost", forwardedPort);
+        s.getOutputStream().write("Hello".getBytes());
+        s.getOutputStream().flush();
+        byte[] buf = new byte[1024];
+        int n = s.getInputStream().read(buf);
+        String res = new String(buf, 0, n);
+        assertEquals("Hello", res);
+        s.close();
+
+        session.delPortForwardingL(forwardedPort);
+
+//        session.setPortForwardingL(8010, "www.amazon.com", 80);
+//        Thread.sleep(1000000);
+    }
+
+    protected Session createSession() throws JSchException {
         JSch sch = new JSch();
         sch.setLogger(new Logger() {
             public boolean isEnabled(int i) {
                 return true;
             }
-
             public void log(int i, String s) {
                 System.out.println("Log(jsch," + i + "): " + s);
             }
@@ -184,24 +180,86 @@
             }
         });
         session.connect();
+        return session;
+    }
 
-        int forwardedPort = getFreePort();
-        session.setPortForwardingL(forwardedPort, "localhost", echoPort);
+    @Test
+    @Ignore
+    public void testForwardingOnLoad() throws Exception {
+        Session session = createSession();
+
+        final int forwardedPort1 = getFreePort();
+        final int forwardedPort2 = getFreePort();
+        session.setPortForwardingL(forwardedPort1, "www.microsoft.com", 80);
+        session.setPortForwardingR(forwardedPort2, "localhost", forwardedPort1);
+
+
+        final int nbThread = 20;
+        final int nbDownloads = 20;
+        final CountDownLatch latch = new CountDownLatch(nbThread * nbDownloads);
+
+        final Thread[] threads = new Thread[nbThread];
+        final List<Throwable> errors = new CopyOnWriteArrayList<Throwable>();
+        final HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
+        client.getHttpConnectionManager().getParams().setDefaultMaxConnectionsPerHost(100);
+        client.getHttpConnectionManager().getParams().setMaxTotalConnections(1000);
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Thread() {
+                public void run() {
+                    for (int i = 0; i < nbDownloads; i++) {
+                        try {
+                            checkHtmlPage(client, new URL("http://localhost:" + forwardedPort2));
+                        } catch (Throwable e) {
+                            errors.add(e);
+                        } finally {
+                            latch.countDown();
+                            System.err.println("Remaining: " + latch.getCount());
+                        }
+                    }
+                }
+            };
+        }
+        for (int i = 0; i < threads.length; i++) {
+            threads[i].start();
+        }
+        latch.await();
+        for (Throwable t : errors) {
+            t.printStackTrace();
+        }
+        assertEquals(0, errors.size());
+    }
 
-        Socket s = new Socket("localhost", forwardedPort);
-        s.getOutputStream().write("Hello".getBytes());
-        s.getOutputStream().flush();
-        byte[] buf = new byte[1024];
-        int n = s.getInputStream().read(buf);
-        String res = new String(buf, 0, n);
-        assertEquals("Hello", res);
-        s.close();
+    protected void checkHtmlPage(HttpClient client, URL url) throws IOException {
+        client.setHostConfiguration(new HostConfiguration());
+        client.getHostConfiguration().setHost(url.getHost(), url.getPort());
+        GetMethod get = new GetMethod("");
+        get.getParams().setVersion(HttpVersion.HTTP_1_1);
+        client.executeMethod(get);
+        String str = get.getResponseBodyAsString();
+        if (str.indexOf("</html>") <= 0) {
+            System.err.println(str);
+        }
+        assertTrue((str.indexOf("</html>") > 0));
+        get.releaseConnection();
+//        url.openConnection().setDefaultUseCaches(false);
+//        Reader reader = new BufferedReader(new InputStreamReader(url.openStream()));
+//        try {
+//            StringWriter sw = new StringWriter();
+//            char[] buf = new char[8192];
+//            while (true) {
+//                int len = reader.read(buf);
+//                if (len < 0) {
+//                    break;
+//                }
+//                sw.write(buf, 0, len);
+//            }
+//            assertTrue(sw.toString().indexOf("</html>") > 0);
+//        } finally {
+//            reader.close();
+//        }
+    }
 
-        session.delPortForwardingL(forwardedPort);
 
-//        session.setPortForwardingL(8010, "www.amazon.com", 80);
-//        Thread.sleep(1000000);
-    }
 }
 
 

Copied: mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/SttySupportTest.java (from r831266, mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/util/SttySupportTest.java)
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/SttySupportTest.java?p2=mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/SttySupportTest.java&p1=mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/util/SttySupportTest.java&r1=831266&r2=831369&rev=831369&view=diff
==============================================================================
--- mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/util/SttySupportTest.java (original)
+++ mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/common/util/SttySupportTest.java Fri Oct 30 16:17:45 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sshd.util;
+package org.apache.sshd.common.util;
 
 import org.apache.sshd.common.PtyMode;
 import org.apache.sshd.common.util.SttySupport;

Added: mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-1.txt
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-1.txt?rev=831369&view=auto
==============================================================================
--- mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-1.txt (added)
+++ mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-1.txt Fri Oct 30 16:17:45 2009
@@ -0,0 +1,10 @@
+speed 38400 baud; rows 25; columns 80; line = 0;
+intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
+eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
+werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
+-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
+-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
+-iuclc -ixany -imaxbel -iutf8
+opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
+isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
+echoctl echoke

Added: mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-2.txt
URL: http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-2.txt?rev=831369&view=auto
==============================================================================
--- mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-2.txt (added)
+++ mina/sshd/trunk/sshd-core/src/test/resources/org/apache/sshd/common/util/stty-output-2.txt Fri Oct 30 16:17:45 2009
@@ -0,0 +1,13 @@
+speed 9600 baud; 50 rows; 160 columns;
+lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
+ -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
+ -extproc
+iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
+ -ignbrk brkint -inpck -ignpar -parmrk
+oflags: opost onlcr -oxtabs -onocr -onlret
+cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
+ -dtrflow -mdmbuf
+cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
+ eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
+ min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
+ stop = ^S; susp = ^Z; time = 0; werase = ^W;