winbindd: switch send-next/done order
authorRalph Boehme <slow@samba.org>
Thu, 21 Feb 2019 15:52:21 +0000 (16:52 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 5 Mar 2019 19:29:13 +0000 (19:29 +0000)
In preparation of adding more logic to the done step. No change in
behaviour.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13802

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 8e9c2a1f6ceb06d695a6572701b96a3e3821ac42)

source3/winbindd/wb_xids2sids.c

index afdacb56ae61198baba78c36c85a28831d33f462..c4ee0920d467230235861b6f6e0256e8394245b4 100644 (file)
@@ -549,18 +549,22 @@ static void wb_xids2sids_done(struct tevent_req *subreq)
 
        state->dom_idx += 1;
 
-       if (state->dom_idx >= num_domains) {
-               tevent_req_done(req);
+       if (state->dom_idx < num_domains) {
+               subreq = wb_xids2sids_dom_send(state,
+                                              state->ev,
+                                              &dom_maps[state->dom_idx],
+                                              state->xids,
+                                              state->num_xids,
+                                              state->sids);
+               if (tevent_req_nomem(subreq, req)) {
+                       return;
+               }
+               tevent_req_set_callback(subreq, wb_xids2sids_done, req);
                return;
        }
 
-       subreq = wb_xids2sids_dom_send(
-               state, state->ev, &dom_maps[state->dom_idx],
-               state->xids, state->num_xids, state->sids);
-       if (tevent_req_nomem(subreq, req)) {
-               return;
-       }
-       tevent_req_set_callback(subreq, wb_xids2sids_done, req);
+       tevent_req_done(req);
+       return;
 }
 
 NTSTATUS wb_xids2sids_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,