Mercurial > hg > Applications > TightVNC_orginal
changeset 18:075fb190d5d4
modify protocol.java
author | one |
---|---|
date | Tue, 28 Aug 2012 20:03:44 +0900 |
parents | 718cdde720d4 |
children | ea83f4be0cc9 |
files | src/main/java/com/glavsoft/rfb/encoding/ServerInitMessage.java src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java src/main/java/com/glavsoft/rfb/protocol/state/InitState.java src/main/java/jp/ac/u_ryukyu/treevnc/server/MyRfbProtoProxy.java src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java |
diffstat | 6 files changed, 26 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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();
--- 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;
--- 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
--- 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()); }
--- 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; + } }
--- 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) {