diff --git a/protoc.exe b/protoc.exe new file mode 100644 index 000000000..c0935e56a Binary files /dev/null and b/protoc.exe differ diff --git a/src/cpp/SingletonManager/SingletonTaskObserver.cpp b/src/cpp/SingletonManager/SingletonTaskObserver.cpp index 66490353a..f4dba3849 100644 --- a/src/cpp/SingletonManager/SingletonTaskObserver.cpp +++ b/src/cpp/SingletonManager/SingletonTaskObserver.cpp @@ -212,6 +212,18 @@ std::vector SingletonTaskObserver::getTasksCount(const std::string& email) return taskCounts; } +int SingletonTaskObserver::getTasksCount(TaskObserverType type) +{ + int type_sum_count = 0; + lock("SingletonTaskObserver::getTasksCount"); + for (int i = 0; i < mObserverEntrys.getNItems(); i++) { + UserObserverEntry* entry = static_cast(mObserverEntrys.findByIndex(i)); + type_sum_count += entry->mTasksCount[type]; + } + unlock(); + return type_sum_count; +} + const char* SingletonTaskObserver::TaskObserverTypeToString(TaskObserverType type) { switch (type) { diff --git a/src/cpp/SingletonManager/SingletonTaskObserver.h b/src/cpp/SingletonManager/SingletonTaskObserver.h index 3eb7983f2..96e97223f 100644 --- a/src/cpp/SingletonManager/SingletonTaskObserver.h +++ b/src/cpp/SingletonManager/SingletonTaskObserver.h @@ -46,6 +46,7 @@ public: int getTaskCount(const std::string& email, TaskObserverType type); int getTaskCount(DHASH id, TaskObserverType type); std::vector getTasksCount(const std::string& email); + int getTasksCount(TaskObserverType type); static const char* TaskObserverTypeToString(TaskObserverType type); static TaskObserverType StringToTaskObserverType(const std::string& typeString); diff --git a/src/cpp/model/Session.cpp b/src/cpp/model/Session.cpp index cb574786b..77c5362d4 100644 --- a/src/cpp/model/Session.cpp +++ b/src/cpp/model/Session.cpp @@ -817,7 +817,29 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo printf("before if login\n"); if (!mSessionUser.isNull() && mSessionUser->getUserState() >= USER_LOADED_FROM_DB) { printf("before login\n"); - int loginResult = mNewUser->login(password); + int loginResult = 0; + int exitCount = 0; + do { + loginResult = mNewUser->login(password); + Poco::Thread::sleep(100); + exitCount++; + } while (-3 == loginResult && exitCount < 15); + if (exitCount > 0) { + addError(new ParamError(functionName, "login succeed, retrys: ", exitCount)); + addError(new ParamError(functionName, "email: ", email)); + sendErrorsAsEmail(); + } + + if (exitCount >= 15) + { + auto running_password_creations = observer->getTasksCount(TASK_OBSERVER_PASSWORD_CREATION); + + addError(new ParamError(functionName, "login failed after 15 retrys and 100 ms sleep between, currently running passwort creation tasks: ", running_password_creations)); + addError(new ParamError(functionName, "email: ", email)); + sendErrorsAsEmail(); + return USER_PASSWORD_ENCRYPTION_IN_PROCESS; + } + printf("new user login with result: %d\n", loginResult); if (-1 == loginResult) { diff --git a/src/cpsp/PocoFoundation.dll b/src/cpsp/PocoFoundation.dll new file mode 100644 index 000000000..5996f2520 Binary files /dev/null and b/src/cpsp/PocoFoundation.dll differ diff --git a/src/cpsp/PocoJSON.dll b/src/cpsp/PocoJSON.dll new file mode 100644 index 000000000..0dd978e36 Binary files /dev/null and b/src/cpsp/PocoJSON.dll differ diff --git a/src/cpsp/PocoNet.dll b/src/cpsp/PocoNet.dll new file mode 100644 index 000000000..8f258ec0b Binary files /dev/null and b/src/cpsp/PocoNet.dll differ diff --git a/src/cpsp/PocoUtil.dll b/src/cpsp/PocoUtil.dll new file mode 100644 index 000000000..56ccf1661 Binary files /dev/null and b/src/cpsp/PocoUtil.dll differ diff --git a/src/cpsp/PocoXML.dll b/src/cpsp/PocoXML.dll new file mode 100644 index 000000000..61d22d3ee Binary files /dev/null and b/src/cpsp/PocoXML.dll differ diff --git a/src/cpsp/compile.sh b/src/cpsp/compile.sh new file mode 100644 index 000000000..7e4a30835 --- /dev/null +++ b/src/cpsp/compile.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +cpspc.exe config.cpsp && cp ConfigPage.* ../cpp/HTTPInterface/ +cpspc.exe login.cpsp && cp LoginPage.* ../cpp/HTTPInterface/ +cpspc.exe resetPassword.cpsp && cp ResetPassword.* ../cpp/HTTPInterface/ +cpspc.exe register.cpsp && cp RegisterPage.* ../cpp/HTTPInterface/ +cpspc.exe registerAdmin.cpsp && cp RegisterAdminPage.* ../cpp/HTTPInterface/ +cpspc.exe dashboard.cpsp && cp DashboardPage.* ../cpp/HTTPInterface/ +cpspc.exe checkEmail.cpsp && cp CheckEmailPage.* ../cpp/HTTPInterface/ +cpspc.exe saveKeys.cpsp && cp SaveKeysPage.* ../cpp/HTTPInterface/ +cpspc.exe passphrase.cpsp && cp PassphrasePage.* ../cpp/HTTPInterface/ +cpspc.exe UpdateUserPassword.cpsp && cp UpdateUserPasswordPage.* ../cpp/HTTPInterface/ +cpspc.exe Error500.cpsp && cp Error500Page.* ../cpp/HTTPInterface/ +cpspc.exe checkTransaction.cpsp && cp CheckTransactionPage.* ../cpp/HTTPInterface/ +cpspc.exe decodeTransaction.cpsp && cp DecodeTransactionPage.* ../cpp/HTTPInterface/ +cpspc.exe debugPassphrase.cpsp && cp DebugPassphrasePage.* ../cpp/HTTPInterface/ +cpspc.exe adminCheckUserBackup.cpsp && cp AdminCheckUserBackup.* ../cpp/HTTPInterface/ +cpspc.exe translatePassphrase.cpsp && cp TranslatePassphrase.* ../cpp/HTTPInterface/ +cpspc.exe repairDefectPassphrase.cpsp && cp RepairDefectPassphrase.* ../cpp/HTTPInterface/ +cpspc.exe PassphrasedTransaction.cpsp && cp PassphrasedTransaction.* ../cpp/HTTPInterface/ +cpspc.exe debugMnemonic.cpsp && cp DebugMnemonicPage.* ../cpp/HTTPInterface/ +cpspc.exe adminUserPasswordReset.cpsp && cp AdminUserPasswordReset.* ../cpp/HTTPInterface/ +cpspc.exe register.cpsp && cp RegisterPage.* ../cpp/HTTPInterface/ +cpspc.exe registerDirect.cpsp && cp RegisterDirectPage.* ../cpp/HTTPInterface/ +cpspc.exe adminGroups.cpsp && cp AdminGroupsPage.* ../cpp/HTTPInterface/ +cpspc.exe adminTopic.cpsp && cp AdminTopicPage.* ../cpp/HTTPInterface/ +cpspc.exe adminHederaAccount.cpsp && cp AdminHederaAccountPage.* ../cpp/HTTPInterface/ +cpspc.exe adminNodeServer.cpsp && cp AdminNodeServerPage.* ../cpp/HTTPInterface/ + +cd ../.. +./compile_pot.sh +cd src/cpsp \ No newline at end of file