Mercurial > hg > Applications > TreeVNC
changeset 566:e93a8058344d
several fixes
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 03 Feb 2020 19:56:08 +0900 |
parents | 2a601e25ce10 |
children | ac8fd355b8bb |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/encoding/decoder/ZlibDecoder.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java |
diffstat | 7 files changed, 18 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Feb 03 19:56:08 2020 +0900 @@ -73,10 +73,10 @@ * @throws UnsupportedEncodingException */ - public TileLoop(int offset) { + public TileLoop(TreeRFBProto rfb, int offset) { prevoffset = prevLineOffset = offset; prevC1Offset = 0; - if (offset < deflate_size + spanGap) { + if (rfb == null || offset < deflate_size + spanGap) { // packet size fit in broadcast send it all at once blocking = false; } else @@ -266,7 +266,7 @@ int maxX = rect.x + rect.width; int maxY = rect.y + rect.height; - TileLoop tileloop = new TileLoop(zippedLength); + TileLoop tileloop = new TileLoop(rfbProto, zippedLength); //System.out.println("decode1: "+rect.toString()); if (null == palette) { palette = new int[128]; @@ -275,17 +275,18 @@ decodedBitmap = new int[MAX_TILE_SIZE * MAX_TILE_SIZE]; } - if (rfbProto.multicastBlocking) { + if (rfbProto !=null && rfbProto.multicastBlocking) { tileloop.zrleeBlocking(rfbProto, header, rect, bytes); } try { for (int tileY = rect.y; tileY < maxY; tileY += MAX_TILE_SIZE) { int tileHeight = Math.min(maxY - tileY, MAX_TILE_SIZE); - tileloop.c1rect.height += tileHeight; + if (tileloop.blocking) + tileloop.c1rect.height += tileHeight; for (int tileX = rect.x; tileX < maxX; tileX += MAX_TILE_SIZE) { int tileWidth = Math.min(maxX - tileX, MAX_TILE_SIZE); - if (tileloop.c1rect.x + tileloop.c1rect.width < rect.x + rect.width) + if (tileloop.blocking && tileloop.c1rect.x + tileloop.c1rect.width < rect.x + rect.width) tileloop.c1rect.width += tileWidth; int subencoding = bytes[offset++] & 0x0ff; if (subencoding != 0)
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZlibDecoder.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZlibDecoder.java Mon Feb 03 19:56:08 2020 +0900 @@ -45,8 +45,7 @@ int length = rect.width * rect.height * renderer.getBytesPerPixel(); byte[] bytes = unzip(reader, zippedLength, length, rect.getEncodingType()); Reader unzippedReader = - new Reader( - new ByteArrayInputStream(bytes, zippedLength, length)); + new Reader( new ByteArrayInputStream(bytes, zippedLength, length)); RawDecoder.getInstance().decode(unzippedReader, renderer, rect); }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Mon Feb 03 19:56:08 2020 +0900 @@ -81,7 +81,7 @@ private boolean stopBroadcast; // multicastBlocking is an internal test flag // perform blocking on TCP connection - public boolean multicastBlocking = true; + public boolean multicastBlocking = false; public TreeRFBProto(boolean isTreeManager, ViewerInterface viewer) { nets.setMyRfb(this);
--- a/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/CuiViewer.java Mon Feb 03 19:56:08 2020 +0900 @@ -286,7 +286,7 @@ } @Override - public void proxyStart(String[] args, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer) { + public void proxyStart(String[] args, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer, boolean connect) { }
--- a/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/TreeViewer.java Mon Feb 03 19:56:08 2020 +0900 @@ -98,7 +98,8 @@ public void rootStart(String[] args, ViewerInterface v) throws SocketException, UnknownHostException { v.setNoConnection(noConnection); // should we accept host name here? - v.proxyStart(args, hostName, width, height, showTree, checkDelay, addSerialNum, fixingSizeDisplay, filterSingleDisplay, viewer); + v.proxyStart(args, hostName, width, height, showTree, checkDelay, addSerialNum, + fixingSizeDisplay, filterSingleDisplay, viewer,!noConnection); if (!permitChangeScreen) v.getRfb().setPermitChangeScreen(false); v.getRfb().getAcceptThread().waitForShutdown(); } @@ -109,6 +110,7 @@ if ("-p".equals(args[i]) || "-r".equals(args[i])) { // no display. behave as root. // relay rfb update to clients. + noConnection = false; treeProxy = true; viewer = false; } else if ("-d".equals(args[i])) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Feb 03 19:56:08 2020 +0900 @@ -427,7 +427,7 @@ rfb.getAcceptThread().waitForShutdown(); } - public void proxyStart(String[] argv, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer) { + public void proxyStart(String[] argv, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer, boolean connect) { fbWidth = width; this.showTree = showTree; Parser parser = new Parser(); @@ -466,8 +466,8 @@ connectionParams.setConnectionParam(hostName, vncport); isApplet = true; settings.setViewOnly(true); // to avoid unnecessary upward traffic - ConnectionPresenter cp = createNewConnectionPresenter(hostName, myRfb.getId(), 0, 0, 0, 0, 1); - createScreenSelectionPanel(null); + if (connect) + createScreenSelectionPanel(null); myRfb.getAcceptThread().waitForShutdown(); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Feb 03 17:33:27 2020 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerInterface.java Mon Feb 03 19:56:08 2020 +0900 @@ -37,7 +37,8 @@ public void inhelitClients(String hostName, short newVNCServerId, int x, int y, int width, int height, int scale); - public void proxyStart(String[] args, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer); + public void proxyStart(String[] args, String hostName, int width, int height, boolean showTree, boolean checkDelay, boolean addSerialNum, + boolean fixingSize, boolean filterSingleDisplay, boolean hasViewer,boolean connect); public void setNoConnection(boolean noConnection);