}
/* 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
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);