summaryrefslogtreecommitdiff
path: root/source3/smbd/notify.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-14 07:58:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:40 -0500
commit6a5bdb79e136f8cf123e36070640244ad924b274 (patch)
treea261cf2d02167f6d8b528c53a94a0d46e806e2d8 /source3/smbd/notify.c
parentb41b38031f8eeec916e0e5f9fb80cd8ecd5e22cd (diff)
downloadsamba-6a5bdb79e136f8cf123e36070640244ad924b274.tar.gz
samba-6a5bdb79e136f8cf123e36070640244ad924b274.tar.bz2
samba-6a5bdb79e136f8cf123e36070640244ad924b274.zip
r24399: Change change_notify_reply to use send_nt_replies_new
(This used to be commit be67bb50eef88f4d56f48e785c1e5865616f5f33)
Diffstat (limited to 'source3/smbd/notify.c')
-rw-r--r--source3/smbd/notify.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index 8474ca6446..144af093cf 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -154,9 +154,8 @@ static void change_notify_reply_packet(const uint8 *request_buf,
void change_notify_reply(const uint8 *request_buf, uint32 max_param,
struct notify_change_buf *notify_buf)
{
- char *outbuf = NULL;
prs_struct ps;
- size_t buflen;
+ struct smb_request *req = NULL;
if (notify_buf->num_changes == -1) {
change_notify_reply_packet(request_buf, NT_STATUS_OK);
@@ -176,22 +175,18 @@ void change_notify_reply(const uint8 *request_buf, uint32 max_param,
goto done;
}
- buflen = smb_size+38+prs_offset(&ps) + 4 /* padding */;
-
- if (!(outbuf = SMB_MALLOC_ARRAY(char, buflen))) {
+ if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
change_notify_reply_packet(request_buf, NT_STATUS_NO_MEMORY);
goto done;
}
- construct_reply_common((char *)request_buf, outbuf);
+ init_smb_request(req, request_buf);
- if (send_nt_replies((char *)request_buf, outbuf, buflen, NT_STATUS_OK, prs_data_p(&ps),
- prs_offset(&ps), NULL, 0) == -1) {
- exit_server("change_notify_reply_packet: send_smb failed.");
- }
+ send_nt_replies_new(req, NT_STATUS_OK, prs_data_p(&ps),
+ prs_offset(&ps), NULL, 0);
done:
- SAFE_FREE(outbuf);
+ TALLOC_FREE(req);
prs_mem_free(&ps);
TALLOC_FREE(notify_buf->changes);