提交 c21156ff authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 1739b00f
...@@ -93,6 +93,9 @@ public class SessionRemote implements SessionInterface, DataHandler { ...@@ -93,6 +93,9 @@ public class SessionRemote implements SessionInterface, DataHandler {
trans.setSSL(ci.isSSL()); trans.setSSL(ci.isSSL());
trans.init(); trans.init();
trans.writeInt(clientVersion); trans.writeInt(clientVersion);
if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_6) {
trans.writeInt(clientVersion);
}
trans.writeString(db); trans.writeString(db);
trans.writeString(ci.getOriginalURL()); trans.writeString(ci.getOriginalURL());
trans.writeString(ci.getUserName()); trans.writeString(ci.getUserName());
...@@ -106,6 +109,9 @@ public class SessionRemote implements SessionInterface, DataHandler { ...@@ -106,6 +109,9 @@ public class SessionRemote implements SessionInterface, DataHandler {
} }
try { try {
done(trans); done(trans);
if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_6) {
clientVersion = trans.readInt();
}
} catch (SQLException e) { } catch (SQLException e) {
trans.close(); trans.close();
throw e; throw e;
......
...@@ -69,7 +69,7 @@ public class TcpServerThread implements Runnable { ...@@ -69,7 +69,7 @@ public class TcpServerThread implements Runnable {
if (!server.allow(transfer.getSocket())) { if (!server.allow(transfer.getSocket())) {
throw Message.getSQLException(ErrorCode.REMOTE_CONNECTION_NOT_ALLOWED); throw Message.getSQLException(ErrorCode.REMOTE_CONNECTION_NOT_ALLOWED);
} }
if (clientVersion == Constants.TCP_PROTOCOL_VERSION_6) { if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_6) {
// version 6 and newer: read max version (currently not used) // version 6 and newer: read max version (currently not used)
transfer.readInt(); transfer.readInt();
} else if (clientVersion != Constants.TCP_PROTOCOL_VERSION_5) { } else if (clientVersion != Constants.TCP_PROTOCOL_VERSION_5) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论