diff options
author | Volker Lendecke <vl@samba.org> | 2009-07-31 16:16:24 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-07-31 17:28:53 +0200 |
commit | f511ccbc429aacff3882e12366bae2aebf9d768a (patch) | |
tree | cb3af35ac3cecb8668330c1577673739e37b259b /source3/winbindd/winbindd.c | |
parent | a3bcbd177537e5da437974e64bbd07d88c087fa2 (diff) | |
download | samba-f511ccbc429aacff3882e12366bae2aebf9d768a.tar.gz samba-f511ccbc429aacff3882e12366bae2aebf9d768a.tar.xz samba-f511ccbc429aacff3882e12366bae2aebf9d768a.zip |
Slightly restructure the async winbind request calling convention
The main loop now allocates the response, this has to be done everywhere
Diffstat (limited to 'source3/winbindd/winbindd.c')
-rw-r--r-- | source3/winbindd/winbindd.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 6863e93415f..4b6ebd2c42e 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -519,8 +519,8 @@ struct winbindd_async_dispatch_table { struct tevent_req *(*send_req)(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct winbindd_request *request); - NTSTATUS (*recv_req)(struct tevent_req *req, TALLOC_CTX *mem_ctx, - struct winbindd_response **presp); + NTSTATUS (*recv_req)(struct tevent_req *req, + struct winbindd_response *presp); }; static struct winbindd_async_dispatch_table async_nonpriv_table[] = { @@ -602,17 +602,22 @@ static void wb_request_done(struct tevent_req *req) struct winbindd_cli_state *state = tevent_req_callback_data( req, struct winbindd_cli_state); NTSTATUS status; - struct winbindd_response *response; - status = state->recv_fn(req, state->mem_ctx, &response); + state->response = talloc_zero(state, struct winbindd_response); + if (state->response == NULL) { + remove_client(state); + return; + } + state->response->result = WINBINDD_PENDING; + state->response->length = sizeof(struct winbindd_response); + + status = state->recv_fn(req, state->response); TALLOC_FREE(req); if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("returning %s\n", nt_errstr(status))); request_error(state); + return; } - state->response = response; - state->response->result = WINBINDD_PENDING; - state->response->length = sizeof(struct winbindd_response); request_ok(state); } |