From 990b7ebaf67b6d4cc982c805a8ec1126111bd4b4 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Fri, 20 Jan 2012 13:53:16 +0100 Subject: DP: Refactor responder_dp_req so it's reusable by other responders * the internal request is now more generic and is decoupled from account-specific data. There is a new sss_dp_issue_request() wrapper that issues a BE request or registers a callback * the public requests all use struct sss_dp_req_state as the tevent_req state data. This allows to report back data from the internal request even if the caller is just a callback notifier * each specific request now uses an _info structure that contains all the data necessary to construct a DBusMessage passed to provider * each specific request now defines a sss_dp_get_$data_msg callback that is called from the sss_dp_issue_request() common wraper. The purpose of the wrapper is to construct a DBusMessage and bind it to a DBus method so the message can be just sent over to back end The miscellanous changes include: * change SSS_DP_ constants to an enum. This way, a switch() would error if a value is not handled. * rename sss_dp_get_account_int_send() to sss_dp_internal_get_send() request because the internal request is going to handle more than just account data * the DBus return values were renamed from err_maj, err_min to dp_err and dp_ret respectively --- src/responder/nss/nsssrv_services.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/responder/nss/nsssrv_services.c') diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c index 6e857ff1..cd0ec583 100644 --- a/src/responder/nss/nsssrv_services.c +++ b/src/responder/nss/nsssrv_services.c @@ -468,7 +468,8 @@ static void lookup_service_done(struct tevent_req *subreq) ("Unable to get information from Data Provider\n" "dp_error: [%u], errno: [%u], error_msg: [%s]\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, + err_msg ? err_msg : "none")); } /* Recheck the cache after the lookup. -- cgit