mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
libsmb: Make cli_smb2_create_fnum cancellable
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
@ -157,9 +157,11 @@ struct cli_smb2_create_fnum_state {
|
||||
struct cli_state *cli;
|
||||
struct smb_create_returns cr;
|
||||
uint16_t fnum;
|
||||
struct tevent_req *subreq;
|
||||
};
|
||||
|
||||
static void cli_smb2_create_fnum_done(struct tevent_req *subreq);
|
||||
static bool cli_smb2_create_fnum_cancel(struct tevent_req *req);
|
||||
|
||||
struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
@ -215,6 +217,10 @@ struct tevent_req *cli_smb2_create_fnum_send(TALLOC_CTX *mem_ctx,
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
tevent_req_set_callback(subreq, cli_smb2_create_fnum_done, req);
|
||||
|
||||
state->subreq = subreq;
|
||||
tevent_req_set_cancel_fn(req, cli_smb2_create_fnum_cancel);
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
@ -241,6 +247,13 @@ static void cli_smb2_create_fnum_done(struct tevent_req *subreq)
|
||||
tevent_req_done(req);
|
||||
}
|
||||
|
||||
static bool cli_smb2_create_fnum_cancel(struct tevent_req *req)
|
||||
{
|
||||
struct cli_smb2_create_fnum_state *state = tevent_req_data(
|
||||
req, struct cli_smb2_create_fnum_state);
|
||||
return tevent_req_cancel(state->subreq);
|
||||
}
|
||||
|
||||
NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, uint16_t *pfnum,
|
||||
struct smb_create_returns *cr)
|
||||
{
|
||||
|
Reference in New Issue
Block a user