From da2dd1406f57461af20df2df3586e48be60b3af2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 13 Jan 2009 15:36:09 -0800 Subject: Only call sendfile_short_read() if we need it. Jeremy. --- source3/smbd/reply.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index c8b8ec50e5..d7704965f8 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2785,7 +2785,9 @@ void send_file_readbraw(connection_struct *conn, } /* Deal with possible short send. */ - sendfile_short_send(fsp, sendfile_read, 4, nread); + if (sendfile_read != 4+nread) { + sendfile_short_send(fsp, sendfile_read, 4, nread); + } return; } #endif @@ -3278,7 +3280,9 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, fsp->fnum, (int)smb_maxcnt, (int)nread ) ); /* Deal with possible short send. */ - sendfile_short_send(fsp, nread, sizeof(headerbuf), smb_maxcnt); + if (nread != smb_maxcnt + sizeof(headerbuf)) { + sendfile_short_send(fsp, nread, sizeof(headerbuf), smb_maxcnt); + } /* No outbuf here means successful sendfile. */ TALLOC_FREE(req->outbuf); -- cgit