]> source.dussan.org Git - tigervnc.git/commitdiff
java client should accept server port specified as either rfb port or display offset...
authorBrian Hinz <bphinz@users.sourceforge.net>
Fri, 11 Nov 2011 19:12:33 +0000 (19:12 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Fri, 11 Nov 2011 19:12:33 +0000 (19:12 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4796 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/com/tigervnc/rfb/Hostname.java

index 42fda537ddcc326cb35a8692c7f186776c4134d5..3821c219c115a976d177f0a9c0f8364b4d0ea354 100644 (file)
@@ -36,6 +36,9 @@ public class Hostname {
     if (vncServerName.charAt(colonPos+1) == ':') {
       return Integer.parseInt(vncServerName.substring(colonPos+2));
     }
-    return Integer.parseInt(vncServerName.substring(colonPos+1)) + 5900;
+    int port = Integer.parseInt(vncServerName.substring(colonPos+1));
+    if (port < 100)
+      port += 5900;
+    return port;
   }
 }