diff --git a/samgr_endpoint/source/endpoint_rpc.c b/samgr_endpoint/source/endpoint_rpc.c index 68ab453dcef717ff7dbb9421e78eba23ae24e9aa..a583e7e9184f602648c2fd736ece26a90c403fe4 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 55f1cb44a9b7dace1bdf3017ce29715406cad6e7..b2133f3e6256e44120039b4a7d6e90430f4c8106 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);