diff options
author | Jeremy Allison <jra@samba.org> | 2009-01-13 15:36:09 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-01-13 15:36:09 -0800 |
commit | da2dd1406f57461af20df2df3586e48be60b3af2 (patch) | |
tree | 3e29dea77ec14620bc1ff8a541b1122830a2d16b /source3/smbd | |
parent | 0f450623c5e73b941ced136ba7160bf6554a21ce (diff) | |
download | samba-da2dd1406f57461af20df2df3586e48be60b3af2.tar.gz samba-da2dd1406f57461af20df2df3586e48be60b3af2.tar.bz2 samba-da2dd1406f57461af20df2df3586e48be60b3af2.zip |
Only call sendfile_short_read() if we need it.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/reply.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |