diff --git a/Platform/common/rpc/rpc_client.h b/Platform/common/rpc/rpc_client.h index b01f35bb8..f6dc82cf7 100755 --- a/Platform/common/rpc/rpc_client.h +++ b/Platform/common/rpc/rpc_client.h @@ -33,7 +33,7 @@ ret_code rpc_client_call(rpc_client* client, char* service_name, char* method_name, pointer input, int input_len, pointer* output, int* output_len); -ret_code rpc_client_recall(rpc_client**pclient, char* service_name, +ret_code rpc_client_recall(rpc_client**pclient, char* mod_name, char* service_name, char* method_name, pointer input, int input_len, pointer* output, int* output_len); @@ -45,7 +45,7 @@ ret_code rpc_client_call_async(rpc_client* client, char* service_name, char* method_name, pointer input, int input_len, rpc_callback callback, pointer data); -ret_code rpc_client_recall_async(rpc_client**pclient, char* service_name, +ret_code rpc_client_recall_async(rpc_client**pclient, char* mod_name, char* service_name, char* method_name, pointer input, int input_len, rpc_callback callback, pointer data); diff --git a/Platform/user/configm/config-api/configclient.c b/Platform/user/configm/config-api/configclient.c index ae58e4172..91e10e0ce 100644 --- a/Platform/user/configm/config-api/configclient.c +++ b/Platform/user/configm/config-api/configclient.c @@ -84,8 +84,9 @@ ret_code web_config_exec_sync(uint config_type, uint64 config_id, config_len, &config_msg, &msg_len); ASSERT_RET(code); - code = rpc_client_recall(&g_config_client, "ConfigManger#0", "cm_config_process", - config_msg, msg_len, (pointer)output, output_len); + code = rpc_client_recall(&g_config_client, "ConfigManger#0", "ConfigManger#0", + "cm_config_process", config_msg, msg_len, + (pointer)output, output_len); ASSERT_RET_NO(code); config_destroy_msg(config_msg, msg_len); @@ -106,8 +107,8 @@ ret_code web_config_exec_async(uint config_type, uint64 config_id, config_len, &config_msg, &msg_len); ASSERT_RET(ret); - ret = rpc_client_recall_async(&g_config_client, "ConfigManger#0", "cm_config_process", - config_msg, msg_len, callback, data); + ret = rpc_client_recall_async(&g_config_client, "ConfigManger#0", "ConfigManger#0", + "cm_config_process", config_msg, msg_len, callback, data); ASSERT_RET_NO(ret); config_destroy_msg(config_msg, msg_len); diff --git a/Platform/user/rpc/rpc_client.c b/Platform/user/rpc/rpc_client.c index 9bdb6a506..2faaacd8d 100755 --- a/Platform/user/rpc/rpc_client.c +++ b/Platform/user/rpc/rpc_client.c @@ -189,7 +189,7 @@ ret_code rpc_client_call(rpc_client* client, char* service_name, } } -ret_code rpc_client_recall(rpc_client**pclient, char* service_name, +ret_code rpc_client_recall(rpc_client**pclient, char* mod_name, char* service_name, char* method_name, pointer input, int input_len, pointer* output, int* output_len) { @@ -211,7 +211,7 @@ ret_code rpc_client_recall(rpc_client**pclient, char* service_name, if(client == NULL) { - client = rpc_client_connect_ex(service_name); + client = rpc_client_connect_ex(mod_name); if(client) { *pclient = client; @@ -304,7 +304,7 @@ ret_code rpc_client_call_async(rpc_client* client, char* service_name, return ret; } -ret_code rpc_client_recall_async(rpc_client**pclient, char* service_name, +ret_code rpc_client_recall_async(rpc_client**pclient, char* mod_name, char* service_name, char* method_name, pointer input, int input_len, rpc_callback callback, pointer data) { @@ -326,7 +326,7 @@ ret_code rpc_client_recall_async(rpc_client**pclient, char* service_name, if(client == NULL) { - client = rpc_client_connect_ex(service_name); + client = rpc_client_connect_ex(mod_name); if(client) { *pclient = client; diff --git a/Platform/user/rpc/rpc_thread.c b/Platform/user/rpc/rpc_thread.c index d681ae91e..c31f79663 100755 --- a/Platform/user/rpc/rpc_thread.c +++ b/Platform/user/rpc/rpc_thread.c @@ -57,7 +57,7 @@ static void cb_dispatch_conn(struct ev_loop *l, struct ev_io *watcher, int cfd; if ((cfd = accept(th->sock_fd, NULL, NULL)) == -1) { //check errno - rpc_log_error("accept conn error"); + rpc_log_error("accept conn error\n"); return; } rpc_log_dbg("socket %d accept %d\r\n",th->sock_fd, cfd); @@ -118,7 +118,7 @@ void rpc_get_unix_socket_dir(char* socket_dir) if(mkdir(dir_path, 0777) != 0) { - rpc_log_error("create recovery file error"); + rpc_log_error("create recovery file error\n"); strcpy(socket_dir, ""); } else @@ -147,7 +147,7 @@ boolean rpc_unix_sockets_get(int port, int *psfd) if ((listenfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - rpc_log_error("socket error"); + rpc_log_error("socket error\n"); return FALSE; } @@ -168,13 +168,13 @@ boolean rpc_unix_sockets_get(int port, int *psfd) if (bind(listenfd, (struct sockaddr *)&serun, size) < 0) { - rpc_log_error("bind error"); + rpc_log_error("bind error\n"); return FALSE; } if (listen(listenfd, BACKLOG) < 0) { - rpc_log_error("listen error"); + rpc_log_error("listen error\n"); return FALSE; } @@ -201,7 +201,7 @@ boolean rpc_unix_socketc_get(char *host, int port, int*pcfd) if ((sockfd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - rpc_log_error("client socket error"); + rpc_log_error("client socket error\n"); return FALSE; } @@ -215,7 +215,7 @@ boolean rpc_unix_socketc_get(char *host, int port, int*pcfd) len = offsetof(struct sockaddr_un, sun_path) + strlen(cliun.sun_path); if (connect(sockfd, (struct sockaddr *)&cliun, len) < 0) { - rpc_log_error("connect error"); + rpc_log_error("connect error\n"); close(sockfd); return FALSE; } @@ -249,13 +249,13 @@ boolean rpc_tcp_sockets_get(int port, int *psfd) if (bind(sfd, (struct sockaddr*) &addr, sizeof(addr)) == -1) { - rpc_log_error("bind error"); + rpc_log_error("bind error\n"); return FALSE; } if (listen(sfd, BACKLOG) == -1) { - rpc_log_error("accept error"); + rpc_log_error("accept error\n"); return FALSE; } @@ -284,7 +284,7 @@ int rpc_tcp_socketc_get(char *host, int port, int*pcfd) if (connect(cfd, (struct sockaddr*) &addr, sizeof(addr)) == -1) { - rpc_log_error("connect error"); + rpc_log_error("connect error\n"); return FALSE; } rpc_set_non_block(cfd); @@ -301,7 +301,7 @@ boolean rpc_dispatch_init(rpc_dispatch_thread *th) { if(rpc_unix_sockets_get(th->server->port, &sfd) != TRUE) { - rpc_log_error("unix sockets get error"); + rpc_log_error("unix sockets get error\n"); return FALSE; } @@ -320,7 +320,7 @@ boolean rpc_dispatch_start(rpc_dispatch_thread *th) { pthread_t pid; int ret = pthread_create(&pid, NULL, thread_dispatch_handler, th); if (ret == -1) { - rpc_log_error("create dispatch thread error"); + rpc_log_error("create dispatch thread error\n"); return FALSE; } return TRUE; @@ -332,7 +332,7 @@ rpc_conn *rpc_req_conns_new(rpc_client *client, rpc_client_thread *th) int cfd = -1; if(rpc_unix_socketc_get(client->host, client->port, &cfd) != TRUE) { - rpc_log_error("connect error"); + rpc_log_error("connect error\n"); return NULL; } c = rpc_conn_client_new(cfd, th->loop);