Hi, apr_sendfile() for FreeBSD has workaround for "nbytes!=0 bug" but this bug had fixed in CURRENT:
http://www.FreeBSD.org/cgi/cvsweb.cgi/src/sys/kern/uipc_syscalls.c#rev1.103 So I think code should be following: #ifdef __FreeBSD_version < 500029 for (i = 0; i < hdtr->numheaders; i++) { bytes_to_send += hdtr->headers[i].iov_len; } #endif But this correct problem at build time only. Suppose that someone has built Apache 2 on FreeBSD 4.x. Than he will upgrade FreeBSD to 5.1 or higher. Sometimes it's not possible to rebuild Apache so he would encounter problem. So I think that better way is not to use FreeBSD 4.x sendfile() capability to send header but use emulatation of header transmition instead. Igor Sysoev