From cbe14ae4802d208a3dd9b0a083a81d879bd8ea8a Mon Sep 17 00:00:00 2001 From: SimonLi Date: Wed, 2 Mar 2022 11:14:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=8E=BB=E9=99=A4=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=92=8C=E5=A2=9E=E5=8A=A0=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SimonLi --- samgr_endpoint/source/endpoint_rpc.c | 7 ------- samgr_server/source/samgr_server_rpc.c | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/samgr_endpoint/source/endpoint_rpc.c b/samgr_endpoint/source/endpoint_rpc.c index 68ab453..a583e7e 100644 --- a/samgr_endpoint/source/endpoint_rpc.c +++ b/samgr_endpoint/source/endpoint_rpc.c @@ -113,26 +113,20 @@ int SAMGR_AddRouter(Endpoint *endpoint, const SaName *saName, const Identity *id if (endpoint == NULL || id == NULL || proxy == NULL || saName == NULL) { return EC_INVALID; } - printf("%s %d %d\n", __FUNCTION__ , __LINE__, pthread_self()); - //todo: handle version IServerProxy *serverProxy = NULL; proxy->QueryInterface(proxy, SERVER_PROXY_VER, (void *)&serverProxy); if (serverProxy == NULL) { } - printf("%s %d %d\n", __FUNCTION__ , __LINE__, pthread_self()); - // Lock the multi-write int index = VECTOR_FindByKey(&endpoint->routers, proxy); if (index != INVALID_INDEX) { serverProxy->Release((IUnknown *)serverProxy); } - printf("%s %d %d\n", __FUNCTION__ , __LINE__, pthread_self()); Router *router = SAMGR_Malloc(sizeof(Router)); if (router == NULL) { HILOG_ERROR(HILOG_MODULE_SAMGR, "Memory is not enough! Identity<%d, %d>", id->serviceId, id->featureId); return EC_NOMEMORY; } - printf("%s %d %d\n", __FUNCTION__ , __LINE__, pthread_self()); router->saName = *saName; router->identity = *id; router->proxy = serverProxy; @@ -143,7 +137,6 @@ int SAMGR_AddRouter(Endpoint *endpoint, const SaName *saName, const Identity *id SAMGR_Free(router); return EC_FAILURE; } - printf("%s %d %d\n", __FUNCTION__ , __LINE__, pthread_self()); Listen(endpoint, index, saName->service, saName->feature); return index; } diff --git a/samgr_server/source/samgr_server_rpc.c b/samgr_server/source/samgr_server_rpc.c index 55f1cb4..b2133f3 100644 --- a/samgr_server/source/samgr_server_rpc.c +++ b/samgr_server/source/samgr_server_rpc.c @@ -94,7 +94,7 @@ SaNode *GetSaNodeBySaName(const char *service, const char *feature) { if (strncmp(node->saName.service, service, MAX_NAME_LEN) == 0) { if (feature != NULL) { - if (strncmp(node->saName.feature, feature, MAX_NAME_LEN) == 0) { + if ((node->saName.feature != NULL) && (strncmp(node->saName.feature, feature, MAX_NAME_LEN) == 0)) { retNode = node; } } else { @@ -173,7 +173,6 @@ static void InitializeGSaList() static void InitializeRegistry(void) { - printf("%s %d\n", __FUNCTION__ , __LINE__); InitializeGSaList(); g_server.mtx = MUTEX_InitValue(); SASTORA_Init(&g_server.store); -- Gitee