Compare commits

..
7 Commits
Author SHA1 Message Date
heavyrain2012 e72ae59e49 update version to 0.33 2019-11-28 17:33:35 +08:00
heavyrain2012 f0c2fd82ca 调整部分文件包名 2019-11-28 14:20:34 +08:00
heavyrain2012 5a588c8268 update 2019-11-27 12:57:07 +08:00
heavyrain2012 2adc030d6f 修改日志缺陷 2019-11-27 11:09:07 +08:00
heavyrain2012 b0ca8ed2b7 update 2019-11-27 10:39:32 +08:00
heavyrain2012 f9d5c861ce 优化用户session 2019-11-27 10:30:39 +08:00
heavyrain2012 9aaaa71ce9 清除掉重复token 2019-11-26 14:44:25 +08:00
68 changed files with 169 additions and 58 deletions
+1
View File
@@ -0,0 +1 @@
alter table `t_user_session` add column `_deleted` tinyint DEFAULT 0;
+1
View File
@@ -0,0 +1 @@
alter table `t_user_session` add column `_deleted` tinyint DEFAULT 0;
+1 -1
View File
@@ -5,7 +5,7 @@
<relativePath>../</relativePath> <relativePath>../</relativePath>
<artifactId>wildfirechat-parent</artifactId> <artifactId>wildfirechat-parent</artifactId>
<groupId>cn.wildfirechat</groupId> <groupId>cn.wildfirechat</groupId>
<version>0.32</version> <version>0.33</version>
</parent> </parent>
<artifactId>moquette-broker</artifactId> <artifactId>moquette-broker</artifactId>
@@ -57,7 +57,7 @@ public class PushServer {
} }
public void pushMessage(PushMessage pushMessage, String deviceId, String pushContent) { public void pushMessage(PushMessage pushMessage, String deviceId, String pushContent) {
LOG.info("try to delivery push diviceId = {}, pushContent", deviceId, pushContent); LOG.info("try to delivery push diviceId = {}, pushContent = {}", deviceId, pushContent);
executorService.execute(() ->{ executorService.execute(() ->{
try { try {
pushMessageInternel(pushMessage, deviceId, pushContent); pushMessageInternel(pushMessage, deviceId, pushContent);
@@ -82,7 +82,7 @@ public class RouteAction extends Action {
MemorySessionStore.Session session = sessionsStore.sessionForClientAndUser(uid, cid); MemorySessionStore.Session session = sessionsStore.sessionForClientAndUser(uid, cid);
if (session == null) { if (session == null) {
ErrorCode errorCode = sessionsStore.createNewSession(uid, cid, true, false, 0); ErrorCode errorCode = sessionsStore.loadActiveSession(uid, cid);
if (errorCode != ErrorCode.ERROR_CODE_SUCCESS) { if (errorCode != ErrorCode.ERROR_CODE_SUCCESS) {
sendResponse(response, errorCode, null, base64Response); sendResponse(response, errorCode, null, base64Response);
return true; return true;
@@ -240,7 +240,7 @@ abstract public class IMHandler<T> {
WFCMessage.Message.Builder messageBuilder = message.toBuilder(); WFCMessage.Message.Builder messageBuilder = message.toBuilder();
int pullType = m_messagesStore.getNotifyReceivers(username, messageBuilder, notifyReceivers); int pullType = m_messagesStore.getNotifyReceivers(username, messageBuilder, notifyReceivers);
this.publisher.publish2Receivers(messageBuilder.build(), notifyReceivers, clientID, pullType); mServer.getImBusinessScheduler().execute(() -> this.publisher.publish2Receivers(messageBuilder.build(), notifyReceivers, clientID, pullType));
return notifyReceivers.size(); return notifyReceivers.size();
} }
@@ -250,7 +250,7 @@ abstract public class IMHandler<T> {
message = m_messagesStore.storeMessage(username, clientID, message); message = m_messagesStore.storeMessage(username, clientID, message);
WFCMessage.Message.Builder messageBuilder = message.toBuilder(); WFCMessage.Message.Builder messageBuilder = message.toBuilder();
int pullType = m_messagesStore.getNotifyReceivers(username, messageBuilder, notifyReceivers); int pullType = m_messagesStore.getNotifyReceivers(username, messageBuilder, notifyReceivers);
this.publisher.publish2Receivers(messageBuilder.build(), notifyReceivers, clientID, pullType); mServer.getImBusinessScheduler().execute(() -> this.publisher.publish2Receivers(messageBuilder.build(), notifyReceivers, clientID, pullType));
return notifyReceivers.size(); return notifyReceivers.size();
} }
@@ -32,7 +32,7 @@ public class RouteHandler extends IMHandler<WFCMessage.RouteRequest> {
ClientSession clientSession = m_sessionsStore.sessionForClient(clientID); ClientSession clientSession = m_sessionsStore.sessionForClient(clientID);
boolean isSessionAlreadyStored = clientSession != null; boolean isSessionAlreadyStored = clientSession != null;
if (!isSessionAlreadyStored) { if (!isSessionAlreadyStored) {
m_sessionsStore.createNewSession(fromUser, clientID, true, false, request.getPlatform()); m_sessionsStore.loadActiveSession(fromUser, clientID);
} else { } else {
m_sessionsStore.updateExistSession(fromUser, clientID, request, true); m_sessionsStore.updateExistSession(fromUser, clientID, request, true);
} }
@@ -16,6 +16,7 @@ import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.MultiMap; import com.hazelcast.core.MultiMap;
import com.hazelcast.util.StringUtil; import com.hazelcast.util.StringUtil;
import com.xiaoleilu.loServer.model.FriendData; import com.xiaoleilu.loServer.model.FriendData;
import io.moquette.server.Server;
import io.moquette.spi.ClientSession; import io.moquette.spi.ClientSession;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -30,6 +31,7 @@ import java.sql.*;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import static cn.wildfirechat.proto.ProtoConstants.PersistFlag.Transparent; import static cn.wildfirechat.proto.ProtoConstants.PersistFlag.Transparent;
import static io.moquette.persistence.MemoryMessagesStore.USER_STATUS; import static io.moquette.persistence.MemoryMessagesStore.USER_STATUS;
import static io.moquette.server.Constants.MAX_MESSAGE_QUEUE; import static io.moquette.server.Constants.MAX_MESSAGE_QUEUE;
@@ -638,11 +640,12 @@ public class DatabaseStore {
String sql = "select `_from`, `_type`, `_target`, `_line`, `_data`, `_dt` from " + MessageShardingUtil.getMessageTable(messageId) +" where _mid = ? limit 1"; String sql = "select `_from`, `_type`, `_target`, `_line`, `_data`, `_dt` from " + MessageShardingUtil.getMessageTable(messageId) +" where _mid = ? limit 1";
Connection connection = null; Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSet resultSet = null;
try { try {
connection = DBUtil.getConnection(); connection = DBUtil.getConnection();
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
statement.setLong(1, messageId); statement.setLong(1, messageId);
ResultSet resultSet = statement.executeQuery(); resultSet = statement.executeQuery();
if (resultSet.next()) { if (resultSet.next()) {
WFCMessage.Message.Builder builder = WFCMessage.Message.newBuilder(); WFCMessage.Message.Builder builder = WFCMessage.Message.newBuilder();
builder.setMessageId(messageId); builder.setMessageId(messageId);
@@ -661,12 +664,11 @@ public class DatabaseStore {
WFCMessage.Message message = builder.build(); WFCMessage.Message message = builder.build();
return new MessageBundle(messageId, message.getFromUser(), null, message); return new MessageBundle(messageId, message.getFromUser(), null, message);
} }
resultSet.close();
} catch (SQLException | IOException e) { } catch (SQLException | IOException e) {
e.printStackTrace(); e.printStackTrace();
Utility.printExecption(LOG, e); Utility.printExecption(LOG, e);
} finally { } finally {
DBUtil.closeDB(connection, statement); DBUtil.closeDB(connection, statement, resultSet);
} }
return null; return null;
} }
@@ -1024,16 +1026,61 @@ public class DatabaseStore {
}); });
} }
MemorySessionStore.Session getSession(String uid, String clientId, ClientSession clientSession) { List<MemorySessionStore.Session> getUserActivedSessions(String uid) {
String sql = "select `_package_name`,`_token`,`_voip_token`,`_secret`,`_db_secret`,`_platform`,`_push_type`,`_device_name`,`_device_version`,`_phone_name`,`_language`,`_carrier_name`, `_dt` from t_user_session where `_uid` = ? and `_cid` = ? limit 1"; String sql = "select `_cid`, `_package_name`,`_token`,`_voip_token`,`_secret`,`_db_secret`,`_platform`,`_push_type`,`_device_name`,`_device_version`,`_phone_name`,`_language`,`_carrier_name`, `_dt` from t_user_session where `_uid` = ? and `_deleted` = 0";
Connection connection = null; Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
List<MemorySessionStore.Session> result = new ArrayList<>();
ResultSet resultSet = null;
try {
connection = DBUtil.getConnection();
statement = connection.prepareStatement(sql);
statement.setString(1, uid);
resultSet = statement.executeQuery();
while (resultSet.next()) {
int index = 1;
String cid = resultSet.getString(index++);
ClientSession clientSession = new ClientSession(cid, Server.getServer().getStore().sessionsStore());
MemorySessionStore.Session session = new MemorySessionStore.Session(uid, cid, clientSession);
session.setAppName(resultSet.getString(index++));
session.setDeviceToken(resultSet.getString(index++));
session.setVoipDeviceToken(resultSet.getString(index++));
session.setSecret(resultSet.getString(index++));
session.setDbSecret(resultSet.getString(index++));
session.setPlatform(resultSet.getInt(index++));
session.setPushType(resultSet.getInt(index++));
session.setDeviceName(resultSet.getString(index++));
session.setDeviceVersion(resultSet.getString(index++));
session.setPhoneName(resultSet.getString(index++));
session.setLanguage(resultSet.getString(index++));
session.setCarrierName(resultSet.getString(index++));
session.setUpdateDt(resultSet.getLong(index++));
result.add(session);
}
} catch (SQLException e) {
e.printStackTrace();
Utility.printExecption(LOG, e);
} finally {
DBUtil.closeDB(connection, statement, resultSet);
}
return result;
}
MemorySessionStore.Session getSession(String uid, String clientId, ClientSession clientSession) {
String sql = "select `_package_name`,`_token`,`_voip_token`,`_secret`,`_db_secret`,`_platform`,`_push_type`,`_device_name`,`_device_version`,`_phone_name`,`_language`,`_carrier_name`, `_dt`, `_deleted` from t_user_session where `_uid` = ? and `_cid` = ? limit 1";
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
try { try {
connection = DBUtil.getConnection(); connection = DBUtil.getConnection();
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
statement.setString(1, uid); statement.setString(1, uid);
statement.setString(2, clientId); statement.setString(2, clientId);
ResultSet resultSet = statement.executeQuery(); resultSet = statement.executeQuery();
if (resultSet.next()) { if (resultSet.next()) {
MemorySessionStore.Session session = new MemorySessionStore.Session(uid, clientId, clientSession); MemorySessionStore.Session session = new MemorySessionStore.Session(uid, clientId, clientSession);
@@ -1051,15 +1098,15 @@ public class DatabaseStore {
session.setPhoneName(resultSet.getString(index++)); session.setPhoneName(resultSet.getString(index++));
session.setLanguage(resultSet.getString(index++)); session.setLanguage(resultSet.getString(index++));
session.setCarrierName(resultSet.getString(index++)); session.setCarrierName(resultSet.getString(index++));
session.setUpdateDt(resultSet.getLong(index)); session.setUpdateDt(resultSet.getLong(index++));
session.setDeleted(resultSet.getInt(index));
return session; return session;
} }
resultSet.close();
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
Utility.printExecption(LOG, e); Utility.printExecption(LOG, e);
} finally { } finally {
DBUtil.closeDB(connection, statement); DBUtil.closeDB(connection, statement, resultSet);
} }
return null; return null;
} }
@@ -1136,6 +1183,35 @@ public class DatabaseStore {
}); });
} }
void updateSessionDeleted(String uid, String cid, int deleted) {
mScheduler.execute(()->{
Connection connection = null;
PreparedStatement statement = null;
try {
connection = DBUtil.getConnection();
String sql = "update t_user_session set `_deleted` = ? where `_uid` = ? and `_cid` = ?";
statement = connection.prepareStatement(sql);
int index = 1;
statement.setInt(index++, deleted);
statement.setString(index++, uid);
statement.setString(index++, cid);
int c = statement.executeUpdate();
LOG.info("Update rows {}", c);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Utility.printExecption(LOG, e);
} finally {
DBUtil.closeDB(connection, statement);
}
});
}
void updateSessionPlatform(String uid, String cid, int platform) { void updateSessionPlatform(String uid, String cid, int platform) {
mScheduler.execute(()->{ mScheduler.execute(()->{
Connection connection = null; Connection connection = null;
@@ -1266,13 +1342,19 @@ public class DatabaseStore {
String sql; String sql;
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX
|| platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android) { || platform == ProtoConstants.Platform.Platform_iOS || platform == ProtoConstants.Platform.Platform_Android) {
sql = "delete from t_user_session where `_uid`=? and (`_platform` = ? or `_platform` = ?) and `_cid` <> ?"; sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and (`_platform` = ? or `_platform` = ?) and `_cid` <> ? and `_deleted` = 0";
} else { } else {
sql = "delete from t_user_session where `_uid`=? and `_platform` = ? and `_cid` <> ?"; sql = "update t_user_session set `_deleted` = ?, `_token` = ?, `_voip_token` = ?, `_dt` = ? where `_uid`=? and `_platform` = ? and `_cid` <> ? and `_deleted` = 0";
} }
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
int index = 1; int index = 1;
statement.setInt(index++, 1);
statement.setString(index++, "");
statement.setString(index++, "");
statement.setLong(index++, System.currentTimeMillis());
statement.setString(index++, uid); statement.setString(index++, uid);
if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX) { if (platform == ProtoConstants.Platform.Platform_Windows || platform == ProtoConstants.Platform.Platform_OSX) {
@@ -2224,7 +2306,7 @@ public class DatabaseStore {
ResultSet rs = null; ResultSet rs = null;
try { try {
connection = DBUtil.getConnection(); connection = DBUtil.getConnection();
String sql = "select distinct(`_uid`) from t_user_session"; String sql = "select distinct(`_uid`) from t_user_session where `_deleted` = 0";
statement = connection.prepareStatement(sql); statement = connection.prepareStatement(sql);
@@ -55,6 +55,16 @@ public class MemorySessionStore implements ISessionsStore {
private volatile int unReceivedMsgs; private volatile int unReceivedMsgs;
private int deleted;
public int getDeleted() {
return deleted;
}
public void setDeleted(int deleted) {
this.deleted = deleted;
}
private MqttVersion mqttVersion = MqttVersion.MQTT_3_1_1; private MqttVersion mqttVersion = MqttVersion.MQTT_3_1_1;
public long getLastActiveTime() { public long getLastActiveTime() {
@@ -135,6 +145,9 @@ public class MemorySessionStore implements ISessionsStore {
public void setUpdateDt(long updateDt) { public void setUpdateDt(long updateDt) {
this.updateDt = updateDt; this.updateDt = updateDt;
if (this.lastActiveTime == 0) {
this.lastActiveTime = updateDt;
}
} }
private int pushType; private int pushType;
@@ -282,7 +295,7 @@ public class MemorySessionStore implements ISessionsStore {
while (it.hasNext()) { while (it.hasNext()) {
Session session = it.next().getValue(); Session session = it.next().getValue();
if (!session.getClientID().equals(cid) && (session.pushType == pushType && token.equals(session.deviceToken))) { if (!session.getClientID().equals(cid) && (session.pushType == pushType && token.equals(session.deviceToken))) {
session.deviceToken = token; session.deviceToken = null;
} }
} }
} }
@@ -312,6 +325,11 @@ public class MemorySessionStore implements ISessionsStore {
session = databaseStore.createSession(username, clientID, clientSession, platform); session = databaseStore.createSession(username, clientID, clientSession, platform);
} }
if (session.getDeleted() > 0) {
session.setDeleted(0);
databaseStore.updateSessionDeleted(username, clientID, 0);
}
if (session.getPlatform() != platform) { if (session.getPlatform() != platform) {
session.setPlatform(platform); session.setPlatform(platform);
databaseStore.updateSessionPlatform(username, clientID, platform); databaseStore.updateSessionPlatform(username, clientID, platform);
@@ -358,34 +376,29 @@ public class MemorySessionStore implements ISessionsStore {
@Override @Override
public ErrorCode createNewSession(String username, String clientID, boolean cleanSession, boolean createWhenNoExist, int platform) { public ErrorCode loadActiveSession(String username, String clientID) {
LOG.debug("createNewSession for client <{}>", clientID); LOG.debug("createNewSession for client <{}>", clientID);
Session session = sessions.get(clientID); Session session = sessions.get(clientID);
if (session != null) {
if (session != null && session.getDeleted() == 0) {
LOG.error("already exists a session for client <{}>, bad condition", clientID); LOG.error("already exists a session for client <{}>, bad condition", clientID);
throw new IllegalArgumentException("Can't create a session with the ID of an already existing" + clientID); throw new IllegalArgumentException("Can't create a session with the ID of an already existing" + clientID);
} }
if (session != null && session.getDeleted() > 0) {
return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;
}
ClientSession clientSession = new ClientSession(clientID, this); ClientSession clientSession = new ClientSession(clientID, this);
session = databaseStore.getSession(username, clientID, clientSession); session = databaseStore.getSession(username, clientID, clientSession);
if (session == null) { if (session == null || session.getDeleted() > 0) {
if (!createWhenNoExist) { return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;
return ErrorCode.ERROR_CODE_SECRECT_KEY_MISMATCH;
}
session = databaseStore.createSession(username, clientID, clientSession, platform);
} }
sessions.put(clientID, session); sessions.put(clientID, session);
ConcurrentSkipListSet<String> sessionSet = userSessions.get(username); ConcurrentSkipListSet<String> sessionSet = getUserSessionSet(username);
if (sessionSet == null) {
sessionSet = new ConcurrentSkipListSet<>();
userSessions.put(username, sessionSet);
}
sessionSet = userSessions.get(username);
sessionSet.add(clientID); sessionSet.add(clientID);
return ErrorCode.ERROR_CODE_SUCCESS; return ErrorCode.ERROR_CODE_SUCCESS;
@@ -409,12 +422,7 @@ public class MemorySessionStore implements ISessionsStore {
session.setUsername(username); session.setUsername(username);
sessions.put(clientID, session); sessions.put(clientID, session);
ConcurrentSkipListSet<String> sessionSet = userSessions.get(username); ConcurrentSkipListSet<String> sessionSet = getUserSessionSet(username);
if (sessionSet == null) {
sessionSet = new ConcurrentSkipListSet<>();
userSessions.put(username, sessionSet);
}
sessionSet = userSessions.get(username);
sessionSet.add(clientID); sessionSet.add(clientID);
if (endpoint != null) { if (endpoint != null) {
@@ -460,14 +468,26 @@ public class MemorySessionStore implements ISessionsStore {
} }
} }
private ConcurrentSkipListSet<String> getUserSessionSet(String username) {
ConcurrentSkipListSet<String> sessionSet = userSessions.get(username);
if (sessionSet == null) {
sessionSet = new ConcurrentSkipListSet<String>();
List<Session> ss = databaseStore.getUserActivedSessions(username);
for (Session s : ss) {
sessionSet.add(s.getClientID());
sessions.put(s.getClientID(), s);
}
userSessions.put(username, sessionSet);
}
sessionSet = userSessions.get(username);
return sessionSet;
}
@Override @Override
public Collection<Session> sessionForUser(String username) { public Collection<Session> sessionForUser(String username) {
ConcurrentSkipListSet<String> sessionSet = userSessions.get(username); ConcurrentSkipListSet<String> sessionSet = getUserSessionSet(username);
if (sessionSet == null) {
sessionSet = new ConcurrentSkipListSet<String>();
userSessions.put(username, sessionSet);
}
sessionSet = userSessions.get(username);
ArrayList<Session> out = new ArrayList<>(); ArrayList<Session> out = new ArrayList<>();
for (String clientId : sessionSet for (String clientId : sessionSet
) { ) {
@@ -611,12 +631,7 @@ public class MemorySessionStore implements ISessionsStore {
LOG.error("Can't find the session for client <{}>", clientID); LOG.error("Can't find the session for client <{}>", clientID);
return; return;
} }
ConcurrentSkipListSet<String> sessionSet = userSessions.get(session.username); ConcurrentSkipListSet<String> sessionSet = getUserSessionSet(session.username);
if (sessionSet == null) {
sessionSet = new ConcurrentSkipListSet<>();
userSessions.put(session.username, sessionSet);
}
sessionSet = userSessions.get(session.username);
sessionSet.remove(clientID); sessionSet.remove(clientID);
// remove also the messages stored of type QoS1/2 // remove also the messages stored of type QoS1/2
@@ -40,7 +40,7 @@ public interface ISessionsStore {
Session createUserSession(String username, String clientID, int platform); Session createUserSession(String username, String clientID, int platform);
ErrorCode createNewSession(String username, String clientID, boolean cleanSession, boolean createNoExist, int platform); ErrorCode loadActiveSession(String username, String clientID);
ClientSession updateExistSession(String username, String clientID, WFCMessage.RouteRequest endpoint, boolean cleanSession); ClientSession updateExistSession(String username, String clientID, WFCMessage.RouteRequest endpoint, boolean cleanSession);
@@ -16,6 +16,7 @@
package io.moquette.spi.impl; package io.moquette.spi.impl;
import cn.wildfirechat.common.ErrorCode;
import cn.wildfirechat.proto.WFCMessage; import cn.wildfirechat.proto.WFCMessage;
import io.moquette.persistence.RPCCenter; import io.moquette.persistence.RPCCenter;
import io.moquette.interception.InterceptHandler; import io.moquette.interception.InterceptHandler;
@@ -181,7 +182,11 @@ public class ProtocolProcessor {
MqttVersion mqttVersion = MqttVersion.fromProtocolLevel(msg.variableHeader().version()); MqttVersion mqttVersion = MqttVersion.fromProtocolLevel(msg.variableHeader().version());
if (!login(channel, msg, clientId, mqttVersion)) { if (!login(channel, msg, clientId, mqttVersion)) {
MqttConnAckMessage badId = connAck(CONNECTION_REFUSED_BAD_USER_NAME_OR_PASSWORD);
channel.writeAndFlush(badId);
channel.close(); channel.close();
LOG.error("The MQTT login failure. Username={}", payload.userName());
return; return;
} }
if (!mServer.m_initialized) { if (!mServer.m_initialized) {
@@ -270,9 +275,16 @@ public class ProtocolProcessor {
MemorySessionStore.Session session = m_sessionsStore.getSession(clientId); MemorySessionStore.Session session = m_sessionsStore.getSession(clientId);
if (session == null) { if (session == null) {
m_sessionsStore.createNewSession(msg.payload().userName(), clientId, true, false, 0); ErrorCode errorCode = m_sessionsStore.loadActiveSession(msg.payload().userName(), clientId);
if (errorCode != ErrorCode.ERROR_CODE_SUCCESS) {
return false;
}
session = m_sessionsStore.getSession(clientId); session = m_sessionsStore.getSession(clientId);
} }
if (session.getDeleted() != 0) {
return false;
}
if (session != null && session.getUsername().equals(msg.payload().userName())) { if (session != null && session.getUsername().equals(msg.payload().userName())) {
pwd = AES.AESDecrypt(pwd, session.getSecret(), true); pwd = AES.AESDecrypt(pwd, session.getSecret(), true);
@@ -52,7 +52,7 @@ public class HttpUtils {
@Override @Override
public void onResponse(Call call, Response response) throws IOException { public void onResponse(Call call, Response response) throws IOException {
LOG.info("POST to {} success with response", url, response.body().string()); LOG.info("POST to {} success with response: {}", url, response.body());
} }
}); });
} }
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>wildfirechat-parent</artifactId> <artifactId>wildfirechat-parent</artifactId>
<groupId>cn.wildfirechat</groupId> <groupId>cn.wildfirechat</groupId>
<version>0.32</version> <version>0.33</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
+1 -1
View File
@@ -6,7 +6,7 @@
<!--<relativePath>../pom.xml</relativePath>--> <!--<relativePath>../pom.xml</relativePath>-->
<artifactId>wildfirechat-parent</artifactId> <artifactId>wildfirechat-parent</artifactId>
<groupId>cn.wildfirechat</groupId> <groupId>cn.wildfirechat</groupId>
<version>0.32</version> <version>0.33</version>
</parent> </parent>
<artifactId>distribution</artifactId> <artifactId>distribution</artifactId>
+1 -1
View File
@@ -12,7 +12,7 @@
<artifactId>wildfirechat-parent</artifactId> <artifactId>wildfirechat-parent</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>0.32</version> <version>0.33</version>
<name>Wildfire Chat</name> <name>Wildfire Chat</name>
<description>Wildfire Chat Server</description> <description>Wildfire Chat Server</description>
<inceptionYear>2019</inceptionYear> <inceptionYear>2019</inceptionYear>
+1 -1
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>wildfirechat-parent</artifactId> <artifactId>wildfirechat-parent</artifactId>
<groupId>cn.wildfirechat</groupId> <groupId>cn.wildfirechat</groupId>
<version>0.32</version> <version>0.33</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>