changeset 181:f0dc6e6e85dc

modify MyRfbProto.java : method authneticationRequestAccess()
author e085711
date Tue, 25 Oct 2011 02:58:32 +0900
parents da276538c1d5
children 8a0e30e527e7 134deb9f8148
files src/myVncProxy/MyRfbProto.java
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/myVncProxy/MyRfbProto.java	Tue Oct 25 01:41:05 2011 +0900
+++ b/src/myVncProxy/MyRfbProto.java	Tue Oct 25 02:58:32 2011 +0900
@@ -141,12 +141,22 @@
 	
 	void authenticationRequestAccess() throws IOException {
 
-		byte[] inBuf = new byte[300];
-		is.read(inBuf);
+		byte[] headBuf = new byte[2];
+		is.read(headBuf);
+		if(headBuf[1] == 2) {
+			byte[] b = new byte[258];
+			is.read(b);
 
-		byte[] outBuf = new byte[256]; 
-		os.write(outBuf);
-		os.flush();
+			byte[] outBuf = new byte[256];
+			os.write(outBuf);
+			os.flush();
+		}else if(headBuf[1] == 23) {
+			byte[] b = new byte[130];
+			is.read(b);
+			byte[] outBuf = new byte[192];
+			os.write(outBuf);
+			os.flush();
+		}
 
 		int result = readU32();
 		if(result != 0) {