From 47452b8cecaa9ad17d88e259a9972c5ddd007629 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 15 Aug 2009 10:07:00 +0200 Subject: [PATCH] s3:smbd: add smbd_notify_cancel_by_smbreq() This function will be used by the SMB2 notify code. metze --- source3/smbd/globals.h | 3 +++ source3/smbd/notify.c | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index bfed901bf4ad..4fa85a9fdb32 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -234,6 +234,9 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, uint32_t *_mode, long *_prev_offset); +void smbd_notify_cancel_by_smbreq(struct smbd_server_connection *sconn, + const struct smb_request *smbreq); + void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn, const char *reason, const char *location); diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 8f37923865be..e430fcfc04c4 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -317,6 +317,26 @@ void remove_pending_change_notify_requests_by_mid(uint16 mid) change_notify_remove_request(map->req); } +void smbd_notify_cancel_by_smbreq(struct smbd_server_connection *sconn, + const struct smb_request *smbreq) +{ + struct notify_mid_map *map; + + for (map = sconn->smb1.notify_mid_maps; map; map = map->next) { + if (map->req->req == smbreq) { + break; + } + } + + if (map == NULL) { + return; + } + + change_notify_reply(map->req->fsp->conn, map->req->req, + NT_STATUS_CANCELLED, 0, NULL, map->req->reply_fn); + change_notify_remove_request(map->req); +} + /**************************************************************************** Delete entries by fnum from the change notify pending queue. *****************************************************************************/ -- 2.34.1