dev  

Re: sendfile in darwin

Jim Jagielski
Thu, 15 May 2008 06:48:40 -0700

After pouring over the Darwin sendfile() code and setting up
2 Leopards to do the APR sendfile tests (which *did* result in
the errors popping up), I've committed r656659. The main issue
is that we should *always* return if sendfile returns -1, with EAGAIN
and some data sent; previously that would part of an if/else and
the else was being used (note that FreeBSD did not do that, so
this was added in r652690 when other restructuring was going on;
this is also when the rv=0 statement was added). Also note that
the loop JUST is for handling errors, and not for updating
len and/or offset anymore.

This pases httpd getfile tests, APR ./sendfile tests, both
when client/server are local as well as when distinct. However,
both my test machines were Intel and relatively peppy (although,
as mentioned, I was able to reproduce the errors you were seeing
with this setup).

Assuming no issues, I will backport r656659 to apr-1.3