mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-30 12:20:43 +00:00
commit
b226488da5
@ -34,11 +34,11 @@ enum {
|
||||
PENDING_TYPE_BUTT,
|
||||
};
|
||||
|
||||
int32_t PendingInit(int type);
|
||||
void PendingDeinit(int type);
|
||||
int32_t ProcPendingPacket(int32_t channelId, int32_t seqNum, int type);
|
||||
int32_t SetPendingPacket(int32_t channelId, int32_t seqNum, int type);
|
||||
int32_t DelPendingPacket(int32_t channelId, int type);
|
||||
int32_t PendingInit(int32_t type);
|
||||
void PendingDeinit(int32_t type);
|
||||
int32_t ProcPendingPacket(int32_t channelId, int32_t seqNum, int32_t type);
|
||||
int32_t SetPendingPacket(int32_t channelId, int32_t seqNum, int32_t type);
|
||||
int32_t DelPendingPacket(int32_t channelId, int32_t type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -50,7 +50,7 @@ static int32_t IsPendingListTypeLegal(int type)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
int32_t PendingInit(int type)
|
||||
int32_t PendingInit(int32_t type)
|
||||
{
|
||||
int32_t ret = IsPendingListTypeLegal(type);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
@ -66,7 +66,7 @@ int32_t PendingInit(int type)
|
||||
return SOFTBUS_OK;
|
||||
}
|
||||
|
||||
void PendingDeinit(int type)
|
||||
void PendingDeinit(int32_t type)
|
||||
{
|
||||
int32_t ret = IsPendingListTypeLegal(type);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
@ -166,7 +166,7 @@ int32_t ProcPendingPacket(int32_t channelId, int32_t seqNum, int32_t type)
|
||||
while (item->status == PACKAGE_STATUS_PENDING && TimeBefore(&outTime)) {
|
||||
SoftBusCondWait(&item->cond, &item->lock, &outTime);
|
||||
}
|
||||
ret = (item->status == PACKAGE_STATUS_FINISHED) ? SOFTBUS_OK : SOFTBUS_TIMOUT;
|
||||
int32_t errCode = (item->status == PACKAGE_STATUS_FINISHED) ? SOFTBUS_OK : SOFTBUS_TIMOUT;
|
||||
(void)SoftBusMutexUnlock(&item->lock);
|
||||
|
||||
ret = SoftBusMutexLock(&pendingList->lock);
|
||||
@ -176,10 +176,10 @@ int32_t ProcPendingPacket(int32_t channelId, int32_t seqNum, int32_t type)
|
||||
pendingList->cnt--;
|
||||
(void)SoftBusMutexUnlock(&pendingList->lock);
|
||||
ReleasePendingItem(item);
|
||||
return SOFTBUS_OK;
|
||||
return errCode;
|
||||
}
|
||||
|
||||
int32_t SetPendingPacket(int32_t channelId, int32_t seqNum, int type)
|
||||
int32_t SetPendingPacket(int32_t channelId, int32_t seqNum, int32_t type)
|
||||
{
|
||||
int32_t ret = IsPendingListTypeLegal(type);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
@ -209,7 +209,7 @@ int32_t SetPendingPacket(int32_t channelId, int32_t seqNum, int type)
|
||||
return SOFTBUS_ERR;
|
||||
}
|
||||
|
||||
int32_t DelPendingPacket(int32_t channelId, int type)
|
||||
int32_t DelPendingPacket(int32_t channelId, int32_t type)
|
||||
{
|
||||
int32_t ret = IsPendingListTypeLegal(type);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
|
@ -1323,7 +1323,7 @@ static void ReleaseSendListenerInfo(SendListenerInfo *sendInfo)
|
||||
DelSendListenerInfo(sendInfo);
|
||||
}
|
||||
|
||||
static void HandleFileSendingProcess(
|
||||
static int32_t HandleFileSendingProcess(
|
||||
int32_t channelId, const char *sFileList[], const char *dFileList[], uint32_t fileCnt)
|
||||
{
|
||||
SendListenerInfo *sendInfo = NULL;
|
||||
@ -1364,6 +1364,8 @@ static void HandleFileSendingProcess(
|
||||
ReleaseSendListenerInfo(sendInfo);
|
||||
sendInfo = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t ProxyChannelSendFile(int32_t channelId, const char *sFileList[], const char *dFileList[], uint32_t fileCnt)
|
||||
@ -1389,10 +1391,14 @@ int32_t ProxyChannelSendFile(int32_t channelId, const char *sFileList[], const c
|
||||
DelSessionFileLock(sessionLock);
|
||||
return SOFTBUS_LOCK_ERR;
|
||||
}
|
||||
HandleFileSendingProcess(channelId, sFileList, dFileList, fileCnt);
|
||||
|
||||
int32_t ret = HandleFileSendingProcess(channelId, sFileList, dFileList, fileCnt);
|
||||
if (ret != SOFTBUS_OK) {
|
||||
TRANS_LOGE(TRANS_FILE, "file senging process failed, ret=%{public}d", ret);
|
||||
}
|
||||
(void)SoftBusMutexUnlock(&sessionLock->sendLock);
|
||||
DelSessionFileLock(sessionLock);
|
||||
return SOFTBUS_OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool CheckRecvFileExist(const char *absFullPath)
|
||||
|
@ -136,6 +136,18 @@ MATCHER_P2(LnnValidParamArrayMatcher, inExtra, validSize, "lnn valid param array
|
||||
++index;
|
||||
EXPECT_STREQ(params[index].name, g_lnnAssigners[index].name);
|
||||
EXPECT_EQ(params[index].t, g_lnnAssigners[index].type);
|
||||
Anonymize(extra.localUdidHash, &anonyStr);
|
||||
EXPECT_STREQ(params[index].v.s, anonyStr);
|
||||
AnonymizeFree(anonyStr);
|
||||
++index;
|
||||
EXPECT_STREQ(params[index].name, g_lnnAssigners[index].name);
|
||||
EXPECT_EQ(params[index].t, g_lnnAssigners[index].type);
|
||||
Anonymize(extra.peerUdidHash, &anonyStr);
|
||||
EXPECT_STREQ(params[index].v.s, anonyStr);
|
||||
AnonymizeFree(anonyStr);
|
||||
++index;
|
||||
EXPECT_STREQ(params[index].name, g_lnnAssigners[index].name);
|
||||
EXPECT_EQ(params[index].t, g_lnnAssigners[index].type);
|
||||
EXPECT_STREQ(params[index].v.s, extra.callerPkg);
|
||||
++index;
|
||||
EXPECT_STREQ(params[index].name, g_lnnAssigners[index].name);
|
||||
|
@ -73,7 +73,7 @@ HWTEST_F(LnnEventTest, LnnEventTest002, TestSize.Level0)
|
||||
.lnnType = 11,
|
||||
.onlineNum = 12,
|
||||
.peerDeviceAbility = 13,
|
||||
.onlineType = 0,
|
||||
.onlineType = 14,
|
||||
.peerDeviceInfo = "testPeerDeviceInfo",
|
||||
.peerIp = "10.11.12.1",
|
||||
.peerBrMac = "dd:15:bc:b9:f2:04",
|
||||
|
@ -41,6 +41,7 @@ group("unittest") {
|
||||
if (has_enhance_test) {
|
||||
deps += [ "$dsoftbus_root_path/dsoftbus_enhance/test/core/transmission/trans_channel:unittest" ]
|
||||
deps += [ "$dsoftbus_root_path/dsoftbus_enhance/test/core/transmission/session:unittest" ]
|
||||
deps += [ "$dsoftbus_root_path/dsoftbus_enhance/test/core/transmission/spe:unittest" ]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -847,6 +847,7 @@ HWTEST_F(SoftbusProxyChannelManagerTest, TransProxyDeathCallbackTest001, TestSiz
|
||||
(void)strcpy_s(appInfo.myData.pkgName, TEST_PKG_NAME_LEN, TEST_PKGNAME);
|
||||
appInfo.appType = APP_TYPE_AUTH;
|
||||
appInfo.myData.pid = TEST_DEATH_CHANNEL_ID;
|
||||
// will free in TransProxyDeathCallback
|
||||
ProxyChannelInfo *chan = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
ASSERT_TRUE(NULL != chan);
|
||||
chan->channelId = TEST_DEATH_CHANNEL_ID;
|
||||
@ -859,8 +860,15 @@ HWTEST_F(SoftbusProxyChannelManagerTest, TransProxyDeathCallbackTest001, TestSiz
|
||||
TransProxyDeathCallback(NULL, TEST_DEATH_CHANNEL_ID);
|
||||
TransProxyDeathCallback(TEST_PKGNAME, TEST_DEATH_CHANNEL_ID);
|
||||
|
||||
ret = TransProxyGetSendMsgChanInfo(chan->channelId, chan);
|
||||
ProxyChannelInfo *chanInfo = (ProxyChannelInfo *)SoftBusCalloc(sizeof(ProxyChannelInfo));
|
||||
ASSERT_TRUE(NULL != chanInfo);
|
||||
chanInfo->channelId = TEST_DEATH_CHANNEL_ID;
|
||||
chanInfo->connId = TEST_NUMBER_VALID;
|
||||
chanInfo->status = PROXY_CHANNEL_STATUS_KEEPLIVEING;
|
||||
|
||||
ret = TransProxyGetSendMsgChanInfo(chanInfo->channelId, chanInfo);
|
||||
EXPECT_NE(SOFTBUS_OK, ret);
|
||||
SoftBusFree(chanInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user