From 75ee7925a9e289bc24f0ce8a7988cca926b71513 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Wed, 20 Jun 2012 13:41:53 -0400 Subject: Primary server support: introduce concept of reconnection This patch adds two support functions for adding reconnection callbacks and invoking such callbacks. The concept of reconnection is simple: stop using current connection for for new queries to the server without actually going offline. --- src/providers/dp_backend.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/providers/dp_backend.h') diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index 6496697d..41dd3f6d 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -107,6 +107,7 @@ struct be_ctx { struct be_cb *online_cb_list; bool run_online_cb; struct be_cb *offline_cb_list; + struct be_cb *reconnect_cb_list; struct be_offline_status offstat; @@ -186,6 +187,13 @@ struct be_host_req { bool be_is_offline(struct be_ctx *ctx); void be_mark_offline(struct be_ctx *ctx); +int be_add_reconnect_cb(TALLOC_CTX *mem_ctx, + struct be_ctx *ctx, + be_callback_t cb, + void *pvt, + struct be_cb **reconnect_cb); +void be_run_reconnect_cb(struct be_ctx *be); + int be_add_online_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t cb, -- cgit