mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
Undo the work-around for the sendfile bug where nbytes needed the hdr/trl
size added to it in order for it to work properly when nbytes != 0. Reviewed by: alfred MFC after: 3 days
This commit is contained in:
parent
673158816b
commit
2e4bf827e5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89676
@ -100,17 +100,6 @@ _sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr,
|
||||
/* Check if file operations are to block */
|
||||
blocking = ((_thread_fd_table[s]->flags & O_NONBLOCK) == 0);
|
||||
|
||||
/*
|
||||
* Emulate sendfile(2) weirdness, sendfile doesn't actually send
|
||||
* nbytes of the file, it really sends (nbytes - headers_size) of
|
||||
* the file. If (nbytes - headers_size) == 0 we just send trailers.
|
||||
*/
|
||||
if (nbytes != 0) {
|
||||
nbytes -= nwritten;
|
||||
if (nbytes <= 0)
|
||||
goto ERROR_2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop while no error occurs and until the expected number of bytes are
|
||||
* written.
|
||||
|
Loading…
Reference in New Issue
Block a user