diff options
author | andre <andre@FreeBSD.org> | 2007-05-19 20:50:59 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2007-05-19 20:50:59 +0000 |
commit | 07a8df93210bc72e90e316d09db447acfdf4c10f (patch) | |
tree | 06d34d5d05c502d5ba8f23a3547c4d6d87549e26 /sys/kern/kern_sx.c | |
parent | eb4340f8a2908eba3adcc355033be07331f5e287 (diff) | |
download | FreeBSD-src-07a8df93210bc72e90e316d09db447acfdf4c10f.zip FreeBSD-src-07a8df93210bc72e90e316d09db447acfdf4c10f.tar.gz |
In kern_sendfile() adjust byte accounting of the file sending loop to
ignore the size of any headers that were passed with the sendfile(2)
system call. Otherwise the file sent will be truncated by the header
size if the nbytes parameter was provided. The bug doesn't show up
when either nbytes is zero, meaning send the whole file, or no header
iovec is provided.
Resolve a potential error aliasing of errors from the VM and sf_buf
parts and the protocol send parts where an error of the latter over-
writes one of the former.
Update comments.
The byte accounting bug wasn't seen in earlier because none of the popular
sendfile(2) consumers, Apache, lighttpd and our ftpd(8) use it in modes
that trigger it. The varnish HTTP proxy makes full use of it and exposed
the problem.
Bug found by: phk
Tested by: phk
Diffstat (limited to 'sys/kern/kern_sx.c')
0 files changed, 0 insertions, 0 deletions