mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-24 01:09:51 +00:00
fix: modify extra
Signed-off-by: liangjunhao <liangjunhao10@huawei.com>
This commit is contained in:
parent
527d87ec55
commit
093c4b5003
@ -28,6 +28,7 @@ extern "C" {
|
||||
#define MSG_FLAG_REQUEST 0
|
||||
#define MES_FLAG_REPLY 1
|
||||
#define TRAFFIC_LEN 32
|
||||
#define UNKNOW_OS_TYPE 1 /* peer osType unknow */
|
||||
|
||||
typedef struct {
|
||||
const char *sessionName;
|
||||
|
@ -442,7 +442,7 @@ static void OnRecvAuthChannelReply(int32_t authId, const char *data, int32_t len
|
||||
.channelType = CHANNEL_TYPE_AUTH,
|
||||
.authId = authId,
|
||||
.linkType = info.connOpt.type,
|
||||
.osType = info.appInfo.osType
|
||||
.osType = (info.appInfo.osType < 0) ? UNKNOW_OS_TYPE : info.appInfo.osType,
|
||||
};
|
||||
TRANS_EVENT(EVENT_SCENE_OPEN_CHANNEL, EVENT_STAGE_HANDSHAKE_REPLY, extra);
|
||||
int32_t ret = TransAuthChannelMsgUnpack(data, &info.appInfo, len);
|
||||
|
@ -507,7 +507,7 @@ static void TransAsyncOpenChannelProc(uint32_t laneHandle, SessionParam *param,
|
||||
goto EXIT_ERR;
|
||||
}
|
||||
extra->peerUdid = appInfo->peerUdid;
|
||||
extra->osType = appInfo->osType;
|
||||
extra->osType = (appInfo->osType < 0) ? UNKNOW_OS_TYPE : appInfo->osType;
|
||||
appInfo->connectType = connOpt.type;
|
||||
extra->linkType = connOpt.type;
|
||||
FillAppInfo(appInfo, param, &transInfo, connInnerInfo);
|
||||
|
@ -53,7 +53,7 @@ static int32_t TransServerOnChannelOpened(const char *pkgName, int32_t pid, cons
|
||||
.result = EVENT_STAGE_RESULT_OK,
|
||||
.callerPkg = pkgName,
|
||||
.socketName = sessionName,
|
||||
.osType = osType,
|
||||
.osType = (osType < 0) ? UNKNOW_OS_TYPE : osType,
|
||||
.peerUdid = peerUdid
|
||||
};
|
||||
CoreSessionState state = CORE_SESSION_STATE_INIT;
|
||||
|
@ -134,7 +134,7 @@ int32_t OnProxyChannelOpened(int32_t channelId, const AppInfo *appInfo, unsigned
|
||||
.errcode = ret,
|
||||
.result = (ret == SOFTBUS_OK) ? EVENT_STAGE_RESULT_OK : EVENT_STAGE_RESULT_FAILED
|
||||
};
|
||||
extra.osType = appInfo->osType;
|
||||
extra.osType = (appInfo->osType < 0) ? UNKNOW_OS_TYPE : appInfo->osType;
|
||||
extra.peerUdid = appInfo->peerUdid;
|
||||
if (!isServer) {
|
||||
extra.peerUdid = appInfo->appType == APP_TYPE_AUTH ? appInfo->peerData.deviceId : NULL;
|
||||
@ -204,7 +204,7 @@ int32_t OnProxyChannelOpenFailed(int32_t channelId, const AppInfo *appInfo, int3
|
||||
.callerPkg = appInfo->myData.pkgName,
|
||||
.socketName = appInfo->myData.sessionName,
|
||||
.peerUdid = appInfo->peerUdid,
|
||||
.osType = appInfo->osType,
|
||||
.osType = (appInfo->osType < 0) ? UNKNOW_OS_TYPE : appInfo->osType,
|
||||
.result = EVENT_STAGE_RESULT_FAILED
|
||||
};
|
||||
TRANS_EVENT(EVENT_SCENE_OPEN_CHANNEL, EVENT_STAGE_OPEN_CHANNEL_END, extra);
|
||||
|
@ -52,7 +52,7 @@ static void OnSessionOpenFailProc(const SessionConn *node, int32_t errCode)
|
||||
.linkType = node->appInfo.connectType,
|
||||
.costTime = (int32_t)timeDiff,
|
||||
.errcode = errCode,
|
||||
.osType = node->appInfo.osType,
|
||||
.osType = (node->appInfo.osType < 0) ? UNKNOW_OS_TYPE : node->appInfo.osType,
|
||||
.peerUdid = node->appInfo.peerUdid,
|
||||
.result = EVENT_STAGE_RESULT_FAILED
|
||||
};
|
||||
|
@ -467,7 +467,7 @@ int32_t NotifyChannelOpenFailed(int32_t channelId, int32_t errCode)
|
||||
.linkType = conn.appInfo.connectType,
|
||||
.costTime = timediff,
|
||||
.errcode = errCode,
|
||||
.osType = conn.appInfo.osType,
|
||||
.osType = (conn.appInfo.osType < 0) ? UNKNOW_OS_TYPE : (conn.appInfo.osType),
|
||||
.peerUdid = conn.appInfo.peerUdid,
|
||||
.result = EVENT_STAGE_RESULT_FAILED
|
||||
};
|
||||
|
@ -190,7 +190,7 @@ int32_t NotifyUdpChannelOpenFailed(const AppInfo *info, int32_t errCode)
|
||||
.linkType = info->connectType,
|
||||
.costTime = timediff,
|
||||
.errcode = errCode,
|
||||
.osType = info->osType,
|
||||
.osType = (info->osType < 0) ? UNKNOW_OS_TYPE : info->osType,
|
||||
.peerUdid = info->peerUdid,
|
||||
.result = EVENT_STAGE_RESULT_FAILED
|
||||
};
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "trans_log.h"
|
||||
|
||||
#define DFX_TIMERS_S 15
|
||||
#define RETRY_GET_INFO_TIMES_MS 300
|
||||
|
||||
static IClientSessionCallBack g_sessionCb;
|
||||
|
||||
@ -273,7 +274,7 @@ NO_SANITIZE("cfi") int32_t TransOnSessionOpened(const char *sessionName, const C
|
||||
} else {
|
||||
ret = ClientEnableSessionByChannelId(channel, &sessionId);
|
||||
if (ret == SOFTBUS_TRANS_SESSION_INFO_NOT_FOUND) {
|
||||
SoftBusSleepMs(300); // avoid set channel info later than sesssion opened callback
|
||||
SoftBusSleepMs(RETRY_GET_INFO_TIMES_MS); // avoid set channel info later than sesssion opened callback
|
||||
ret = ClientEnableSessionByChannelId(channel, &sessionId);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user