Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 525:fea7651ca24f
fix Broadcast packet offset
author | k.fukuda |
---|---|
date | Tue, 05 Mar 2019 19:33:33 +0900 |
parents | ef2f70aee45a |
children | fcd833c2e148 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Sun Mar 03 18:56:42 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Mar 05 19:33:33 2019 +0900 @@ -120,7 +120,7 @@ // pass the input stream to the TreeVNC protocol reader return; } - byte messageId = getMessageId(); + byte messageId = getMessageId(reader); switch (messageId) { case FRAMEBUFFER_UPDATE: @@ -193,7 +193,7 @@ } } - public byte getMessageId() throws Exception { + public byte getMessageId(Reader reader) throws Exception { if(! rfb.isTreeManager() && rfb.isAddSerialNum()) { // client has 8byte packet sequence number // add serial number flag (4byte) @@ -244,7 +244,7 @@ int numberOfRectangles; try { reader.readByte(); // padding - numberOfRectangles = this.reader.readUInt16(); + numberOfRectangles = reader.readUInt16(); if(numberOfRectangles > 3) { System.out.println("numberofrectangle : " + numberOfRectangles); if (rfb.getViewer().getUseMulticast()){
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Sun Mar 03 18:56:42 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Tue Mar 05 19:33:33 2019 +0900 @@ -65,7 +65,7 @@ boolean isTreeRoot = rfb.isTreeManager(); if (receiverTask != null) { Reader reader = new Reader(new ByteArrayInputStream(reply)); - if (receiverTask.getMessageId() == FRAMEBUFFER_UPDATE) { + if (receiverTask.getMessageId(reader) == FRAMEBUFFER_UPDATE) { receiverTask.framebufferUpdateMessage(reader); } }