summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-03-19 12:24:17 -0700
committerJeremy Allison <jra@samba.org>2013-04-19 14:10:51 -0700
commita36d7633bd3608b71f610fc9df2ad9c66bfdd9c6 (patch)
treeec07abbfedc5af77fed95a8db58b64aa4eb13d10 /source3
parentec9fc986da8279f15338b7682c629bfdfc36d016 (diff)
downloadsamba-a36d7633bd3608b71f610fc9df2ad9c66bfdd9c6.tar.gz
samba-a36d7633bd3608b71f610fc9df2ad9c66bfdd9c6.tar.bz2
samba-a36d7633bd3608b71f610fc9df2ad9c66bfdd9c6.zip
Add function smbd_smb2_unread_bytes().
Returns number of bytes left to read for recvfile. Will be used in SMB_2_WRITE_FILE code path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/globals.h1
-rw-r--r--source3/smbd/smb2_glue.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 150275894b..d6ca15286d 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -247,6 +247,7 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req,
uint32_t defer_time);
struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req);
+size_t smbd_smb2_unread_bytes(struct smbd_smb2_request *req);
void remove_smb2_chained_fsp(files_struct *fsp);
NTSTATUS smbd_smb2_request_verify_creditcharge(struct smbd_smb2_request *req,
diff --git a/source3/smbd/smb2_glue.c b/source3/smbd/smb2_glue.c
index 9fc1e49c2e..54135b5585 100644
--- a/source3/smbd/smb2_glue.c
+++ b/source3/smbd/smb2_glue.c
@@ -59,6 +59,18 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req)
}
/*********************************************************
+ Are there unread bytes for recvfile ?
+*********************************************************/
+
+size_t smbd_smb2_unread_bytes(struct smbd_smb2_request *req)
+{
+ if (req->smb1req) {
+ return req->smb1req->unread_bytes;
+ }
+ return 0;
+}
+
+/*********************************************************
Called from file_free() to remove any chained fsp pointers.
*********************************************************/