mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-12-02 14:46:46 +00:00
ctrllane_optimized
Signed-off-by: wangrui <wangrui383@huawei.com>
This commit is contained in:
parent
6f780fdb07
commit
cf78219b53
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user