diff options
author | Kenny Root <kenny@the-b.org> | 2009-06-20 01:43:41 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2009-06-20 01:43:41 +0000 |
commit | 2b73500e56675a0c1bfb8261770d52515223ea98 (patch) | |
tree | ddc197ca2b504f3abad13e2589a154193550df49 /src | |
parent | 67be2e8f774872dd3923ddd75a15b91911888d28 (diff) | |
download | connectbot-2b73500e56675a0c1bfb8261770d52515223ea98.tar.gz connectbot-2b73500e56675a0c1bfb8261770d52515223ea98.tar.bz2 connectbot-2b73500e56675a0c1bfb8261770d52515223ea98.zip |
Synchronize charset changing
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@320 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src')
-rw-r--r-- | src/org/connectbot/service/Relay.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/connectbot/service/Relay.java b/src/org/connectbot/service/Relay.java index c15f3f4..cd1c227 100644 --- a/src/org/connectbot/service/Relay.java +++ b/src/org/connectbot/service/Relay.java @@ -78,7 +78,9 @@ public class Relay implements Runnable { newCd.onMalformedInput(CodingErrorAction.REPLACE); currentCharset = charset; - decoder = newCd; + synchronized (this) { + decoder = newCd; + } } public void run() { @@ -97,7 +99,9 @@ public class Relay implements Runnable { if (bytesRead > 0) { byteBuffer.position(0); byteBuffer.limit(bytesRead); - decoder.decode(byteBuffer, charBuffer, false); + synchronized (this) { + decoder.decode(byteBuffer, charBuffer, false); + } buffer.putString(charArray, 0, charBuffer.position()); charBuffer.clear(); bridge.redraw(); |