httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: [PATCH] Sendfile on old FreeBSD's
Date Thu, 28 Dec 2000 14:37:14 GMT

> . looking at BSD 4.1 sendfile(), it seems clear that the number of
>   bytes sent includes bytes sent from the header (unless the
>   kernel writev() is broken); the 4.2 logic for bytes sent from the
>   header looks the same; the kernel code doesn't seem to match your
>   empirical results; I guess you had some trace points in
>   apr_sendfile() to know how it was called (parms updated properly?);
>   sorry for the questioning but it is hard to verify your
>   interpretation without detailed information :)

Everything was called properly.  I have two machines, one with 4.1 and one
with 4.2.  I stepped through both machines and got different results
back.  It almost looks like the bytes_sent field is treated differently
based on the sendfile() return code, but that would be really stupid.

> . If FreeBSD's sendfile can hit EAGAIN on the body after having sent
>   bytes from the header, shouldn't we return APR_SUCCESS?

Maybe.  I am following the general rule that we return the same response
that the OS returns.

> apr_sendfile() results for a socket with APR timeout set:
> 
>   a real error occurred (not EAGAIN):
>     rv set as appropriate, bytes_sent could include a previous entity
> 
>   sent any data and no real error occurred:
> 
>     rv APR_SUCCESS, bytes_sent updated
> 
>   sent no data from header or body or trailer within timeout period:
> 
>     rv APR_TIMEUP, bytes_sent could include previous entity
> 
>   I see no room for APR_EAGAIN.  That isn't something the app should
>   have to handle if an APR timeout is set.

This makes sense to me.  I'll look at modifying apr_sendfile on FreeBSD to
actually do this properly.

> > Anyway, could somebody with more in-depth knowledge of FreeBSD look at
> > this, and see if this patch makes sense?  The other option is to just turn
> > off sendfile support in FreeBSD for anything other than 4.2.
> 
> Does test/sendfile.c ever find a problem on any FreeBSD level?

It works just fine on 4.2, but fails miserably on 4.1.  I am beginning to
think that FreeBSD's sendfile implementation may have some problems.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message