未验证 提交 db4f395b 编写于 作者: O openharmony_ci 提交者: Gitee

!974 【OpenHarmony开源贡献者计划2022】 修改单词拼写错误

Merge pull request !974 from Mupceet/init_725
......@@ -28,7 +28,7 @@ void DeviceInfoLoad::OnLoadSystemAbilitySuccess(int32_t systemAbilityId,
const sptr<IRemoteObject>& remoteObject)
{
DINFO_CHECK(systemAbilityId == SYSPARAM_DEVICE_SERVICE_ID, return,
"start aystemabilityId is not deviceinfo! %d", systemAbilityId);
"start systemabilityId is not deviceinfo! %d", systemAbilityId);
DINFO_CHECK(remoteObject != nullptr, return, "remoteObject is null.");
DINFO_LOGI("OnLoadSystemAbilitySuccess start systemAbilityId: %d success!", systemAbilityId);
......@@ -38,7 +38,7 @@ void DeviceInfoLoad::OnLoadSystemAbilitySuccess(int32_t systemAbilityId,
void DeviceInfoLoad::OnLoadSystemAbilityFail(int32_t systemAbilityId)
{
DINFO_CHECK(systemAbilityId == SYSPARAM_DEVICE_SERVICE_ID, return,
"start aystemabilityId is not deviceinfo! %d", systemAbilityId);
"start systemabilityId is not deviceinfo! %d", systemAbilityId);
DINFO_LOGI("OnLoadSystemAbilityFail systemAbilityId: %d failed.", systemAbilityId);
......
......@@ -68,9 +68,9 @@ static void CmdOnRecvMessage(const TaskHandle task, const uint8_t *buffer, uint3
BEGET_LOGI("[control_fd] CmdOnRecvMessage %s len %d.", (char *)buffer, buffLen);
}
static void CmdOnConntectComplete(const TaskHandle client)
static void CmdOnConnectComplete(const TaskHandle client)
{
BEGET_LOGI("[control_fd] CmdOnConntectComplete");
BEGET_LOGI("[control_fd] CmdOnConnectComplete");
}
static void CmdOnClose(const TaskHandle task)
......@@ -105,8 +105,8 @@ static CmdAgent *CmdAgentCreate(const char *server)
info.server = (char *)server;
info.baseInfo.userDataSize = sizeof(CmdAgent);
info.baseInfo.close = CmdOnClose;
info.disConntectComplete = CmdDisConnectComplete;
info.connectComplete = CmdOnConntectComplete;
info.disConnectComplete = CmdDisConnectComplete;
info.connectComplete = CmdOnConnectComplete;
info.sendMessageComplete = CmdOnSendMessageComplete;
info.recvMessage = CmdOnRecvMessage;
LE_STATUS status = LE_CreateStreamClient(LE_GetDefaultLoop(), &task, &info);
......
......@@ -88,14 +88,14 @@ static int SendMessage(LoopHandle loop, TaskHandle task, const char *message)
return 0;
}
static int CmdOnIncommingConntect(const LoopHandle loop, const TaskHandle server)
static int CmdOnIncommingConnect(const LoopHandle loop, const TaskHandle server)
{
TaskHandle client = NULL;
LE_StreamInfo info = {};
info.baseInfo.flags = TASK_STREAM | TASK_PIPE | TASK_CONNECT;
info.baseInfo.close = OnClose;
info.baseInfo.userDataSize = sizeof(CmdTask);
info.disConntectComplete = NULL;
info.disConnectComplete = NULL;
info.sendMessageComplete = NULL;
info.recvMessage = CmdOnRecvMessage;
int ret = LE_AcceptStreamClient(LE_GetDefaultLoop(), server, &client, &info);
......@@ -122,8 +122,8 @@ void CmdServiceInit(const char *socketPath, CallbackControlFdProcess func)
info.server = (char *)socketPath;
info.socketId = -1;
info.baseInfo.close = NULL;
info.disConntectComplete = NULL;
info.incommingConntect = CmdOnIncommingConntect;
info.disConnectComplete = NULL;
info.incommingConnect = CmdOnIncommingConnect;
info.sendMessageComplete = NULL;
info.recvMessage = NULL;
g_controlFdFunc = func;
......
......@@ -37,7 +37,7 @@ typedef enum {
SERVICE_SUSPENDED,
SERVICE_FREEZED,
SERVICE_DISABLED,
SERVICE_CRITIAL
SERVICE_CRITICAL
} ServiceStatus;
enum ServiceAction {
......
......@@ -93,17 +93,17 @@ typedef struct {
#define TASK_SERVER (0x01 << 16)
#define TASK_CONNECT (0x02 << 16)
#define TASK_TEST (0x01 << 24)
typedef void (*LE_DisConntectComplete)(const TaskHandle client);
typedef void (*LE_ConntectComplete)(const TaskHandle client);
typedef void (*LE_DisConnectComplete)(const TaskHandle client);
typedef void (*LE_ConnectComplete)(const TaskHandle client);
typedef void (*LE_SendMessageComplete)(const TaskHandle taskHandle, BufferHandle handle);
typedef void (*LE_RecvMessage)(const TaskHandle taskHandle, const uint8_t *buffer, uint32_t buffLen);
typedef int (*LE_IncommingConntect)(const LoopHandle loopHandle, const TaskHandle serverTask);
typedef int (*LE_IncommingConnect)(const LoopHandle loopHandle, const TaskHandle serverTask);
typedef struct {
LE_BaseInfo baseInfo;
char *server;
int socketId;
LE_DisConntectComplete disConntectComplete;
LE_IncommingConntect incommingConntect;
LE_DisConnectComplete disConnectComplete;
LE_IncommingConnect incommingConnect;
LE_SendMessageComplete sendMessageComplete;
LE_RecvMessage recvMessage;
} LE_StreamServerInfo;
......@@ -111,8 +111,8 @@ typedef struct {
typedef struct {
LE_BaseInfo baseInfo;
char *server;
LE_DisConntectComplete disConntectComplete;
LE_ConntectComplete connectComplete;
LE_DisConnectComplete disConnectComplete;
LE_ConnectComplete connectComplete;
LE_SendMessageComplete sendMessageComplete;
LE_RecvMessage recvMessage;
} LE_StreamInfo;
......
......@@ -93,8 +93,8 @@ static LE_STATUS HandleStreamEvent_(const LoopHandle loopHandle, const TaskHandl
}
if (status == LE_DIS_CONNECTED) {
loop->delEvent(loop, GetSocketFd(handle), Event_Read | Event_Write);
if (stream->disConntectComplete) {
stream->disConntectComplete(handle);
if (stream->disConnectComplete) {
stream->disConnectComplete(handle);
}
LE_CloseStreamTask(loopHandle, handle);
}
......@@ -116,8 +116,8 @@ static LE_STATUS HandleClientEvent_(const LoopHandle loopHandle, const TaskHandl
status = HandleRecvMsg_(loopHandle, handle, client->recvMessage);
}
if (status == LE_DIS_CONNECTED) {
if (client->disConntectComplete) {
client->disConntectComplete(handle);
if (client->disConnectComplete) {
client->disConnectComplete(handle);
}
client->connected = 0;
LE_CloseStreamTask(loopHandle, handle);
......@@ -141,9 +141,9 @@ static LE_STATUS HandleServerEvent_(const LoopHandle loopHandle, const TaskHandl
return LE_FAILURE;
}
StreamServerTask *server = (StreamServerTask *)serverTask;
LE_ONLY_CHECK(server->incommingConntect != NULL, return LE_SUCCESS);
LE_ONLY_CHECK(server->incommingConnect != NULL, return LE_SUCCESS);
int ret = server->incommingConntect(loopHandle, serverTask);
int ret = server->incommingConnect(loopHandle, serverTask);
if (ret != LE_SUCCESS) {
LE_LOGE("HandleServerEvent_ fd %d do not accept socket", GetSocketFd(serverTask));
}
......@@ -157,8 +157,8 @@ LE_STATUS LE_CreateStreamServer(const LoopHandle loopHandle,
{
LE_CHECK(loopHandle != NULL && taskHandle != NULL && info != NULL, return LE_INVALID_PARAM, "Invalid parameters");
LE_CHECK(info->server != NULL, return LE_INVALID_PARAM, "Invalid parameters server");
LE_CHECK(info->incommingConntect != NULL, return LE_INVALID_PARAM,
"Invalid parameters incommingConntect %s", info->server);
LE_CHECK(info->incommingConnect != NULL, return LE_INVALID_PARAM,
"Invalid parameters incommingConnect %s", info->server);
int fd = info->socketId;
if (info->socketId <= 0) {
......@@ -173,7 +173,7 @@ LE_STATUS LE_CreateStreamServer(const LoopHandle loopHandle,
return LE_NO_MEMORY, "Failed to create task");
task->base.handleEvent = HandleServerEvent_;
task->base.innerClose = HandleStreamTaskClose_;
task->incommingConntect = info->incommingConntect;
task->incommingConnect = info->incommingConnect;
loop->addEvent(loop, (const BaseTask *)task, Event_Read);
int ret = memcpy_s(task->server, strlen(info->server) + 1, info->server, strlen(info->server) + 1);
LE_CHECK(ret == 0, return LE_FAILURE, "Failed to copy server name %s", info->server);
......@@ -201,7 +201,7 @@ LE_STATUS LE_CreateStreamClient(const LoopHandle loopHandle,
task->connectComplete = info->connectComplete;
task->sendMessageComplete = info->sendMessageComplete;
task->recvMessage = info->recvMessage;
task->disConntectComplete = info->disConntectComplete;
task->disConnectComplete = info->disConnectComplete;
EventLoop *loop = (EventLoop *)loopHandle;
loop->addEvent(loop, (const BaseTask *)task, Event_Read);
*taskHandle = (TaskHandle)task;
......@@ -225,7 +225,7 @@ LE_STATUS LE_AcceptStreamClient(const LoopHandle loopHandle, const TaskHandle se
return LE_NO_MEMORY, "Failed to create task");
task->stream.base.handleEvent = HandleStreamEvent_;
task->stream.base.innerClose = HandleStreamTaskClose_;
task->disConntectComplete = info->disConntectComplete;
task->disConnectComplete = info->disConnectComplete;
task->sendMessageComplete = info->sendMessageComplete;
task->recvMessage = info->recvMessage;
task->serverTask = (StreamServerTask *)server;
......
......@@ -72,7 +72,7 @@ typedef struct LiteTask_ {
typedef struct {
BaseTask base;
LE_IncommingConntect incommingConntect;
LE_IncommingConnect incommingConnect;
char server[0];
} StreamServerTask;
......@@ -91,13 +91,13 @@ typedef struct {
StreamServerTask *serverTask;
LE_SendMessageComplete sendMessageComplete;
LE_RecvMessage recvMessage;
LE_DisConntectComplete disConntectComplete;
LE_DisConnectComplete disConnectComplete;
} StreamConnectTask;
typedef struct {
StreamTask stream;
LE_DisConntectComplete disConntectComplete;
LE_ConntectComplete connectComplete;
LE_DisConnectComplete disConnectComplete;
LE_ConnectComplete connectComplete;
LE_SendMessageComplete sendMessageComplete;
LE_RecvMessage recvMessage;
uint32_t connected : 1;
......
......@@ -20,7 +20,7 @@
#include "param_utils.h"
#include "securec.h"
int ConntectServer(int fd, const char *servername)
int ConnectServer(int fd, const char *servername)
{
PARAM_CHECK(fd >= 0, return -1, "Invalid fd %d", fd);
int opt = 1;
......@@ -36,7 +36,7 @@ int ConntectServer(int fd, const char *servername)
int len = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path);
ret = connect(fd, (struct sockaddr *)&addr, len);
PARAM_CHECK(ret != -1, return -1, "Failed to connect server %s %d", servername, errno);
PARAM_LOGV("ConntectServer %s success", servername);
PARAM_LOGV("ConnectServer %s success", servername);
return 0;
}
......
......@@ -75,7 +75,7 @@ typedef int (*RecvMessage)(const ParamTaskPtr stream, const ParamMessage *msg);
typedef struct {
uint32_t flags;
char *server;
LE_IncommingConntect incomingConnect;
LE_IncommingConnect incomingConnect;
RecvMessage recvMessage;
LE_Close close;
} ParamStreamInfo;
......@@ -97,7 +97,7 @@ int FillParamMsgContent(const ParamMessage *request, uint32_t *start, int type,
ParamMsgContent *GetNextContent(const ParamMessage *reqest, uint32_t *offset);
ParamMessage *CreateParamMessage(int type, const char *name, uint32_t msgSize);
int ConntectServer(int fd, const char *servername);
int ConnectServer(int fd, const char *servername);
#ifdef STARTUP_INIT_TEST
int ProcessMessage(const ParamTaskPtr worker, const ParamMessage *msg);
......
......@@ -52,7 +52,7 @@ int ParamServerCreate(ParamTaskPtr *stream, const ParamStreamInfo *streamInfo)
info.baseInfo.flags = TASK_STREAM | TASK_PIPE | TASK_SERVER;
info.server = streamInfo->server;
info.baseInfo.close = streamInfo->close;
info.incommingConntect = streamInfo->incomingConnect;
info.incommingConnect = streamInfo->incomingConnect;
return LE_CreateStreamServer(LE_GetDefaultLoop(), stream, &info);
}
......@@ -69,7 +69,7 @@ int ParamStreamCreate(ParamTaskPtr *stream, ParamTaskPtr server,
info.baseInfo.flags |= TASK_TEST;
}
info.baseInfo.close = streamInfo->close;
info.disConntectComplete = NULL;
info.disConnectComplete = NULL;
info.sendMessageComplete = NULL;
info.recvMessage = OnReceiveRequest;
g_recvMessage = streamInfo->recvMessage;
......
......@@ -108,7 +108,7 @@ static int GetClientSocket(int timeout)
time.tv_usec = 0;
int clientFd = socket(AF_UNIX, SOCK_STREAM, 0);
PARAM_CHECK(clientFd >= 0, return -1, "Failed to create socket");
int ret = ConntectServer(clientFd, CLIENT_PIPE_NAME);
int ret = ConnectServer(clientFd, CLIENT_PIPE_NAME);
if (ret == 0) {
setsockopt(clientFd, SOL_SOCKET, SO_SNDTIMEO, (char *)&time, sizeof(struct timeval));
setsockopt(clientFd, SOL_SOCKET, SO_RCVTIMEO, (char *)&time, sizeof(struct timeval));
......
......@@ -296,7 +296,7 @@ int WatcherManager::GetServerFd(bool retry)
serverFd_ = socket(PF_UNIX, SOCK_STREAM, 0);
int flags = fcntl(serverFd_, F_GETFL, 0);
(void)fcntl(serverFd_, F_SETFL, flags & ~O_NONBLOCK);
ret = ConntectServer(serverFd_, CLIENT_PIPE_NAME);
ret = ConnectServer(serverFd_, CLIENT_PIPE_NAME);
if (ret == 0) {
break;
}
......
......@@ -543,7 +543,7 @@ const static InitArgInfo g_servieStatusMap[] = {
{"suspended", SERVICE_SUSPENDED},
{"freezed", SERVICE_FREEZED},
{"disabled", SERVICE_DISABLED},
{"critial", SERVICE_CRITIAL}
{"critical", SERVICE_CRITICAL}
};
const InitArgInfo *GetServieStatusMap(int *size)
......
......@@ -163,7 +163,7 @@ public:
info.baseInfo.flags = TASK_STREAM | TASK_PIPE | TASK_SERVER | TASK_TEST;
info.server = (char *)"/data/testpipe";
info.baseInfo.close = OnClose;
info.incommingConntect = IncomingConnect;
info.incommingConnect = IncomingConnect;
LE_CreateStreamServer(LE_GetDefaultLoop(), &serverTask_, &info);
if (serverTask_ == nullptr) {
return;
......@@ -246,7 +246,7 @@ public:
info.baseInfo.flags = TASK_PIPE | TASK_CONNECT | TASK_TEST;
info.server = (char *)"/data/testpipe";
info.baseInfo.close = OnClose;
info.incommingConntect = IncomingConnect;
info.incommingConnect = IncomingConnect;
info.socketId = 1111; // 1111 is test fd
LE_CreateStreamServer(LE_GetDefaultLoop(), &serverTask, &info);
EXPECT_NE(serverTask, nullptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册