ctrllane_optimized

Signed-off-by: wangrui <wangrui383@huawei.com>
This commit is contained in:
wangrui 2024-06-06 15:58:25 +08:00
parent 6f780fdb07
commit cf78219b53
4 changed files with 8 additions and 5 deletions

View File

@ -269,7 +269,7 @@ void AuthCloseConn(AuthHandle authHandle)
int32_t AuthAllocConn(const char *networkId, uint32_t authRequestId, AuthConnCallback *callback)
{
if (networkId == NULL || callback == NULL) {
AUTH_LOGE(AUTH_CONN, "authHandle is null");
AUTH_LOGE(AUTH_CONN, "param invalid");
return SOFTBUS_INVALID_PARAM;
}
return AuthAllocLane(networkId, authRequestId, callback);
@ -278,7 +278,7 @@ int32_t AuthAllocConn(const char *networkId, uint32_t authRequestId, AuthConnCal
void AuthFreeConn(const AuthHandle *authHandle)
{
if (authHandle == NULL) {
AUTH_LOGE(AUTH_CONN, "authHandle is null");
AUTH_LOGE(AUTH_CONN, "param invalid");
return;
}
AuthFreeLane(authHandle);

View File

@ -1964,7 +1964,6 @@ void AuthHandleLeaveLNN(AuthHandle authHandle)
AUTH_LOGI(AUTH_FSM, "AuthHandleLeaveLNN disconnect");
DisconnectAuthDevice(&auth->connId[authHandle.type]);
}
AuthFreeConn(&authHandle);
DelAuthManager(auth, authHandle.type);
ReleaseAuthLock();
}

View File

@ -365,9 +365,9 @@ static int32_t AllocCtrlLane(uint32_t laneHandle, const LaneAllocInfo *allocInfo
}
recommendLinkList->linkTypeNum = 0;
ret = SelectAuthLane(allocInfo->networkId, &request, recommendLinkList);
if (ret != SOFTBUS_OK || recommendLinkList->linkTypeNum == 0) {
if (ret != SOFTBUS_OK) {
SoftBusFree(recommendLinkList);
LNN_LOGE(LNN_LANE, "no abailable link resources, laneHandle=%{public}u", laneHandle);
LNN_LOGE(LNN_LANE, "select auth lane fail, laneHandle=%{public}u", laneHandle);
return ret;
}
for (uint32_t i = 0; i < recommendLinkList->linkTypeNum; ++i) {

View File

@ -569,5 +569,9 @@ int32_t SelectAuthLane(const char *networkId, LanePreferredLinkList *request, La
recommendList->linkTypeNum++;
}
}
if (recommendList->linkTypeNum == 0) {
LNN_LOGE(LNN_LANE, "no available link resources");
return SOFTBUS_LANE_NO_AVAILABLE_LINK;
}
return SOFTBUS_OK;
}