plugin: store pointer to exec timeout value in the ops structure

This is required for plugins that need access to the configured execution
timeout. The global variable cannot be used as-is since we dlopen() with
RTLD_LOCAL.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-11-28 12:09:35 +01:00
parent ccd7c0af75
commit 7235f34895
2 changed files with 2 additions and 0 deletions

View file

@ -54,6 +54,7 @@ struct rpc_daemon_ops {
rpc_exec_read_cb_t err, rpc_exec_done_cb_t end, rpc_exec_read_cb_t err, rpc_exec_done_cb_t end,
void *priv, struct ubus_context *ctx, void *priv, struct ubus_context *ctx,
struct ubus_request_data *req); struct ubus_request_data *req);
int *exec_timeout;
}; };
struct rpc_plugin { struct rpc_plugin {

View file

@ -404,6 +404,7 @@ static const struct rpc_daemon_ops ops = {
.session_create_cb = rpc_session_create_cb, .session_create_cb = rpc_session_create_cb,
.session_destroy_cb = rpc_session_destroy_cb, .session_destroy_cb = rpc_session_destroy_cb,
.exec = rpc_exec, .exec = rpc_exec,
.exec_timeout = &rpc_exec_timeout,
}; };
static int static int