# HG changeset patch # User Shinji KONO # Date 1550795650 -32400 # Node ID 8401dbe0d58363e2770dcf542a8aed9c35877926 # Parent 1646be89095459cfba52a602c7680c277ac14dc2 fix diff -r 1646be890954 -r 8401dbe0d583 .idea/modules.xml --- a/.idea/modules.xml Thu Feb 21 19:45:56 2019 +0900 +++ b/.idea/modules.xml Fri Feb 22 09:34:10 2019 +0900 @@ -2,6 +2,7 @@ + diff -r 1646be890954 -r 8401dbe0d583 src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java --- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Thu Feb 21 19:45:56 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Feb 22 09:34:10 2019 +0900 @@ -775,6 +775,7 @@ CheckDelay.checkDelay(c1, rect.x, rect.y, rect.width, rect.height, System.currentTimeMillis(), EncodingType.CHECK_DELAY); c1headerPos = c1.position(); c1.put(header); + header.flip(); c1.putInt(0); c1rect = new FramebufferUpdateRectangle(rect.x, rect.y, 0, 0); return; @@ -787,9 +788,9 @@ if (c1.remaining() < span || c1rect.x + c1rect.width + tilex >= rect.x + rect.width ) { deflater.deflate(c1, Deflater.FULL_FLUSH); c1.flip(); - System.out.println("multicastPut: " + c1rect + " length: " + c1.remaining()); + System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); try { - writeUpdateRectangleWithHeader(c1, c1headerPos, c1.remaining(), c1rect.x, c1rect.y, c1rect.width, c1rect.height); + writeUpdateRectangleWithHeader(c1, c1headerPos, c1.remaining()-c1headerPos-header.limit(), c1rect.x, c1rect.y, c1rect.width, c1rect.height); } catch (InterruptedException e) { e.printStackTrace(); } @@ -829,7 +830,7 @@ multicastqueue.waitput(bufs); byte[] bytes = c1.array(); System.out.println(" bytes: " + bytes[headerPos + 20] + ", " + bytes[headerPos + 21] + ", " + bytes[headerPos + 22] + ", " + bytes[headerPos + 23]); - System.out.println(" bytes: " + bytes[len2 - 4] + ", " + bytes[len2 - 3] + ", " + bytes[len2 - 2] + ", " + bytes[len2 - 1]); + System.out.println(" bytes: " + bytes[headerPos+ len2 - 4] + ", " + bytes[headerPos+len2 - 3] + ", " + bytes[headerPos+len2 - 2] + ", " + bytes[headerPos+len2 - 1]); } public LinkedList createCheckDelayHeader(LinkedList checkDelay, ByteBuffer header) {