On Wed, Dec 09, 2015 at 01:10:58PM +0100, Lukas Slebodnik wrote:
On (04/12/15 16:42), Jakub Hrozek wrote:
>On Thu, Dec 03, 2015 at 01:24:54PM +0100, Pavel Březina wrote:
>> On 11/20/2015 12:04 PM, Jakub Hrozek wrote:
>> >On Thu, Nov 19, 2015 at 01:51:54PM +0100, Pavel Březina wrote:
>> >>>Thanks, new patches are attached.
>> >>
>> >>I had a phone call with Jakub and we decided that it will be better to
use
>> >>be_req directly instead of lower level sbus_req. This will allow us to
>> >>simplify it more.
>> >
>> >OK, see the attached patches..
>>
>> Hi, thanks for the changes.
>>
>> First patch:
[...]
>@@ -199,6 +205,11 @@ struct be_req *be_req_create(TALLOC_CTX
*mem_ctx,
> be_req->domain = be_ctx->domain;
> be_req->fn = fn;
> be_req->pvt = pvt_fn_data;
>+ be_req->req_name = talloc_strdup(be_req, name);
>+ if (be_req->req_name == NULL) {
>+ talloc_free(be_req);
>+ return NULL;
>+ }
>
> /* Add this request to active request list and make sure it is
> * removed on termination. */
>@@ -242,6 +253,95 @@ void be_req_terminate(struct be_req *be_req,
> be_req->fn(be_req, dp_err_type, errnum, errstr);
> }
>
>+
I know it's a nitpick, but you added extra new line here :-)
and you should change 2nd patch anyway.
I removed the extra line.
>From d7b00e1ef4984bb17d4ce62b2c206efebb6aea37 Mon Sep 17 00:00:00
2001
>From: Jakub Hrozek <jhrozek(a)redhat.com>
>Date: Wed, 11 Nov 2015 13:40:16 +0100
>Subject: [PATCH 2/2] DP: Reduce code duplication in Data Provider handlers
>
>Instead of setting the three same variables over again, add a structure
>be_sbus_reply_data with a default initializer BE_SBUS_REPLY_DATA_INIT.
>
>The handlers can then set the structure to BE_SBUS_REPLY_DATA_INIT on
>declaration or set a particular value with be_sbus_reply_data_set.
>
>The handler can also reply to the message (typically on failure state)
>with be_sbus_req_reply_data()
[...]
>@@ -791,9 +821,8 @@ static int be_get_subdomains(struct
sbus_request *dbus_req, void *user_data)
> */
> if (becli->bectx->offstat.offline) {
> DEBUG(SSSDBG_TRACE_FUNC, "Cannot proceed, provider is
offline.\n");
I wanted to push patches but I moticed that DEBUG message was removed
in previous case "Undefined backend target", but was not removed here.
If we want to remove them, please remove them on all places.
If we do not want to touch them, do not remove it in previous case.
I left the original DEBUG message. I think all the unspecified target
messages could use some love at least to standardize on the same levels,
but we have a dedicated ticket for that..