Suggestions:
1. Make sure sendfile is being called. (Put some test output at the top of the function and make sure you do fflush(stdout).)
2. Did you fix your send commands in sendfile? (I seem to recall that you had the same errors there as elsewhere -- using a raw number as the second argument instead of a pointer, etc.)