From: Maksym Mamontov Date: Sat, 23 Jan 2021 15:14:03 +0000 (+0200) Subject: Use `time` for message creation time. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/acdf6ab94fee26ebc4017bf32cf6171c7d9462e9?hp=-c Use `time` for message creation time. --- acdf6ab94fee26ebc4017bf32cf6171c7d9462e9 diff --git a/functest/test.sh b/functest/test.sh index 83ec1b99..35bb62d9 100755 --- a/functest/test.sh +++ b/functest/test.sh @@ -98,4 +98,6 @@ do sleep 1 done +cp "$STGPATH/stargazer.log" "$CURPATH/stargazer.log" + printf "Stopped.\n" diff --git a/functest/test_admins.sh b/functest/test_admins.sh index 562d5e1d..9f819147 100755 --- a/functest/test_admins.sh +++ b/functest/test_admins.sh @@ -8,7 +8,7 @@ SGCONFPATH="$BASEPATH/stg/build/projects/sgconf" printf "Check initial admin list... " -RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-admins` +RES=`"$SGCONFPATH/sgconf" -s 127.0.0.1 -p 5555 -u admin -w 123456 --get-admins` if [ "$?" != "0" ] then diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp index b4607996..161190f5 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp @@ -26,8 +26,6 @@ #include -extern volatile time_t stgTime; // So sad... - using STG::PARSER::SEND_MESSAGE; const char * SEND_MESSAGE::tag = "Message"; @@ -100,7 +98,7 @@ int SEND_MESSAGE::End(void *, const char *el) printfd(__FILE__, "User not found. %s\n", m_logins[i].c_str()); continue; } - m_msg.header.creationTime = static_cast(stgTime); + m_msg.header.creationTime = static_cast(time(NULL)); m_user->AddMessage(&m_msg); m_result = res_ok; }