mirror of
https://gitee.com/openharmony/developtools_profiler
synced 2024-11-23 06:50:12 +00:00
新增token认证
Signed-off-by: s30035957 <sunwei158@huawei.com>
This commit is contained in:
parent
45ea791199
commit
6a7850fd9d
@ -210,11 +210,11 @@ public:
|
||||
spSocket.Send(std::string("stopRecord::") + std::to_string(STOP_RECORD_FAILED));
|
||||
}
|
||||
}
|
||||
bool SendTokenFailedMessage(SpServerSocket &socket, std::string &message) const
|
||||
void SendTokenFailedMessage(SpServerSocket &socket, std::string &message) const
|
||||
{
|
||||
if (message.find("init:::") != std::string::npos &&
|
||||
if (message.find("init:::") != std::string::npos ||
|
||||
message.find("start:::") != std::string::npos) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
const std::vector<std::string> messageType = {
|
||||
"init::",
|
||||
@ -227,15 +227,15 @@ public:
|
||||
if (message.find(it) != std::string::npos) {
|
||||
LOGI((it + std::to_string(TOKEN_CHECK_FAILED)).c_str());
|
||||
socket.Send(it + std::to_string(TOKEN_CHECK_FAILED));
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void DealMsg(std::string recvStr, SpServerSocket &spSocket, SocketErrorType tokenStatus) const
|
||||
{
|
||||
SocketHeartbeat();
|
||||
if (tokenStatus == TOKEN_CHECK_FAILED && SendTokenFailedMessage(spSocket, recvStr)) {
|
||||
if (tokenStatus == TOKEN_CHECK_FAILED) {
|
||||
SendTokenFailedMessage(spSocket, recvStr);
|
||||
return;
|
||||
}
|
||||
if (recvStr.find("init:::") != std::string::npos) {
|
||||
|
Loading…
Reference in New Issue
Block a user