diff src/main/java/com/glavsoft/rfb/protocol/state/HandshakeState.java @ 52:472a9bcacb21 draft default tip

TightVNC 2.7.1.0
author you@cr.ie.u-ryukyu.ac.jp
date Wed, 07 Aug 2013 19:01:17 +0900
parents 4689cc86d6cb
children
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/state/HandshakeState.java	Tue Jul 03 13:20:49 2012 +0900
+++ b/src/main/java/com/glavsoft/rfb/protocol/state/HandshakeState.java	Wed Aug 07 19:01:17 2013 +0900
@@ -1,4 +1,4 @@
-// Copyright (C) 2010, 2011 GlavSoft LLC.
+// Copyright (C) 2010, 2011, 2012, 2013 GlavSoft LLC.
 // All rights reserved.
 //
 //-------------------------------------------------------------------------
@@ -28,6 +28,7 @@
 import com.glavsoft.exceptions.UnsupportedProtocolVersionException;
 import com.glavsoft.rfb.protocol.ProtocolContext;
 
+import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -57,7 +58,7 @@
 
 	private void handshake() throws TransportException, UnsupportedProtocolVersionException {
 		String protocolString = reader.readString(PROTOCOL_STRING_LENGTH);
-		logger.info("Server sent protocol string: " + protocolString.substring(0, protocolString.length() - 1));
+        Logger.getLogger(getClass().getName()).info("Server sent protocol string: " + protocolString.substring(0, protocolString.length() - 1));
 		Pattern pattern = Pattern.compile(PROTOCOL_STRING_REGEXP);
 		final Matcher matcher = pattern.matcher(protocolString);
 		if ( ! matcher.matches())
@@ -76,21 +77,21 @@
 
 		if (minor >= MIN_SUPPORTED_VERSION_MINOR && minor < 7) {
 			changeStateTo(new SecurityType33State(context));
-			context.getSettings().setProtocolVersion(PROTOCOL_VERSION_3_3);
+			context.setProtocolVersion(PROTOCOL_VERSION_3_3);
 			minor = 3;
 		} else if (7 == minor) {
 			changeStateTo(new SecurityType37State(context));
-			context.getSettings().setProtocolVersion(PROTOCOL_VERSION_3_7);
+			context.setProtocolVersion(PROTOCOL_VERSION_3_7);
 			minor = 7;
 		} else if (minor >= MAX_SUPPORTED_VERSION_MINOR) {
 			changeStateTo(new SecurityTypeState(context));
-			context.getSettings().setProtocolVersion(PROTOCOL_VERSION_3_8);
+			context.setProtocolVersion(PROTOCOL_VERSION_3_8);
 			minor = 8;
 		} else
 			throw new UnsupportedProtocolVersionException(
 					"Unsupported protocol version: " + protocolString);
 		writer.write(("RFB 00" + major + ".00" + minor + "\n").getBytes());
-		logger.info("Set protocol version to: " + context.getSettings().getProtocolVersion());
+        Logger.getLogger(getClass().getName()).info("Set protocol version to: " + context.getProtocolVersion());
 	}
 
 }