dev  

Re: sendfile in darwin

William A. Rowe, Jr.
Tue, 13 May 2008 11:59:49 -0700

Jim Jagielski wrote:

On May 7, 2008, at 5:58 PM, Geoff Greer wrote:

OK, so there are two problems here:

1. Timeout sockets are broken in r654185. To test this cd to apr/test,
make, then run

./sendfile server & ./sendfile client timeout

I cannot confirm that. Works fine here.

Still broken here, see attached.

<jimsys:/Users/jim> % uname -a
Darwin jimsys.jaguNET.com 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386

Darwin Macintosh.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:23:43 PST 2008; root:xnu-1228.4.31~1/RELEASE_PPC Power Macintosh

Creating a test file...
Sending the file...
Calling apr_socket_sendfile()...
Headers (3):
        15 bytes (1)
        5 bytes (E)
        80000 bytes (^)
File: 200000 bytes from offset 0
Trailers (3):
        19 bytes
        10 bytes
        90000 bytes
apr_socket_sendfile()->0, sent 223061 bytes
Calling apr_socket_sendfile()...
Headers (0):
File: 56959 bytes from offset 143041
Trailers (3):
        19 bytes
        10 bytes
        90000 bytes
apr_socket_sendfile()->0, sent 146988 bytes
After apr_socket_sendfile(), the kernel file pointer is at offset 0.
client: apr_socket_sendfile() worked as expected!
apr_socket_recv()->0/Undefined error: 0 (expected APR_EOF)
Waiting for a client to connect...
Processing a client...