summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-06-20 10:37:14 +0000
committerVolker Lendecke <vl@samba.org>2014-06-21 20:38:11 +0200
commit0a2209c1611f318b546ff08348c6579991579cb9 (patch)
treef115c4258bb075fd700e94ea6b00422b54df28e9 /libcli/smb
parent5aeebc3eb04245a059a3cffde649b0437aa1e332 (diff)
downloadsamba-0a2209c1611f318b546ff08348c6579991579cb9.tar.gz
libsmb: Make smb2cli_create cancellable
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smb2cli_create.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libcli/smb/smb2cli_create.c b/libcli/smb/smb2cli_create.c
index 834a88146ce..bcd674e26a8 100644
--- a/libcli/smb/smb2cli_create.c
+++ b/libcli/smb/smb2cli_create.c
@@ -31,9 +31,11 @@ struct smb2cli_create_state {
uint64_t fid_volatile;
struct smb_create_returns cr;
struct smb2_create_blobs blobs;
+ struct tevent_req *subreq;
};
static void smb2cli_create_done(struct tevent_req *subreq);
+static bool smb2cli_create_cancel(struct tevent_req *req);
struct tevent_req *smb2cli_create_send(
TALLOC_CTX *mem_ctx,
@@ -159,9 +161,20 @@ struct tevent_req *smb2cli_create_send(
return tevent_req_post(req, ev);
}
tevent_req_set_callback(subreq, smb2cli_create_done, req);
+
+ state->subreq = subreq;
+ tevent_req_set_cancel_fn(req, smb2cli_create_cancel);
+
return req;
}
+static bool smb2cli_create_cancel(struct tevent_req *req)
+{
+ struct smb2cli_create_state *state = tevent_req_data(req,
+ struct smb2cli_create_state);
+ return tevent_req_cancel(state->subreq);
+}
+
static void smb2cli_create_done(struct tevent_req *subreq)
{
struct tevent_req *req =