Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 28103 invoked by uid 500); 1 May 2001 22:16:41 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 27390 invoked from network); 1 May 2001 22:15:29 -0000 X-Authentication-Warning: kurgan.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Tue, 1 May 2001 13:58:27 -0700 From: Greg Stein To: new-httpd@apache.org Subject: Re: cvs commit: httpd-2.0/server core.c Message-ID: <20010501135827.T1374@lyra.org> Mail-Followup-To: new-httpd@apache.org References: <20010501120158.O1374@lyra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from rbb@covalent.net on Tue, May 01, 2001 at 12:16:21PM -0700 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Tue, May 01, 2001 at 12:16:21PM -0700, rbb@covalent.net 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/