summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-20 10:38:36 +0000
committerVolker Lendecke <vl@samba.org>2014-06-21 20:38:11 +0200
commit01c197dc159297d9abdc62f0d2f69d4724b9fc5c (patch)
treee73dec9129f28e9bf0edff71a14b9d88bdd10151 /source3/libsmb
parentbb6b31dd866b0a06e2026f072db8c61a8a986ab6 (diff)
downloadsamba-01c197dc159297d9abdc62f0d2f69d4724b9fc5c.tar.gz
libsmb: Make cli_ntcreate cancellable
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 2ee6eda956f..61cb8b59893 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1937,9 +1937,11 @@ struct cli_ntcreate_state {
struct smb_create_returns *cr);
struct smb_create_returns cr;
uint16_t fnum;
+ struct tevent_req *subreq;
};
static void cli_ntcreate_done(struct tevent_req *subreq);
+static bool cli_ntcreate_cancel(struct tevent_req *req);
struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -1983,6 +1985,10 @@ struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
tevent_req_set_callback(subreq, cli_ntcreate_done, req);
+
+ state->subreq = subreq;
+ tevent_req_set_cancel_fn(req, cli_ntcreate_cancel);
+
return req;
}
@@ -2002,6 +2008,13 @@ static void cli_ntcreate_done(struct tevent_req *subreq)
tevent_req_done(req);
}
+static bool cli_ntcreate_cancel(struct tevent_req *req)
+{
+ struct cli_ntcreate_state *state = tevent_req_data(
+ req, struct cli_ntcreate_state);
+ return tevent_req_cancel(state->subreq);
+}
+
NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *fnum,
struct smb_create_returns *cr)
{