Mercurial > hg > Applications > TreeVNC
changeset 612:42ddba3af8b2
fix_handleMulticastFramBufferUpdate_args
author | anatofuz |
---|---|
date | Fri, 21 Feb 2020 17:23:19 +0900 |
parents | 9a2bef3f3020 |
children | 994a710100fd |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java |
diffstat | 3 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 21 11:52:14 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 21 17:23:19 2020 +0900 @@ -3,7 +3,6 @@ import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; -import com.glavsoft.rfb.protocol.NullRenderer; import jp.ac.u_ryukyu.treevnc.TreeRFBProto; import com.glavsoft.drawing.Renderer; @@ -25,15 +24,15 @@ } boolean broadcast = false; - boolean muticast = false; + boolean multicast = false; boolean ZREEstream = false; public void setBroadcast(boolean broadcast) { this.broadcast = broadcast; } - public void setMuticast(boolean muticast) { - this.muticast = muticast; + public void setMulticast(boolean multicast) { + this.multicast = multicast; } public void setZREEstream(boolean ZREEstream) { @@ -59,7 +58,7 @@ decoder.multicastDecode(reader, renderer, rect, rfb); reader.reset(); } - if (muticast) { + if (multicast) { ByteBuffer header = rfb.readSendData(dataLen, reader, buf.array(), rect); decoder.decode1(renderer, header, rect, buf, 0, rfb); } @@ -68,8 +67,10 @@ // no reencoding is required // readSend does not peform unzip, do the fullrecoding // no broadcast - rfb.readSendData(dataLen, reader, null, rect); - reader.reset(); + if (multicast) { + rfb.readSendData(dataLen, reader, null, rect); + reader.reset(); + } if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { reader.skip(24); } else { @@ -84,7 +85,7 @@ decoder.multicastDecode(reader, renderer, rect, rfb); reader.reset(); } - if (muticast) { + if (multicast) { byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; rfb.readSendData(dataLen, reader, bytes, rect); }
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 21 11:52:14 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 21 17:23:19 2020 +0900 @@ -43,11 +43,9 @@ import java.io.*; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.LinkedList; import java.util.Timer; import java.util.logging.Logger; -import java.util.Objects; public class ReceiverTask implements Runnable { @@ -87,7 +85,7 @@ ZRLEESender zdecdoder = new ZRLEESender(rfb); Decoder decoder = zdecdoder; - if (rfb.isTreeManager()) zdecdoder.setMuticast(true); + if (rfb.isTreeManager()) zdecdoder.setMulticast(true); if (rfb.multicastBlocking || rfb.getViewer().getUseMulticast()) zdecdoder.setBroadcast(true); decoders.setDecoderByType(EncodingType.ZLIB, decoder); decoders.setDecoderByType(EncodingType.ZRLE, decoder);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 21 11:52:14 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 21 17:23:19 2020 +0900 @@ -59,7 +59,7 @@ byte[] reply = recvPacket.getData(); if (receiverTask != null) { if (reply[0] == FRAMEBUFFER_UPDATE) { - receiverTask.handleMulticastFrameBufferUpdate(ByteBuffer.wrap(reply)); + receiverTask.handleMulticastFrameBufferUpdate(ByteBuffer.wrap(reply,recvPacket.getOffset(), recvPacket.getLength())); } } } catch (Exception e) {