summaryrefslogtreecommitdiffstats
path: root/java/com
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2012-04-25 03:49:10 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2012-04-25 03:49:10 +0000
commit2b6dd6a4f7d5eb8bdcf4413a430e1d8e85514af4 (patch)
tree81e5ded3aa40a50aae6487c05bc6963f916b8672 /java/com
parente4363d65dd3cc8f01ec974713f3ecb0702548d31 (diff)
downloadtigervnc-2b6dd6a4f7d5eb8bdcf4413a430e1d8e85514af4.tar.gz
tigervnc-2b6dd6a4f7d5eb8bdcf4413a430e1d8e85514af4.zip
Spawn a new viewer on ClientRedirects, otherwise ConnParams may not be initialized correctly.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4895 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com')
-rw-r--r--java/com/tigervnc/vncviewer/CConn.java4
-rw-r--r--java/com/tigervnc/vncviewer/VncViewer.java10
2 files changed, 9 insertions, 5 deletions
diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java
index 154a719c..714dff04 100644
--- a/java/com/tigervnc/vncviewer/CConn.java
+++ b/java/com/tigervnc/vncviewer/CConn.java
@@ -388,9 +388,7 @@ public class CConn extends CConnection
setServerPort(port);
sock = new TcpSocket(host, port);
vlog.info("Redirected to "+host+":"+port);
- setStreams(sock.inStream(), sock.outStream());
- sock.inStream().setBlockCallback(this);
- initialiseProtocol();
+ viewer.newViewer(viewer, sock, true);
} catch (java.lang.Exception e) {
throw new Exception(e.toString());
}
diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java
index 26f41b62..799ee5d8 100644
--- a/java/com/tigervnc/vncviewer/VncViewer.java
+++ b/java/com/tigervnc/vncviewer/VncViewer.java
@@ -247,12 +247,18 @@ public class VncViewer extends java.applet.Applet implements Runnable
firstApplet = true;
}
- public static void newViewer(VncViewer oldViewer, Socket sock) {
+ public static void newViewer(VncViewer oldViewer, Socket sock, boolean close) {
VncViewer viewer = new VncViewer();
viewer.applet = oldViewer.applet;
- viewer.firstApplet = false;
+ viewer.firstApplet = (close) ? true : false;
viewer.sock = sock;
viewer.start();
+ if (close)
+ oldViewer.stop();
+ }
+
+ public static void newViewer(VncViewer oldViewer, Socket sock) {
+ newViewer(oldViewer, sock, false);
}
public static void newViewer(VncViewer oldViewer) {