winbindd: switch send-next/done order
authorRalph Boehme <slow@samba.org>
Thu, 21 Feb 2019 15:52:21 +0000 (16:52 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 23 Feb 2019 06:54:09 +0000 (07:54 +0100)
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>
source3/winbindd/wb_xids2sids.c

index c088560adecfce2312ef6c08f3cb84e0fa9e8ebd..331a04c4fb0d0e85320b91e0e4195f539eb8581e 100644 (file)
@@ -554,18 +554,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,