server crash fix
This commit is contained in:
parent
4f4049fccf
commit
3ff5158b6f
1 changed files with 4 additions and 2 deletions
|
@ -56,9 +56,13 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
||||||
if (authState == PasswordWrong)
|
if (authState == PasswordWrong)
|
||||||
return authState;
|
return authState;
|
||||||
|
|
||||||
|
ServerInfo_User *data = getUserData(name);
|
||||||
|
name = data->getName(); // Compensate for case indifference
|
||||||
|
|
||||||
if (authState == PasswordRight) {
|
if (authState == PasswordRight) {
|
||||||
if (users.contains(name)) {
|
if (users.contains(name)) {
|
||||||
qDebug("Login denied: would overwrite old session");
|
qDebug("Login denied: would overwrite old session");
|
||||||
|
delete data;
|
||||||
return WouldOverwriteOldSession;
|
return WouldOverwriteOldSession;
|
||||||
}
|
}
|
||||||
} else if (authState == UnknownUser) {
|
} else if (authState == UnknownUser) {
|
||||||
|
@ -71,8 +75,6 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
||||||
name = tempName;
|
name = tempName;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerInfo_User *data = getUserData(name);
|
|
||||||
name = data->getName(); // Compensate for case indifference
|
|
||||||
session->setUserInfo(data);
|
session->setUserInfo(data);
|
||||||
|
|
||||||
users.insert(name, session);
|
users.insert(name, session);
|
||||||
|
|
Loading…
Reference in a new issue