Greg Ames <[EMAIL PROTECTED]> writes: > The other is a sendfile assert that we've seen intermittently for a long time. > Jeff thinks the FreeBSD kernel is giving us a return value of 0 with no bytes > sent. I think we might be passing a length or an offset that's too big, perhaps > when the site is updated after we stat() the file. I plan to write traps to > test both theories.
Here's what I think in a little more detail: [I suspect that] Both FreeBSD and Linux sendfile() will return 0 in some conditions where it sends no bytes. The conditions? Bogus offset/length combination. I just verified that on Linux I get return code 0 from sendfile() when asking it to send 8192 bytes starting at offset 999999999 in a file that is much smaller than that. The file offset was updated to 999999999. (It seems that sendfile picks up some semantics from sparse file support in seek-type operations.) Why would we give sendfile a bogus offset/length combination? a couple of possible reasons: a) like you said, the file size could change during the request (a definite problem) b) we bungle the processing somehow and come up with a bogus file bucket -- Jeff Trawick | [EMAIL PROTECTED] Born in Roswell... married an alien...
