# HG changeset patch # User one # Date 1346151824 -32400 # Node ID 075fb190d5d426faa10bdace0beed890756ed2be # Parent 718cdde720d4b70424a10d3d13a133327eef6094 modify protocol.java diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/com/glavsoft/rfb/encoding/ServerInitMessage.java --- a/src/main/java/com/glavsoft/rfb/encoding/ServerInitMessage.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/ServerInitMessage.java Tue Aug 28 20:03:44 2012 +0900 @@ -68,6 +68,10 @@ public PixelFormat getPixelFormat() { return pixelFormat; } + + public byte[] getInitData() { + return initData; + } public String getName() { return name; @@ -83,7 +87,6 @@ } public void readServerInit(Reader reader) throws TransportException { - reader.mark(255); reader.skypBytes(20); int nlen = reader.readInt32(); diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/com/glavsoft/rfb/protocol/Protocol.java --- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Tue Aug 28 20:03:44 2012 +0900 @@ -65,6 +65,7 @@ private PixelFormat serverPixelFormat; private Thread senderThread; private Thread receiverThread; + private byte[] initData; public Protocol(Reader reader, Writer writer, IPasswordRetriever passwordRetriever, ProtocolSettings settings) { @@ -89,7 +90,7 @@ } this.messageQueue = new MessageQueue(); } - + @Override public PixelFormat getPixelFormat() { return pixelFormat; @@ -128,6 +129,16 @@ return fbHeight; } + @Override + public byte[] getInitData() { + return initData; + } + + @Override + public void setInitData(byte[] initData) { + this.initData = initData; + } + @Override public void setFbHeight(int fbHeight) { this.fbHeight = fbHeight; diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java --- a/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Tue Aug 28 20:03:44 2012 +0900 @@ -45,6 +45,8 @@ Writer getWriter(); Reader getReader(); + + byte[] getInitData(); int getFbWidth(); void setFbWidth(int frameBufferWidth); @@ -65,4 +67,6 @@ void cleanUpSession(String message); + void setInitData(byte[] initData); + } \ No newline at end of file diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/com/glavsoft/rfb/protocol/state/InitState.java --- a/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/state/InitState.java Tue Aug 28 20:03:44 2012 +0900 @@ -79,6 +79,7 @@ context.setFbWidth(serverInitMessage.getFrameBufferWidth()); context.setFbHeight(serverInitMessage.getFrameBufferHeight()); context.setRemoteDesktopName(serverInitMessage.getName()); + context.setInitData(serverInitMessage.getInitData()); logger.fine(serverInitMessage.toString()); } diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java Tue Aug 28 20:03:44 2012 +0900 @@ -798,5 +798,8 @@ os.write(b); } - + + public void setInitData(byte[] _initData) { + initData = _initData; + } } diff -r 718cdde720d4 -r 075fb190d5d4 src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Tue Aug 28 17:36:49 2012 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Tue Aug 28 20:03:44 2012 +0900 @@ -147,6 +147,7 @@ surface = new Surface(workingProtocol, this, uiSettings.getScaleFactor()); workingProtocol.startNormalHandling(this, surface, clipboardController,rfb); + rfb.setInitData(workingProtocol.getInitData()); // workingProtocol.startNormalHandling(this, surface, clipboardController); tryAgain = false; } catch (UnsupportedProtocolVersionException e) {