more debug printf

This commit is contained in:
Dario 2020-09-23 08:37:59 +02:00
parent 2532d16f5d
commit 4e553c81b6

View File

@ -787,6 +787,7 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo
} }
} }
//Profiler usedTime; //Profiler usedTime;
printf("before lock\n");
lock(functionName); lock(functionName);
if (!mSessionUser.isNull() && mSessionUser->getEmail() != email) { if (!mSessionUser.isNull() && mSessionUser->getEmail() != email) {
mSessionUser.assign(nullptr); mSessionUser.assign(nullptr);
@ -804,12 +805,14 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo
printf("user loaded from email\n"); printf("user loaded from email\n");
} }
printf("before get model\n");
auto user_model = mNewUser->getModel(); auto user_model = mNewUser->getModel();
if (user_model && user_model->isDisabled()) { if (user_model && user_model->isDisabled()) {
return USER_DISABLED; return USER_DISABLED;
} }
printf("before if login\n");
if (!mSessionUser.isNull() && mSessionUser->getUserState() >= USER_LOADED_FROM_DB) { if (!mSessionUser.isNull() && mSessionUser->getUserState() >= USER_LOADED_FROM_DB) {
printf("before login\n");
int loginResult = mNewUser->login(password); int loginResult = mNewUser->login(password);
printf("new user login with result: %d\n", loginResult); printf("new user login with result: %d\n", loginResult);
@ -860,6 +863,7 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo
}*/ }*/
} }
else { else {
printf("before sleep\n");
User::fakeCreateCryptoKey(); User::fakeCreateCryptoKey();
} }
@ -873,9 +877,10 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo
unlock(); unlock();
return false; return false;
}*/ }*/
printf("before detect session state\n");
detectSessionState(); detectSessionState();
unlock(); unlock();
printf("before return user state\n");
return mSessionUser->getUserState(); return mSessionUser->getUserState();
} }