From: Stefan Metzmacher Date: Tue, 14 Sep 2021 00:22:09 +0000 (+0200) Subject: smb2_server: simplify smbd_smb2_advance_incoming() recvfile logic X-Git-Tag: tevent-0.16.0~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=153323efc55bef47a4694645bb2dbfb3334776a3;p=thirdparty%2Fsamba.git smb2_server: simplify smbd_smb2_advance_incoming() recvfile logic This will make further changes easier... Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 1c15405373b..767cbbb405b 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -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; }