diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-07-31 09:52:14 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-08-10 09:42:18 -0400 |
commit | 2b0f40eaba44742fa38bb5b67ada510e7b2b6324 (patch) | |
tree | 10317ab1e5428020e0363c45a3e943141a14e519 | |
parent | 508b5b2a360c9530c6ea67a7b7ed6d61559846e4 (diff) | |
download | sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.gz sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.tar.bz2 sssd-2b0f40eaba44742fa38bb5b67ada510e7b2b6324.zip |
Remove redundant memory contexts
Simplify code by removing stuff that is never used or redundant.
-rw-r--r-- | server/monitor/monitor_sbus.c | 28 | ||||
-rw-r--r-- | server/providers/data_provider.c | 23 | ||||
-rw-r--r-- | server/providers/data_provider_be.c | 48 | ||||
-rw-r--r-- | server/providers/dp_backend.h | 8 | ||||
-rw-r--r-- | server/responder/common/responder.h | 5 | ||||
-rw-r--r-- | server/responder/common/responder_common.c | 25 | ||||
-rw-r--r-- | server/responder/common/responder_dp.c | 20 | ||||
-rw-r--r-- | server/responder/nss/nsssrv.c | 6 | ||||
-rw-r--r-- | server/responder/pam/pamsrv.c | 6 | ||||
-rw-r--r-- | server/responder/pam/pamsrv_dp.c | 4 | ||||
-rw-r--r-- | server/sbus/sbus_client.c | 51 | ||||
-rw-r--r-- | server/sbus/sbus_client.h | 12 | ||||
-rw-r--r-- | server/sbus/sssd_dbus.h | 3 | ||||
-rw-r--r-- | server/sbus/sssd_dbus_connection.c | 9 |
14 files changed, 114 insertions, 134 deletions
diff --git a/server/monitor/monitor_sbus.c b/server/monitor/monitor_sbus.c index 7a9c8b09..5d49f003 100644 --- a/server/monitor/monitor_sbus.c +++ b/server/monitor/monitor_sbus.c @@ -54,44 +54,38 @@ done: return ret; } -int monitor_init_sbus_methods(TALLOC_CTX *mem_ctx, struct sbus_method *methods, +int monitor_init_sbus_methods(TALLOC_CTX *mem_ctx, + struct sbus_method *methods, struct sbus_method_ctx **sm_ctx) { - int ret; - TALLOC_CTX *tmp_ctx; struct sbus_method_ctx *method_ctx; + int ret; - tmp_ctx = talloc_new(mem_ctx); - if (tmp_ctx == NULL) { - return ENOMEM; - } - - method_ctx = talloc_zero(tmp_ctx, struct sbus_method_ctx); - if (method_ctx == NULL) { + method_ctx = talloc_zero(mem_ctx, struct sbus_method_ctx); + if (!method_ctx) { ret = ENOMEM; - goto done; + goto fail; } method_ctx->interface = talloc_strdup(method_ctx, SERVICE_INTERFACE); if (method_ctx->interface == NULL) { ret = ENOMEM; - goto done; + goto fail; } method_ctx->path = talloc_strdup(method_ctx, SERVICE_PATH); if (method_ctx->path == NULL) { ret = ENOMEM; - goto done; + goto fail; } method_ctx->methods = methods; method_ctx->message_handler = sbus_message_handler; *sm_ctx = method_ctx; - talloc_steal(mem_ctx, method_ctx); - ret = EOK; + return EOK; -done: - talloc_free(tmp_ctx); +fail: + talloc_free(method_ctx); return ret; } diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 4dc9dfaa..6a19247f 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -55,7 +55,6 @@ struct dp_frontend; struct dp_ctx { struct tevent_context *ev; struct confdb_ctx *cdb; - struct service_sbus_ctx *ss_ctx; struct sbus_srv_ctx *sbus_srv; struct dp_backend *be_list; struct dp_frontend *fe_list; @@ -195,10 +194,10 @@ static int service_res_init(DBusMessage *message, struct sbus_conn_ctx *sconn) static int dp_monitor_init(struct dp_ctx *dpctx) { - int ret; - char *sbus_address; - struct service_sbus_ctx *ss_ctx; + struct sbus_conn_ctx *conn_ctx; struct sbus_method_ctx *sm_ctx; + char *sbus_address; + int ret; /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(dpctx, dpctx->cdb, &sbus_address); @@ -213,11 +212,15 @@ static int dp_monitor_init(struct dp_ctx *dpctx) return ret; } - ret = sbus_client_init(dpctx, dpctx->ev, - sbus_address, sm_ctx, - NULL /* Private Data */, - NULL /* Destructor */, - &ss_ctx); + /* FIXME: remove this */ + if (talloc_reference(dpctx, sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return ENOMEM; + } + + ret = sbus_client_init(dpctx, dpctx->ev, sm_ctx, + sbus_address, &conn_ctx, + NULL, NULL); if (ret != EOK) { DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; @@ -226,8 +229,6 @@ static int dp_monitor_init(struct dp_ctx *dpctx) /* Set up DP-specific listeners */ /* None currently used */ - dpctx->ss_ctx = ss_ctx; - return EOK; } diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index 2e0c1cf2..d5cd6dd0 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -274,7 +274,7 @@ static void online_chk_callback(struct be_req *req, int status, return; } - conn = sbus_get_connection(req->be_ctx->dp_ctx->scon_ctx); + conn = sbus_get_connection(req->be_ctx->dp_conn_ctx); dbus_connection_send(conn, reply, NULL); dbus_message_unref(reply); @@ -393,7 +393,7 @@ static void acctinfo_callback(struct be_req *req, int status, return; } - conn = sbus_get_connection(req->be_ctx->dp_ctx->scon_ctx); + conn = sbus_get_connection(req->be_ctx->dp_conn_ctx); dbus_connection_send(conn, reply, NULL); dbus_message_unref(reply); @@ -559,7 +559,7 @@ static void be_pam_handler_callback(struct be_req *req, int status, return; } - conn = sbus_get_connection(req->be_ctx->dp_ctx->scon_ctx); + conn = sbus_get_connection(req->be_ctx->dp_conn_ctx); dbus_connection_send(conn, reply, NULL); dbus_message_unref(reply); @@ -671,9 +671,8 @@ done: * sbus channel to the monitor daemon */ static int mon_cli_init(struct be_ctx *ctx) { - int ret; char *sbus_address; - struct sbus_method_ctx *sm_ctx; + int ret; /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(ctx, ctx->cdb, &sbus_address); @@ -682,17 +681,21 @@ static int mon_cli_init(struct be_ctx *ctx) return ret; } - ret = monitor_init_sbus_methods(ctx, mon_sbus_methods, &sm_ctx); + ret = monitor_init_sbus_methods(ctx, mon_sbus_methods, &ctx->mon_sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not initialize SBUS methods.\n")); return ret; } - ret = sbus_client_init(ctx, ctx->ev, - sbus_address, sm_ctx, - ctx /* Private Data */, - NULL /* Destructor */, - &ctx->ss_ctx); + /* FIXME: remove this */ + if (talloc_reference(ctx, ctx->mon_sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return ENOMEM; + } + + ret = sbus_client_init(ctx, ctx->ev, ctx->mon_sm_ctx, + sbus_address, &ctx->mon_conn_ctx, + NULL, ctx); if (ret != EOK) { DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; @@ -709,7 +712,6 @@ static int be_cli_init(struct be_ctx *ctx) { int ret, max_retries; char *sbus_address; - struct sbus_method_ctx *sm_ctx; /* Set up SBUS connection to the monitor */ ret = dp_get_sbus_address(ctx, ctx->cdb, &sbus_address); @@ -718,17 +720,21 @@ static int be_cli_init(struct be_ctx *ctx) return ret; } - ret = dp_init_sbus_methods(ctx, be_methods, &sm_ctx); + ret = dp_init_sbus_methods(ctx, be_methods, &ctx->dp_sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not initialize SBUS methods.\n")); return ret; } - ret = sbus_client_init(ctx, ctx->ev, - sbus_address, sm_ctx, - ctx /* Private Data */, - NULL /* Destructor */, - &ctx->dp_ctx); + /* FIXME: remove this */ + if (talloc_reference(ctx, ctx->dp_sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return ENOMEM; + } + + ret = sbus_client_init(ctx, ctx->ev, ctx->dp_sm_ctx, + sbus_address, &ctx->dp_conn_ctx, + NULL, ctx); if (ret != EOK) { DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; @@ -742,7 +748,7 @@ static int be_cli_init(struct be_ctx *ctx) return ret; } - sbus_reconnect_init(ctx->dp_ctx->scon_ctx, max_retries, + sbus_reconnect_init(ctx->dp_conn_ctx, max_retries, be_cli_reconnect_init, ctx); return EOK; @@ -759,8 +765,8 @@ static void be_cli_reconnect_init(struct sbus_conn_ctx *sconn, int status, void /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { /* Add the methods back to the new connection */ - ret = sbus_conn_add_method_ctx(be_ctx->dp_ctx->scon_ctx, - be_ctx->dp_ctx->sm_ctx); + ret = sbus_conn_add_method_ctx(be_ctx->dp_conn_ctx, + be_ctx->dp_sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not re-add methods on reconnection.\n")); ret = be_finalize(be_ctx); diff --git a/server/providers/dp_backend.h b/server/providers/dp_backend.h index 66bc8718..759dd996 100644 --- a/server/providers/dp_backend.h +++ b/server/providers/dp_backend.h @@ -65,13 +65,17 @@ struct be_ctx { struct tevent_context *ev; struct confdb_ctx *cdb; struct sysdb_ctx *sysdb; - struct service_sbus_ctx *ss_ctx; - struct service_sbus_ctx *dp_ctx; struct sss_domain_info *domain; const char *name; const char *identity; const char *conf_path; + struct sbus_method_ctx *mon_sm_ctx; + struct sbus_conn_ctx *mon_conn_ctx; + + struct sbus_method_ctx *dp_sm_ctx; + struct sbus_conn_ctx *dp_conn_ctx; + struct loaded_be loaded_be[BET_MAX]; struct bet_info bet_info[BET_MAX]; }; diff --git a/server/responder/common/responder.h b/server/responder/common/responder.h index d901704a..408ee4da 100644 --- a/server/responder/common/responder.h +++ b/server/responder/common/responder.h @@ -63,8 +63,9 @@ struct resp_ctx { struct confdb_ctx *cdb; const char *sock_name; const char *priv_sock_name; - struct service_sbus_ctx *ss_ctx; - struct service_sbus_ctx *dp_ctx; + + struct sbus_conn_ctx *conn_ctx; + struct sbus_method_ctx *sm_ctx; struct sss_domain_info *domains; diff --git a/server/responder/common/responder_common.c b/server/responder/common/responder_common.c index 825d77e7..f8744b67 100644 --- a/server/responder/common/responder_common.c +++ b/server/responder/common/responder_common.c @@ -287,10 +287,8 @@ static void accept_fd_handler(struct tevent_context *ev, static int sss_sbus_init(struct resp_ctx *rctx) { - int ret; char *sbus_address; - struct service_sbus_ctx *ss_ctx; - struct sbus_method_ctx *sm_ctx; + int ret; /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(rctx, rctx->cdb, &sbus_address); @@ -299,17 +297,22 @@ static int sss_sbus_init(struct resp_ctx *rctx) return ret; } - ret = monitor_init_sbus_methods(rctx, rctx->sss_sbus_methods, &sm_ctx); + ret = monitor_init_sbus_methods(rctx, rctx->sss_sbus_methods, + &rctx->sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not initialize SBUS methods.\n")); return ret; } - ret = sbus_client_init(rctx, rctx->ev, - sbus_address, sm_ctx, - NULL /* Private Data */, - NULL /* Destructor */, - &ss_ctx); + /* FIXME: remove this */ + if (talloc_reference(rctx, rctx->sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return ENOMEM; + } + + ret = sbus_client_init(rctx, rctx->ev, rctx->sm_ctx, + sbus_address, &rctx->conn_ctx, + NULL, NULL); if (ret != EOK) { DEBUG(0, ("Failed to connect to monitor services.\n")); return ret; @@ -318,8 +321,6 @@ static int sss_sbus_init(struct resp_ctx *rctx) /* Set up NSS-specific listeners */ /* None currently used */ - rctx->ss_ctx = ss_ctx; - return EOK; } @@ -496,7 +497,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx, DEBUG(0, ("fatal error setting up backend connector\n")); return ret; } - else if (!rctx->dp_ctx) { + else if (!rctx->conn_ctx) { DEBUG(0, ("Data Provider is not yet available. Retrying.\n")); return EIO; } diff --git a/server/responder/common/responder_dp.c b/server/responder/common/responder_dp.c index bfc533b9..9083a173 100644 --- a/server/responder/common/responder_dp.c +++ b/server/responder/common/responder_dp.c @@ -25,7 +25,6 @@ static void sss_dp_conn_reconnect(struct sss_dp_pvt_ctx *pvt) struct resp_ctx *rctx; struct tevent_timer *te; struct timeval tv; - struct sbus_method_ctx *sm_ctx; char *sbus_address; time_t now; int ret; @@ -50,16 +49,21 @@ static void sss_dp_conn_reconnect(struct sss_dp_pvt_ctx *pvt) return; } - ret = dp_init_sbus_methods(rctx, pvt->methods, &sm_ctx); + ret = dp_init_sbus_methods(rctx, pvt->methods, &rctx->sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not initialize SBUS methods.\n")); return; } - ret = sbus_client_init(rctx, rctx->ev, - sbus_address, sm_ctx, - pvt, sss_dp_conn_destructor, - &rctx->dp_ctx); + /* FIXME: remove this */ + if (talloc_reference(rctx, rctx->sm_ctx) == NULL) { + DEBUG(0, ("Failed to take memory reference\n")); + return; + } + + ret = sbus_client_init(rctx, rctx->ev, rctx->sm_ctx, + sbus_address, &rctx->conn_ctx, + sss_dp_conn_destructor, pvt); if (ret != EOK) { DEBUG(4, ("Failed to reconnect [%d(%s)]!\n", ret, strerror(ret))); @@ -239,12 +243,12 @@ int nss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *memctx, * in some pathological cases it may happen that nss starts up before * dp connection code is actually able to establish a connection. */ - if (!rctx->dp_ctx) { + if (!rctx->conn_ctx) { DEBUG(1, ("The Data Provider connection is not available yet!" " This maybe a bug, it shouldn't happen!\n")); return EIO; } - conn = sbus_get_connection(rctx->dp_ctx->scon_ctx); + conn = sbus_get_connection(rctx->conn_ctx); /* create the message */ msg = dbus_message_new_method_call(NULL, diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c index 9a3d3c45..419ed1de 100644 --- a/server/responder/nss/nsssrv.c +++ b/server/responder/nss/nsssrv.c @@ -258,8 +258,8 @@ static void nss_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { /* Add the methods back to the new connection */ - ret = sbus_conn_add_method_ctx(rctx->dp_ctx->scon_ctx, - rctx->dp_ctx->sm_ctx); + ret = sbus_conn_add_method_ctx(rctx->conn_ctx, + rctx->sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not re-add methods on reconnection.\n")); nss_shutdown(rctx); @@ -327,7 +327,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, return ret; } - sbus_reconnect_init(nctx->rctx->dp_ctx->scon_ctx, + sbus_reconnect_init(nctx->rctx->conn_ctx, max_retries, nss_dp_reconnect_init, nctx->rctx); diff --git a/server/responder/pam/pamsrv.c b/server/responder/pam/pamsrv.c index ef01e972..05e3a12d 100644 --- a/server/responder/pam/pamsrv.c +++ b/server/responder/pam/pamsrv.c @@ -148,8 +148,8 @@ static void pam_dp_reconnect_init(struct sbus_conn_ctx *sconn, int status, void /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { /* Add the methods back to the new connection */ - ret = sbus_conn_add_method_ctx(rctx->dp_ctx->scon_ctx, - rctx->dp_ctx->sm_ctx); + ret = sbus_conn_add_method_ctx(rctx->conn_ctx, + rctx->sm_ctx); if (ret != EOK) { DEBUG(0, ("Could not re-add methods on reconnection.\n")); pam_shutdown(rctx); @@ -190,7 +190,7 @@ static int pam_process_init(struct main_context *main_ctx, return ret; } - sbus_reconnect_init(rctx->dp_ctx->scon_ctx, max_retries, + sbus_reconnect_init(rctx->conn_ctx, max_retries, pam_dp_reconnect_init, rctx); return EOK; diff --git a/server/responder/pam/pamsrv_dp.c b/server/responder/pam/pamsrv_dp.c index 1de43478..9703fdbb 100644 --- a/server/responder/pam/pamsrv_dp.c +++ b/server/responder/pam/pamsrv_dp.c @@ -92,12 +92,12 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) * in some pathological cases it may happen that nss starts up before * dp connection code is actually able to establish a connection. */ - if (!preq->cctx->rctx->dp_ctx) { + if (!preq->cctx->rctx->conn_ctx) { DEBUG(1, ("The Data Provider connection is not available yet!" " This maybe a bug, it shouldn't happen!\n")); return EIO; } - conn = sbus_get_connection(preq->cctx->rctx->dp_ctx->scon_ctx); + conn = sbus_get_connection(preq->cctx->rctx->conn_ctx); msg = dbus_message_new_method_call(NULL, DP_CLI_PATH, diff --git a/server/sbus/sbus_client.c b/server/sbus/sbus_client.c index 25c56d85..971aa161 100644 --- a/server/sbus/sbus_client.c +++ b/server/sbus/sbus_client.c @@ -25,55 +25,38 @@ int sbus_client_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - const char *server_address, struct sbus_method_ctx *sm_ctx, - void *conn_pvt_data, + const char *server_address, + struct sbus_conn_ctx **_conn_ctx, sbus_conn_destructor_fn destructor, - struct service_sbus_ctx **srvs_ctx) + void *conn_pvt_data) { + struct sbus_conn_ctx *conn_ctx = NULL; int ret; - TALLOC_CTX *tmp_ctx; - struct service_sbus_ctx *ss_ctx; /* Validate input */ if (server_address == NULL) { return EINVAL; } - tmp_ctx = talloc_new(mem_ctx); - if (tmp_ctx == NULL) { - return ENOMEM; - } - - ss_ctx = talloc_zero(tmp_ctx, struct service_sbus_ctx); - if (ss_ctx == NULL) { - ret = ENOMEM; - goto done; + ret = sbus_new_connection(mem_ctx, ev, server_address, &conn_ctx); + if (ret != EOK) { + goto fail; } - ss_ctx->ev = ev; - - ret = sbus_new_connection(ss_ctx, ss_ctx->ev, - server_address, &ss_ctx->scon_ctx, - destructor); - if (ret != EOK) goto done; - ret = sbus_conn_add_method_ctx(ss_ctx->scon_ctx, sm_ctx); - if (ret != EOK) goto done; - ss_ctx->sm_ctx = sm_ctx; - if (talloc_reference(ss_ctx, sm_ctx) == NULL) { - ret = ENOMEM; - goto done; + ret = sbus_conn_add_method_ctx(conn_ctx, sm_ctx); + if (ret != EOK) { + goto fail; } - if(conn_pvt_data) { - sbus_conn_set_private_data(ss_ctx->scon_ctx, conn_pvt_data); - } + /* Set connection destructor and private data */ + sbus_conn_set_destructor(conn_ctx, destructor); + sbus_conn_set_private_data(conn_ctx, conn_pvt_data); - talloc_steal(mem_ctx, ss_ctx); - *srvs_ctx = ss_ctx; - ret = EOK; + *_conn_ctx = conn_ctx; + return EOK; -done: - talloc_free(tmp_ctx); +fail: + talloc_free(conn_ctx); return ret; } diff --git a/server/sbus/sbus_client.h b/server/sbus/sbus_client.h index 12c70401..98b5309c 100644 --- a/server/sbus/sbus_client.h +++ b/server/sbus/sbus_client.h @@ -25,18 +25,12 @@ #include "tevent.h" #include "sbus/sssd_dbus.h" -struct service_sbus_ctx { - struct tevent_context *ev; - struct sbus_conn_ctx *scon_ctx; - struct sbus_method_ctx *sm_ctx; -}; - int sbus_client_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - const char *server_address, struct sbus_method_ctx *sm_ctx, - void *conn_pvt_data, + const char *server_address, + struct sbus_conn_ctx **_conn_ctx, sbus_conn_destructor_fn destructor, - struct service_sbus_ctx **srvs_ctx); + void *conn_pvt_data); #endif /* SBUS_CLIENT_H_ */ diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h index b9c7a269..ddb1cb89 100644 --- a/server/sbus/sssd_dbus.h +++ b/server/sbus/sssd_dbus.h @@ -91,8 +91,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, */ int sbus_new_connection(TALLOC_CTX *ctx, struct tevent_context *ev, const char *address, - struct sbus_conn_ctx **conn_ctx, - sbus_conn_destructor_fn destructor); + struct sbus_conn_ctx **conn_ctx); /* sbus_add_connection * Integrates a D-BUS connection with the TEvent main diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index 3ea09ca0..70ddefd9 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -244,13 +244,9 @@ static int sbus_add_connection_int(struct sbus_conn_ctx **_conn_ctx) return EOK; } -/*int sbus_new_connection(struct sbus_method_ctx *ctx, const char *address, - DBusConnection **connection, - sbus_conn_destructor_fn destructor)*/ int sbus_new_connection(TALLOC_CTX *ctx, struct tevent_context *ev, const char *address, - struct sbus_conn_ctx **conn_ctx, - sbus_conn_destructor_fn destructor) + struct sbus_conn_ctx **conn_ctx) { DBusConnection *dbus_conn; DBusError dbus_error; @@ -278,9 +274,6 @@ int sbus_new_connection(TALLOC_CTX *ctx, struct tevent_context *ev, dbus_connection_set_exit_on_disconnect((*conn_ctx)->dbus_conn, FALSE); - /* Set connection destructor */ - sbus_conn_set_destructor(*conn_ctx, destructor); - return ret; } |