TODO cli_openx_cancel
authorStefan Metzmacher <metze@samba.org>
Thu, 17 Nov 2011 16:56:52 +0000 (17:56 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 16 Jan 2018 06:45:26 +0000 (07:45 +0100)
source3/libsmb/clifile.c

index 5f6e98ce460b64a0ae6d4102d063402a1b6dbde6..719908e1dd3677c035155d2e552e3c845a7f3de8 100644 (file)
@@ -2440,8 +2440,18 @@ struct cli_openx_state {
        uint16_t vwv[15];
        uint16_t fnum;
        struct iovec bytes;
+       struct tevent_req *subreq;
 };
 
+static bool cli_openx_cancel(struct tevent_req *req)
+{
+       struct cli_openx_state *state =
+               tevent_req_data(req,
+               struct cli_openx_state);
+
+       return tevent_req_cancel(state->subreq);
+}
+
 static void cli_openx_done(struct tevent_req *subreq);
 
 struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
@@ -2537,6 +2547,10 @@ struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
                return NULL;
        }
        tevent_req_set_callback(subreq, cli_openx_done, req);
+
+       state->subreq = subreq;
+       tevent_req_set_cancel_fn(req, cli_openx_cancel);
+
        *psmbreq = subreq;
        return req;
 }