Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/ekuiper/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ static int json_value_to_tag_value(union neu_json_value *req,
break;
case NEU_JSON_STR:
value->type = NEU_TYPE_STRING;
strncpy(value->value.str, req->val_str, sizeof(value->value.str));
strncpy(value->value.str, req->val_str, sizeof(value->value.str) - 1);
value->value.str[sizeof(value->value.str) - 1] = '\0';
break;
case NEU_JSON_DOUBLE:
value->type = NEU_TYPE_DOUBLE;
Expand Down
4 changes: 2 additions & 2 deletions plugins/restful/plugin_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void handle_add_plugin(nng_aio *aio)
header.ctx = aio;
header.type = NEU_REQ_ADD_PLUGIN;
header.otel_trace_type = NEU_OTEL_TRACE_TYPE_REST_COMM;
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN);
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN - 1);
cmd.schema_file = req->schema_file;
cmd.so_file = req->so_file;
ret = neu_plugin_op(plugin, header, &cmd);
Expand All @@ -66,7 +66,7 @@ void handle_update_plugin(nng_aio *aio)
header.ctx = aio;
header.type = NEU_REQ_UPDATE_PLUGIN;
header.otel_trace_type = NEU_OTEL_TRACE_TYPE_REST_COMM;
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN);
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN - 1);
cmd.schema_file = req->schema_file;
cmd.so_file = req->so_file;
ret = neu_plugin_op(plugin, header, &cmd);
Expand Down
22 changes: 9 additions & 13 deletions src/core/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,21 +1486,18 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
UT_array *apps = neu_subscribe_manager_find(
manager->subscribe_manager, cmd->driver, cmd->group);

forward_msg(manager, header, header->receiver);
neu_subscribe_manager_remove(manager->subscribe_manager,
cmd->driver, cmd->group);

if (NULL == apps) {
break;
}

// notify app node about group deletion
utarray_foreach(apps, neu_app_subscribe_t *, app)
{
forward_msg_copy(manager, header, app->app_name);
if (NULL != apps) {
utarray_foreach(apps, neu_app_subscribe_t *, app)
{
forward_msg_copy(manager, header, app->app_name);
}
utarray_free(apps);
}

utarray_free(apps);
forward_msg(manager, header, header->receiver);
}
break;
}
Expand All @@ -1518,13 +1515,10 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
neu_msg_exchange(header);
reply(manager, header, &e);
} else {
forward_msg(manager, header, header->receiver);

UT_array *apps = neu_subscribe_manager_find(
manager->subscribe_manager, cmd->driver, cmd->group);

if (NULL != apps) {
// notify app nodes about tag deletion
utarray_foreach(apps, neu_app_subscribe_t *, app)
{
neu_msg_t *msg_copy = neu_msg_copy((neu_msg_t *) header);
Expand All @@ -1538,6 +1532,8 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)

utarray_free(apps);
}

forward_msg(manager, header, header->receiver);
}

break;
Expand Down
1 change: 0 additions & 1 deletion src/parser/neu_json_fn.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ int neu_parse_param(const char *buf, char **err_param, int n,
int ret = 0;

if (neu_json_decode_value(json, &params_ele) != 0) {
neu_json_decode_free(json);
if (err_param) {
*err_param = strdup("params");
}
Expand Down
Loading