diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-08-15 10:11:16 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-08-17 09:25:46 +0200 |
commit | b62ce48f007aa93b6c6a7f066f1daf06c7fd1389 (patch) | |
tree | 78f3eb3464f7be9e08073e285420d916e290993c /source3/smbd | |
parent | 47452b8cecaa9ad17d88e259a9972c5ddd007629 (diff) | |
download | samba-b62ce48f007aa93b6c6a7f066f1daf06c7fd1389.tar.gz samba-b62ce48f007aa93b6c6a7f066f1daf06c7fd1389.tar.bz2 samba-b62ce48f007aa93b6c6a7f066f1daf06c7fd1389.zip |
s3:smbd: add support for canceling SMB2 Notify calls.
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_notify.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index 4d21b27ff8..fb465abff9 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -155,6 +155,7 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq) struct smbd_smb2_notify_state { struct smbd_smb2_request *smb2req; + struct smb_request *smbreq; struct tevent_immediate *im; NTSTATUS status; DATA_BLOB out_output_buffer; @@ -166,6 +167,7 @@ static void smbd_smb2_notify_reply(struct smb_request *smbreq, static void smbd_smb2_notify_reply_trigger(struct tevent_context *ctx, struct tevent_immediate *im, void *private_data); +static bool smbd_smb2_notify_cancel(struct tevent_req *req); static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -201,6 +203,7 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + state->smbreq = smbreq; smbreq->async_priv = (void *)req; fsp = file_fsp(smbreq, (uint16_t)in_file_id_volatile); @@ -293,6 +296,9 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + /* allow this request to be canceled */ + tevent_req_set_cancel_fn(req, smbd_smb2_notify_cancel); + return req; } @@ -350,6 +356,17 @@ static void smbd_smb2_notify_reply_trigger(struct tevent_context *ctx, tevent_req_done(req); } +static bool smbd_smb2_notify_cancel(struct tevent_req *req) +{ + struct smbd_smb2_notify_state *state = tevent_req_data(req, + struct smbd_smb2_notify_state); + + smbd_notify_cancel_by_smbreq(state->smb2req->sconn, + state->smbreq); + + return true; +} + static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *out_output_buffer) |