FreeBSD Bugzilla – Attachment 7252 Details for
Bug 15861
ftpd did not use sendfile(2) when sending regular files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.40 KB, created by
Jukka Ukkonen
on 2000-01-03 17:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jukka Ukkonen
Created:
2000-01-03 17:10:00 UTC
Size:
1.40 KB
patch
obsolete
>--- ftpd.c.orig Sun May 2 12:35:30 1999 >+++ ftpd.c Wed Dec 29 14:41:26 1999 >@@ -1466,6 +1466,7 @@ > filefd = fileno(instr); > > if (isreg && filesize < (off_t)16 * 1024 * 1024) { >+#if 0 > buf = mmap(0, filesize, PROT_READ, MAP_SHARED, filefd, > (off_t)0); > if (buf == MAP_FAILED) { >@@ -1484,8 +1485,31 @@ > > transflag = 0; > munmap(buf, (size_t)filesize); >+ > if (cnt < 0) > goto data_err; >+#endif >+ off_t offset; >+ int fail; >+ >+ len = filesize; >+ offset = 0; >+ fail = 0; >+ >+ while (len && >+ ! (fail = sendfile (filefd, netfd, offset, len, >+ NULL, &cnt, 0))) { >+ len -= cnt; >+ offset += cnt; >+ } >+ >+ if (fail < 0) { >+ if (errno == EINVAL) >+ goto oldway; >+ >+ goto data_err; >+ } >+ > reply(226, "Transfer complete."); > return; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15861
: 7252