From d4e45d47a737b3af775c62a8ed50c5e646829284 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 9 Jan 2012 15:02:20 -0500 Subject: - most of what's needed to hook back-end txn postoperations, except for the passing the TXN ID around, which means we deadlock if we actually do it --- src/back-shr.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/back-shr.c') diff --git a/src/back-shr.c b/src/back-shr.c index c9f46a6..5697a9e 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -1952,3 +1952,37 @@ backend_shr_internal_postop_init(Slapi_PBlock *pb, struct plugin_state *state) } return 0; } + +#ifdef USE_SLAPI_BE_TXNS +int +backend_shr_be_txn_postop_init(Slapi_PBlock *pb, struct plugin_state *state) +{ +#if 0 + if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_ADD_FN, + backend_shr_add_cb) != 0) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "error hooking up be-txn-post add callback\n"); + return -1; + } + if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODIFY_FN, + backend_shr_modify_cb) != 0) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "error hooking up be-txn-post modify callback\n"); + return -1; + } + if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_MODRDN_FN, + backend_shr_modrdn_cb) != 0) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "error hooking up be-txn-post modrdn callback\n"); + return -1; + } + if (slapi_pblock_set(pb, SLAPI_PLUGIN_BE_TXN_POST_DELETE_FN, + backend_shr_delete_cb) != 0) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "error hooking up be-txn-post delete callback\n"); + return -1; + } +#endif + return 0; +} +#endif -- cgit