mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
rpc_client: Adapt rpc_api_pipe_req_send() to talloc_req conventions
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
106c04689e
commit
2a4e785040
@ -1327,18 +1327,18 @@ static struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
|
|||||||
if (cli->max_xmit_frag < DCERPC_REQUEST_LENGTH
|
if (cli->max_xmit_frag < DCERPC_REQUEST_LENGTH
|
||||||
+ RPC_MAX_SIGN_SIZE) {
|
+ RPC_MAX_SIGN_SIZE) {
|
||||||
/* Server is screwed up ! */
|
/* Server is screwed up ! */
|
||||||
status = NT_STATUS_INVALID_PARAMETER;
|
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
|
||||||
goto post_status;
|
return tevent_req_post(req, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = prepare_verification_trailer(state);
|
status = prepare_verification_trailer(state);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (tevent_req_nterror(req, status)) {
|
||||||
goto post_status;
|
return tevent_req_post(req, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = prepare_next_frag(state, &is_last_frag);
|
status = prepare_next_frag(state, &is_last_frag);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (tevent_req_nterror(req, status)) {
|
||||||
goto post_status;
|
return tevent_req_post(req, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_last_frag) {
|
if (is_last_frag) {
|
||||||
@ -1346,28 +1346,21 @@ static struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
|
|||||||
&state->rpc_out,
|
&state->rpc_out,
|
||||||
DCERPC_PKT_RESPONSE,
|
DCERPC_PKT_RESPONSE,
|
||||||
state->call_id);
|
state->call_id);
|
||||||
if (subreq == NULL) {
|
if (tevent_req_nomem(subreq, req)) {
|
||||||
goto fail;
|
return tevent_req_post(req, ev);
|
||||||
}
|
}
|
||||||
tevent_req_set_callback(subreq, rpc_api_pipe_req_done, req);
|
tevent_req_set_callback(subreq, rpc_api_pipe_req_done, req);
|
||||||
} else {
|
} else {
|
||||||
subreq = rpc_write_send(state, ev, cli->transport,
|
subreq = rpc_write_send(state, ev, cli->transport,
|
||||||
state->rpc_out.data,
|
state->rpc_out.data,
|
||||||
state->rpc_out.length);
|
state->rpc_out.length);
|
||||||
if (subreq == NULL) {
|
if (tevent_req_nomem(subreq, req)) {
|
||||||
goto fail;
|
return tevent_req_post(req, ev);
|
||||||
}
|
}
|
||||||
tevent_req_set_callback(subreq, rpc_api_pipe_req_write_done,
|
tevent_req_set_callback(subreq, rpc_api_pipe_req_write_done,
|
||||||
req);
|
req);
|
||||||
}
|
}
|
||||||
return req;
|
return req;
|
||||||
|
|
||||||
post_status:
|
|
||||||
tevent_req_nterror(req, status);
|
|
||||||
return tevent_req_post(req, ev);
|
|
||||||
fail:
|
|
||||||
TALLOC_FREE(req);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS prepare_verification_trailer(struct rpc_api_pipe_req_state *state)
|
static NTSTATUS prepare_verification_trailer(struct rpc_api_pipe_req_state *state)
|
||||||
|
Loading…
Reference in New Issue
Block a user