]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smb2_server: simplify smbd_smb2_advance_incoming() recvfile logic
authorStefan Metzmacher <metze@samba.org>
Tue, 14 Sep 2021 00:22:09 +0000 (02:22 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 6 Sep 2023 19:30:35 +0000 (19:30 +0000)
This will make further changes easier...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_server.c

index 1c15405373bed01691d1a9c3c777738d18a608fb..767cbbb405b4269ef59df0dc1dc740a6ba387d6f 100644 (file)
@@ -4903,7 +4903,14 @@ static NTSTATUS smbd_smb2_advance_incoming(struct smbXsrv_connection *xconn, siz
        }
 
        if (state->pktlen > 0) {
-               if (state->doing_receivefile && !is_smb2_recvfile_write(state)) {
+               if (!state->doing_receivefile) {
+                       /*
+                        * we have all the data.
+                        */
+                       goto got_full;
+               }
+
+               if (!is_smb2_recvfile_write(state)) {
                        size_t ofs = state->pktlen;
 
                        /*
@@ -4932,8 +4939,8 @@ static NTSTATUS smbd_smb2_advance_incoming(struct smbXsrv_connection *xconn, siz
                }
 
                /*
-                * Either this is a receivefile write so we've
-                * done a short read, or if not we have all the data.
+                * This is a receivefile write so we've
+                * done a short read.
                 */
                goto got_full;
        }