smb2_server: split out smbd_smb2_flush_with_sendmsg() out of smbd_smb2_flush_send_queue()
[gd/samba-autobuild/.git] / source3 / smbd / smb2_server.c
index fa81082aacfb6f8023703855fe228874174de1e6..e596e059c1c19481f6121480c114104489416dd1 100644 (file)
@@ -4765,7 +4765,7 @@ static NTSTATUS smbd_smb2_advance_send_queue(struct smbXsrv_connection *xconn,
        return NT_STATUS_OK;
 }
 
-static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
+static NTSTATUS smbd_smb2_flush_with_sendmsg(struct smbXsrv_connection *xconn)
 {
        int ret;
        int err;
@@ -4890,6 +4890,18 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
                }
        }
 
+       return NT_STATUS_MORE_PROCESSING_REQUIRED;
+}
+
+static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
+{
+       NTSTATUS status;
+
+       status = smbd_smb2_flush_with_sendmsg(xconn);
+       if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+               return status;
+       }
+
        /*
         * Restart reads if we were blocked on
         * draining the send queue.