diff options
author | Kenny Root <kenny@the-b.org> | 2009-06-24 04:50:17 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2009-06-24 04:50:17 +0000 |
commit | 77440a7c3f4b9b2aa4918d290e0b2f37370a131c (patch) | |
tree | fd72b963e1f57792be617f1767b3cdab84e19555 | |
parent | bb34d2e6e0d8df6544fe69f5ad41899368781f1a (diff) | |
download | connectbot-77440a7c3f4b9b2aa4918d290e0b2f37370a131c.tar.gz connectbot-77440a7c3f4b9b2aa4918d290e0b2f37370a131c.tar.bz2 connectbot-77440a7c3f4b9b2aa4918d290e0b2f37370a131c.zip |
Bugfix for Telnet to work with new CharsetDecoder
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@328 df292f66-193f-0410-a5fc-6d59da041ff2
-rw-r--r-- | src/de/mud/telnet/TelnetProtocolHandler.java | 7 | ||||
-rw-r--r-- | src/org/connectbot/transport/Telnet.java | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/de/mud/telnet/TelnetProtocolHandler.java b/src/de/mud/telnet/TelnetProtocolHandler.java index 3d24d12..fd4d034 100644 --- a/src/de/mud/telnet/TelnetProtocolHandler.java +++ b/src/de/mud/telnet/TelnetProtocolHandler.java @@ -638,11 +638,10 @@ public abstract class TelnetProtocolHandler { } public void inputfeed(byte[] b, int offset, int len) { - byte[] xb = new byte[tempbuf.length+offset+len]; + byte[] xb = new byte[tempbuf.length+len]; - System.arraycopy(b,0,xb,0,offset); - System.arraycopy(tempbuf,0,xb,offset,tempbuf.length); - System.arraycopy(b,offset,xb,offset+tempbuf.length,len); + System.arraycopy(tempbuf,0,xb,0,tempbuf.length); + System.arraycopy(b,offset,xb,tempbuf.length,len); tempbuf = xb; } } diff --git a/src/org/connectbot/transport/Telnet.java b/src/org/connectbot/transport/Telnet.java index 613e1de..681da45 100644 --- a/src/org/connectbot/transport/Telnet.java +++ b/src/org/connectbot/transport/Telnet.java @@ -172,7 +172,7 @@ public class Telnet extends AbsTransport { do { n = handler.negotiate(buffer, start); if (n > 0) - return start + n; + return n; } while (n == 0); while (n <= 0) { @@ -187,7 +187,7 @@ public class Telnet extends AbsTransport { throw new IOException("Remote end closed connection."); } - handler.inputfeed(buffer, start, n - start); + handler.inputfeed(buffer, start, n); n = handler.negotiate(buffer, start); } return n; |