From 124083f5801312aeef6f97402dba181d98eb708c Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 15 Dec 2008 10:12:43 -0500 Subject: Disconnected client SBUS connections would delete the master set of sbus_method_ctx entries, meaning that the next connection to attempt to disconnect would receive a segmentation fault also trying to delete them. They are now talloc_reference()-ed to their connection context and talloc_unlink()-ed upon deletion. I have also modified the sbus_new_server() call to take a reference to an sbus_srv_ctx object as a return argument, so that the calling function can keep track of the SBUS server context if it so chooses. --- server/providers/data_provider.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/providers/data_provider.c') diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 3bd0ef59d..150c6f6ae 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -49,6 +49,7 @@ struct dp_ctx { struct confdb_ctx *cdb; struct ldb_context *ldb; struct service_sbus_ctx *ss_ctx; + struct sbus_srv_ctx *sbus_srv; struct dp_backend *be_list; struct dp_frontend *fe_list; }; @@ -406,6 +407,7 @@ static int dp_frontend_destructor(void *ctx) static int dp_srv_init(struct dp_ctx *dpctx) { TALLOC_CTX *tmp_ctx; + struct sbus_srv_ctx *sbus_srv; struct sbus_method_ctx *sd_ctx; char *dpbus_address; char *default_dp_address; @@ -449,11 +451,13 @@ static int dp_srv_init(struct dp_ctx *dpctx) sd_ctx->methods = dp_sbus_methods; sd_ctx->message_handler = sbus_message_handler; - ret = sbus_new_server(dpctx->ev, sd_ctx, dpbus_address, + ret = sbus_new_server(dpctx->ev, sd_ctx, + &sbus_srv, dpbus_address, dbus_dp_init, dpctx); if (ret != EOK) { goto done; } + dpctx->sbus_srv = sbus_srv; talloc_steal(dpctx, sd_ctx); done: -- cgit