apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <rbl...@gmail.com>
Subject Re: do we still want sendfile enabled with our default conf files?
Date Fri, 18 Mar 2005 16:27:23 GMT
That's fine.  Pay attention to what I suggested.  Default to
non-native sendfile, until we have know that it works.  If you have an
OS that you know for a fact does sendfile correctly, then that would
be a case where we know that it works.

Instead of



#ifdef SomeOSThatWorks

Since the beginning of APR, we thought that we knew how to get
sendfile working on most of our supported OS'.  That's why we included
sendfile support.  It turns out though, that for many of those
platforms, sendfile just doesn't work in some situations.  When we
have a platform without the bugs, then yes we should use sendfile, but
for all other cases I care infinately more about correctness than


On Fri, 18 Mar 2005 08:23:18 -0800, Justin Erenkrantz
<justin@erenkrantz.com> wrote:
> --On Friday, March 18, 2005 11:12 AM -0500 Ryan Bloom <rbloom@gmail.com> wrote:
> > funny, I took the list of exceptions to be so large and hard to
> > maintain that it made more sense to go with Jeff's original idea of
> > just disabling sendfile by default unless a user specifically decided
> > to enable it.  I just had to debug a problem for a friend with
> > sendfile on Linux.  I don't know what caused the problem, but
> > disabling sendfile solved it immediately.  Seems to me that until our
> > sendfile support is better, we should err on the side of always
> > sending the data correctly instead of absolutely as fast as possible.
> I absolutely refuse to punish users who are using good OSes because some OSes
> are brain-dead.  This is exactly the role that APR is meant to fill: if we
> know of conditions where it is unsafe to use sendfile, we won't use it unless
> explicitly told so by the user.
> The minimal check can be:
> if (flags & APR_SENDFILE_CHECK) {
> #ifdef LINUX || WIN32 || AIX || HPUX
>     return APR_ENOTIMPL;
> #endif
> }
> As people determine what conditions sendfile is safe (or causes problems),
> then we can add those.
> Feel free to advocate Linux always returning APR_ENOTIMPL for sendfile - I
> don't care.  However, blocking sendfile on non-buggy OSes is not a solution
> that I am willing to sign off on.  -- justin

Ryan Bloom

View raw message