On Tue, May 01, 2001 at 12:16:21PM -0700, [EMAIL PROTECTED] wrote:
>
> > > > if ((!fd && !more &&
> > > > (nbytes < AP_MIN_BYTES_TO_WRITE) && !APR_BUCKET_IS_FLUSH(e))
> > > > || (APR_BUCKET_IS_EOS(e) && c->keepalive)) {
> > > >
> > > > I think the logic in the conditional is just wrong.
> > >
> > > I agree completely. I think I can fix this in a few minutes. Watch for a
> > > patch.
> >
> > Hmm. It seems that we'd just want to completely skip the whole thing if fd
> > has something in it. So the conditional might be:
> >
> > if (!fd && ((!more && nbytes < AP_MIN_BYTES_TO_WRITE
> > && !APR_BUCKET_IS_FLUSH(e))
> > || (APR_BUCKET_IS_EOS(e) && c->keepalive)))
> >
> > Does that seem right?
>
> I don't think that is enough. We need to also make sure that we don't
> have nbytes >= AP_MIN_BYTES_TO_WRITE. The problem is that last
> conditional is really just kind of bogus. I am working on a patch, and
> should have it soon-ish.
We don't count bytes for the files, so that doesn't quite work (which is why
I did the !fd thang).
However... now that I think about it. We *should* count bytes for the files.
We have the lower threshold for use of sendfile(), but we shouldn't write to
the network for, say, a 500 byte file and 10 bytes of other content.
To clarify what I'm trying to say:
Let's say that we have 200 bytes of headers and a 500 byte file. If we just
key off of the file, then we'd end up doing a sendfile with 700 bytes total
content. Bummer.
So... that means we need to add a line in the FILE bucket stuff:
nbytes += flen;
That should allow us to key on nbytes like you suggest.
Note that the last conditional is fine *IFF* you also check nbytes.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/