mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 02:40:40 +00:00
!5375 fix: add info for lnn log to avoid printing repeatedly
Merge pull request !5375 from wanghaoxu/master
This commit is contained in:
commit
2c291ef73b
@ -92,7 +92,7 @@ int32_t GetActiveOsAccountIds(void)
|
||||
LNN_LOGE(LNN_STATE, "QueryActiveOsAccountIds failed");
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
LNN_LOGI(LNN_STATE, "GetActiveOsAccountIds id=%{public}d", accountId[0]);
|
||||
LNN_LOGD(LNN_STATE, "account id=%{public}d", accountId[0]);
|
||||
return accountId[0];
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ static bool HasTrustedRelationWithLocalDevice(const DeviceGroupManager *gmInstan
|
||||
uint32_t groupNum = 0;
|
||||
char *returnGroupVec = NULL;
|
||||
if (gmInstance->getRelatedGroups(accountId, AUTH_APPID, localUdid, &returnGroupVec, &groupNum) != SOFTBUS_OK) {
|
||||
AUTH_LOGE(AUTH_HICHAIN, "GetRelatedGroups fail");
|
||||
AUTH_LOGE(AUTH_HICHAIN, "GetRelatedGroups fail, accountId=%{public}d", accountId);
|
||||
gmInstance->destroyInfo(&returnGroupVec);
|
||||
return false;
|
||||
}
|
||||
@ -225,7 +225,7 @@ static bool HasTrustedRelationWithLocalDevice(const DeviceGroupManager *gmInstan
|
||||
if (isPointToPoint) {
|
||||
int groupType = 0;
|
||||
if ((GetJsonObjectNumberItem(groupItem, GROUP_TYPE, &groupType) && groupType == SAME_ACCOUNT_GROUY_TYPE)) {
|
||||
AUTH_LOGI(AUTH_HICHAIN, "ignore same account group");
|
||||
AUTH_LOGD(AUTH_HICHAIN, "ignore same account group");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -911,8 +911,11 @@ static ProtocolType LnnLaneSelectProtocol(LnnNetIfType ifType, const char *netWo
|
||||
}
|
||||
|
||||
(void)LnnVisitPhysicalSubnet(FindBestProtocol, &req);
|
||||
|
||||
LNN_LOGI(LNN_LANE, "protocol=%{public}d", req.selectedProtocol);
|
||||
char *anonyNetworkId = NULL;
|
||||
Anonymize(netWorkId, &anonyNetworkId);
|
||||
LNN_LOGI(LNN_LANE, "networkId=%{public}s select protocol=%{public}d, pri=%{public}u",
|
||||
anonyNetworkId, req.selectedProtocol, req.currPri);
|
||||
AnonymizeFree(anonyNetworkId);
|
||||
if (req.selectedProtocol == 0) {
|
||||
req.selectedProtocol = LNN_PROTOCOL_IP;
|
||||
}
|
||||
@ -973,10 +976,10 @@ static int32_t LaneLinkOfWlan(uint32_t reqId, const LinkRequest *reqInfo, const
|
||||
}
|
||||
if (reqInfo->transType == LANE_T_MSG) {
|
||||
ret = LnnGetRemoteNumInfo(reqInfo->peerNetworkId, NUM_KEY_PROXY_PORT, &port);
|
||||
LNN_LOGI(LNN_LANE, "LnnGetRemote proxy port");
|
||||
LNN_LOGI(LNN_LANE, "LnnGetRemote proxy port, port=%{public}d, ret=%{public}d", port, ret);
|
||||
} else {
|
||||
ret = LnnGetRemoteNumInfo(reqInfo->peerNetworkId, NUM_KEY_SESSION_PORT, &port);
|
||||
LNN_LOGI(LNN_LANE, "LnnGetRemote session port");
|
||||
LNN_LOGI(LNN_LANE, "LnnGetRemote session port, port=%{public}d, ret=%{public}d", port, ret);
|
||||
}
|
||||
if (ret < 0) {
|
||||
LNN_LOGE(LNN_LANE, "LnnGetRemote is failed.");
|
||||
|
@ -252,7 +252,11 @@ static int32_t AdjustLanePriority(const char *networkId, const LaneSelectParam *
|
||||
}
|
||||
if ((resListScore[LANE_WLAN_2P4G] == INVALID_LINK && resListScore[LANE_WLAN_5G] == INVALID_LINK) ||
|
||||
(resListScore[LANE_P2P] == INVALID_LINK && resListScore[LANE_HML] == INVALID_LINK)) {
|
||||
LNN_LOGI(LNN_LANE, "linklist does not require any changes");
|
||||
char *anonyNetworkId = NULL;
|
||||
Anonymize(networkId, &anonyNetworkId);
|
||||
LNN_LOGI(LNN_LANE, "linklist does not require any changes, networkId=%{public}s, resNum=%{public}u",
|
||||
anonyNetworkId, resNum);
|
||||
AnonymizeFree(anonyNetworkId);
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
uint32_t idxWlan = LANE_LINK_TYPE_BUTT;
|
||||
@ -284,16 +288,19 @@ int32_t SelectLane(const char *networkId, const LaneSelectParam *request,
|
||||
if (PreProcLaneSelect(networkId, request, recommendList, listNum) != SOFTBUS_OK) {
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
char *anonyNetworkId = NULL;
|
||||
Anonymize(networkId, &anonyNetworkId);
|
||||
LaneLinkType resList[LANE_LINK_TYPE_BUTT];
|
||||
uint32_t resNum = 0;
|
||||
(void)memset_s(resList, sizeof(resList), -1, sizeof(resList));
|
||||
if ((request->list.linkTypeNum > 0) && (request->list.linkTypeNum <= LANE_LINK_TYPE_BUTT)) {
|
||||
LNN_LOGI(LNN_LANE, "Select lane by preferred linklist");
|
||||
LNN_LOGI(LNN_LANE, "Select lane by preferred linklist, networkId=%{public}s", anonyNetworkId);
|
||||
SelectByPreferredLink(networkId, request, resList, &resNum);
|
||||
} else {
|
||||
LNN_LOGI(LNN_LANE, "Select lane by default linklist");
|
||||
LNN_LOGI(LNN_LANE, "Select lane by default linklist, networkId=%{public}s", anonyNetworkId);
|
||||
SelectByDefaultLink(networkId, request, resList, &resNum);
|
||||
}
|
||||
AnonymizeFree(anonyNetworkId);
|
||||
if (resNum == 0) {
|
||||
LNN_LOGE(LNN_LANE, "there is none linkResource can be used");
|
||||
*listNum = 0;
|
||||
|
@ -99,7 +99,10 @@ static bool IsEnableWlan2P4G(const char *networkId)
|
||||
{
|
||||
SoftBusBand band = SoftBusGetLinkBand();
|
||||
if (band != BAND_24G && band != BAND_UNKNOWN) {
|
||||
LNN_LOGE(LNN_LANE, "band isn't 2.4G or unknown");
|
||||
char *anonyNetworkId = NULL;
|
||||
Anonymize(networkId, &anonyNetworkId);
|
||||
LNN_LOGE(LNN_LANE, "band isn't 2.4G or unknown, networkId=%{public}s", anonyNetworkId);
|
||||
AnonymizeFree(anonyNetworkId);
|
||||
return false;
|
||||
}
|
||||
NodeInfo node;
|
||||
|
@ -198,7 +198,7 @@ static void DeleteLaneLinkNode(uint32_t laneId)
|
||||
static int32_t TriggerLink(uint32_t laneId, TransOption *request,
|
||||
LanePreferredLinkList *recommendLinkList)
|
||||
{
|
||||
LNN_LOGI(LNN_LANE, "TriggerLink enter");
|
||||
LNN_LOGI(LNN_LANE, "TriggerLink enter, laneId=%{public}u", laneId);
|
||||
LaneLinkNodeInfo *linkNode = (LaneLinkNodeInfo *)SoftBusCalloc(sizeof(LaneLinkNodeInfo));
|
||||
if (linkNode == NULL) {
|
||||
return SOFTBUS_MALLOC_ERR;
|
||||
|
@ -98,7 +98,7 @@ static bool GetIpProcess(const char *ifName, char *ip, uint32_t size)
|
||||
static VisitNextChoice NotifyWlanAddressChanged(const LnnNetIfMgr *netifManager, void *data)
|
||||
{
|
||||
if (netifManager->type == LNN_NETIF_TYPE_WLAN) {
|
||||
LNN_LOGI(LNN_BUILDER, "notify wlan changed");
|
||||
LNN_LOGI(LNN_BUILDER, "notify wlan changed at %{public}" PRIu64, SoftBusGetSysTimeMs());
|
||||
LnnNotifyPhysicalSubnetStatusChanged(netifManager->ifName, LNN_PROTOCOL_IP, data);
|
||||
}
|
||||
return CHOICE_VISIT_NEXT;
|
||||
|
@ -1664,7 +1664,10 @@ static void GetNodeInfoDiscovery(NodeInfo *oldInfo, NodeInfo *info, NodeInfoAbil
|
||||
info->metaInfo = oldInfo->metaInfo;
|
||||
}
|
||||
if (oldInfo != NULL && LnnIsNodeOnline(oldInfo)) {
|
||||
LNN_LOGI(LNN_LEDGER, "addOnlineNode find online node");
|
||||
char *anonyUuid = NULL;
|
||||
Anonymize(oldInfo->uuid, &anonyUuid);
|
||||
LNN_LOGI(LNN_LEDGER, "addOnlineNode find online node, uuid=%{public}s", anonyUuid);
|
||||
AnonymizeFree(anonyUuid);
|
||||
infoAbility->isOffline = false;
|
||||
infoAbility->isChanged = IsNetworkIdChanged(info, oldInfo);
|
||||
infoAbility->oldWifiFlag = LnnHasDiscoveryType(oldInfo, DISCOVERY_TYPE_WIFI);
|
||||
@ -1679,7 +1682,9 @@ static void GetNodeInfoDiscovery(NodeInfo *oldInfo, NodeInfo *info, NodeInfoAbil
|
||||
infoAbility->isNetworkChanged = true;
|
||||
} else {
|
||||
RetainOfflineCode(oldInfo, info);
|
||||
LNN_LOGE(LNN_LEDGER, "flag error");
|
||||
LNN_LOGE(LNN_LEDGER, "flag error, oldBleFlag=%{public}d, oldBrFlag=%{public}d, oldWifiFlag=%{public}d,"
|
||||
"newWifiFlag=%{public}d, newBleBrFlag=%{public}d", infoAbility->oldBleFlag, infoAbility->oldBrFlag,
|
||||
infoAbility->oldWifiFlag, infoAbility->newBleBrFlag, infoAbility->newBleBrFlag);
|
||||
}
|
||||
if ((infoAbility->oldBleFlag || infoAbility->oldBrFlag) && !infoAbility->oldWifiFlag &&
|
||||
infoAbility->newWifiFlag) {
|
||||
|
Loading…
Reference in New Issue
Block a user