From f362fc982320ed0af2b876a8c535dba458bca69f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 May 2015 20:04:55 +0200 Subject: [PATCH] s3:smbd: add a smbd_notify_cancel_by_map() helper function Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison (cherry picked from commit 2c47fb16089602a42f62124520e58bdcd8c7d053) --- source3/smbd/notify.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 4842d6f2fcb..cb9f8738943 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -350,6 +350,17 @@ static void change_notify_remove_request(struct smbd_server_connection *sconn, TALLOC_FREE(req); } +static void smbd_notify_cancel_by_map(struct notify_mid_map *map) +{ + struct smb_request *smbreq = map->req->req; + struct smbd_server_connection *sconn = smbreq->sconn; + NTSTATUS notify_status = NT_STATUS_CANCELLED; + + change_notify_reply(smbreq, notify_status, + 0, NULL, map->req->reply_fn); + change_notify_remove_request(sconn, map->req); +} + /**************************************************************************** Delete entries by mid from the change notify pending queue. Always send reply. *****************************************************************************/ @@ -369,9 +380,7 @@ void remove_pending_change_notify_requests_by_mid( return; } - change_notify_reply(map->req->req, - NT_STATUS_CANCELLED, 0, NULL, map->req->reply_fn); - change_notify_remove_request(sconn, map->req); + smbd_notify_cancel_by_map(map); } void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq) @@ -389,9 +398,7 @@ void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq) return; } - change_notify_reply(map->req->req, - NT_STATUS_CANCELLED, 0, NULL, map->req->reply_fn); - change_notify_remove_request(sconn, map->req); + smbd_notify_cancel_by_map(map); } /**************************************************************************** -- 2.11.4.GIT