diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 150275894b6..d6ca15286db 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 9fc1e49c2e5..54135b55853 100644 --- a/source3/smbd/smb2_glue.c +++ b/source3/smbd/smb2_glue.c @@ -58,6 +58,18 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req) return smbreq; } +/********************************************************* + 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. *********************************************************/