mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-24 17:29:54 +00:00
bug:set sessionkey available when the sessionkey can be matched
Signed-off-by: song-chenxi050 <songchenxi2@huawei.com>
This commit is contained in:
parent
e3bee959aa
commit
4ff07b29ec
@ -1807,6 +1807,8 @@ static void HandleConnectionData(
|
||||
ReleaseAuthLock();
|
||||
return;
|
||||
}
|
||||
int32_t index = (int32_t)SoftBusLtoHl(*(uint32_t *)data);
|
||||
(void)SetSessionKeyAvailable(&auth->sessionKeyList, index);
|
||||
auth->hasAuthPassed = true;
|
||||
auth->lastActiveTime = GetCurrentTimeMs();
|
||||
auth->connId[type] = connId;
|
||||
|
@ -237,8 +237,10 @@ int32_t SetSessionKeyAvailable(SessionKeyList *list, int32_t index)
|
||||
if (item->index != index) {
|
||||
continue;
|
||||
}
|
||||
item->isAvailable = true;
|
||||
AUTH_LOGI(AUTH_FSM, "index=%{public}d, set available", index);
|
||||
if (!item->isAvailable) {
|
||||
item->isAvailable = true;
|
||||
AUTH_LOGI(AUTH_FSM, "index=%{public}d, set available", index);
|
||||
}
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
AUTH_LOGE(AUTH_FSM, "can't find sessionKey, index=%{public}d", index);
|
||||
@ -357,7 +359,6 @@ int32_t GetSessionKeyByIndex(const SessionKeyList *list, int32_t index, AuthLink
|
||||
AUTH_LOGE(AUTH_FSM, "get session key fail, index=%{public}d", index);
|
||||
return SOFTBUS_MEM_ERR;
|
||||
}
|
||||
item->isAvailable = true;
|
||||
item->lastUseTime = GetCurrentTimeMs();
|
||||
item->useTime[type] = item->lastUseTime;
|
||||
AUTH_LOGI(AUTH_FSM, "get session key succ, index=%{public}d, time=%{public}" PRIu64, index, item->lastUseTime);
|
||||
|
Loading…
Reference in New Issue
Block a user