mirror of
https://github.com/emqx/neuron.git
synced 2026-10-24 18:51:30 +08:00
@@ -65,7 +65,7 @@ struct neu_rest_handler cors_handler[] = {
|
||||
.url = "/api/v2/tags",
|
||||
},
|
||||
{
|
||||
.url = "/api/v2/gconfig",
|
||||
.url = "/api/v2/group",
|
||||
},
|
||||
{
|
||||
.url = "/api/v2/node",
|
||||
|
||||
@@ -79,7 +79,9 @@ static int persister_singleton_load_plugins(neu_adapter_t *adapter)
|
||||
nlog_info("%s load plugin %s, lib:%s", adapter->name, ok_or_err, *name);
|
||||
}
|
||||
|
||||
neu_persist_plugin_infos_free(plugin_infos);
|
||||
utarray_foreach(plugin_infos, char **, name) { free(*name); }
|
||||
utarray_free(plugin_infos);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -458,7 +460,7 @@ static int adapter_command(neu_adapter_t *adapter, neu_reqresp_head_t header,
|
||||
|
||||
msg = neu_msg_gen(&header, data);
|
||||
|
||||
ret = nng_sendmsg(adapter->nng.sock, msg, NNG_FLAG_NONBLOCK);
|
||||
ret = nng_sendmsg(adapter->nng.sock, msg, 0);
|
||||
if (ret != 0) {
|
||||
nng_msg_free(msg);
|
||||
}
|
||||
@@ -684,6 +686,7 @@ int neu_adapter_init(neu_adapter_t *adapter)
|
||||
|
||||
assert(rv == 0);
|
||||
|
||||
nng_socket_set_ms(adapter->nng.sock, NNG_OPT_SENDTIMEO, 100);
|
||||
nng_socket_get_int(adapter->nng.sock, NNG_OPT_RECVFD, &adapter->recv_fd);
|
||||
param.fd = adapter->recv_fd;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ int neu_plugin_manager_add(neu_plugin_manager_t *mgr,
|
||||
const char * plugin_lib_name);
|
||||
int neu_plugin_manager_del(neu_plugin_manager_t *mgr, const char *plugin_name);
|
||||
|
||||
// neu_plugin_lib_info_t array
|
||||
// neu_resp_plugin_info_t array
|
||||
UT_array *neu_plugin_manager_get(neu_plugin_manager_t *mgr);
|
||||
int neu_plugin_manager_find(neu_plugin_manager_t *mgr, const char *plugin_name,
|
||||
neu_resp_plugin_info_t *info);
|
||||
|
||||
@@ -798,9 +798,9 @@ int neu_persister_store_plugins(neu_persister_t *persister,
|
||||
|
||||
plugin_resp.plugins = calloc(utarray_len(plugin_infos), sizeof(char *));
|
||||
|
||||
utarray_foreach(plugin_infos, char **, name)
|
||||
utarray_foreach(plugin_infos, neu_resp_plugin_info_t *, plugin)
|
||||
{
|
||||
plugin_resp.plugins[index] = *name;
|
||||
plugin_resp.plugins[index] = plugin->library;
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ static inline void neu_persist_adapter_infos_free(UT_array *adapter_infos)
|
||||
|
||||
static inline void neu_persist_plugin_infos_free(UT_array *plugin_infos)
|
||||
{
|
||||
utarray_foreach(plugin_infos, neu_persist_plugin_info_t **, p) { free(*p); }
|
||||
utarray_free(plugin_infos);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ int neu_jwt_new(char **token)
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
ret = jwt_add_grant_int(jwt, "exp", tv.tv_sec + 60 * 60 * 24 * 365);
|
||||
ret = jwt_add_grant_int(jwt, "exp", tv.tv_sec + 60 * 60);
|
||||
if (ret != 0) {
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user