加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0009-fix-some-bugs-that-occur-when-execute-obj-add-or-del.patch 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
yangxin 提交于 2021-09-30 22:57 . Update etmem.
From a3e62729dafbb634a73921c2200337fb46ab923e Mon Sep 17 00:00:00 2001
From: louhongxiang <louhongxiang@huawei.com>
Date: Thu, 29 Apr 2021 10:47:51 +0800
Subject: [PATCH 09/50] fix some bugs that occur when execute obj add or del
command.
---
src/etmem_src/etmem_rpc.c | 2 +-
src/etmemd_src/etmemd_file.c | 4 ++++
src/etmemd_src/etmemd_rpc.c | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/etmem_src/etmem_rpc.c b/src/etmem_src/etmem_rpc.c
index 8d03914..fadf1ea 100644
--- a/src/etmem_src/etmem_rpc.c
+++ b/src/etmem_src/etmem_rpc.c
@@ -182,7 +182,7 @@ static int etmem_client_recv(int sockfd)
recv_msg = (char *)recv_buf;
recv_msg[recv_size] = '\0';
- printf("%s", recv_msg);
+ printf("%s\n", recv_msg);
if (etmem_recv_find_fail_keyword(recv_msg)) {
printf("error occurs when getting response from etmemd server\n");
goto EXIT;
diff --git a/src/etmemd_src/etmemd_file.c b/src/etmemd_src/etmemd_file.c
index ac2654e..8b478c6 100644
--- a/src/etmemd_src/etmemd_file.c
+++ b/src/etmemd_src/etmemd_file.c
@@ -35,6 +35,10 @@ static int parse_item(GKeyFile *config, char *group_name, struct config_item *it
break;
case STR_VAL:
val = (void *)g_key_file_get_string(config, group_name, item->key, &error);
+ if (val == NULL || strlen(val) == 0) {
+ etmemd_log(ETMEMD_LOG_ERR, "section %s of group [%s] should not be empty\n", item->key, group_name);
+ return -1;
+ }
break;
default:
etmemd_log(ETMEMD_LOG_ERR, "config item type %d not support\n", item->type);
diff --git a/src/etmemd_src/etmemd_rpc.c b/src/etmemd_src/etmemd_rpc.c
index 49c292d..a8653e2 100644
--- a/src/etmemd_src/etmemd_rpc.c
+++ b/src/etmemd_src/etmemd_rpc.c
@@ -63,7 +63,7 @@ struct rpc_resp_msg g_resp_msg_arr[] = {
{OPT_ENG_NOEXIST, "error: engine is not exist"},
{OPT_TASK_EXISTED, "error: task has been existed"},
{OPT_TASK_NOEXIST, "error: task is not exist"},
- {OPT_INTER_ERR, "error: etmemd has internal error"},
+ {OPT_INTER_ERR, "error: etmemd has internal error, see reason details in messages"},
{OPT_RET_END, NULL},
};
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化