squid-3 development: stmem, endOffset(), range requests

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 23 Aug 2004 16:04:47 +0800

Hi all,

I'm going to take another (!) shot at fixing range requests
for squid-3.

I've checked out a current squid-3 tree. It seems that the same
problem exists as it did a few months ago.

This being:

* line 816 of src/http.cc does this:

    /* If the body size is known, we must wait until we've gotten all of it. */
    if (entry->mem_obj->endOffset() < reply->content_length + reply->hdr_sz)
        return INCOMPLETE_MSG;

.. now, at this point, the whole point behind content_length + hdr_sz
is the size of the _reply_. endOffset() is now _not_ the size of the
reply anymore. It is the highest position of the object we know about.

Now, let me explain what changed, just for posterity.

Robert changed the way the stmem stuff worked so it now stores a
splay tree of "chunks" of the object. You can stuff arbitrary ranges
into memory here.

He changed what endOffset() _meant_ but didn't change the API call
to reflect this.

In the Old Method, a range request from a _server_ would be treated
as uncacheable, so the endOffset() would reflect the end of the server
reply.

Robert, Henrik, does this all sound correct?

Everything else actually seems to work out just fine, to be honest.

Adrian

-- 
Adrian Chadd			I'm only a fanboy if
<adrian@creative.net.au>	    I emailed Wesley Crusher.
			
Received on Mon Aug 23 2004 - 02:04:52 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Sep 01 2004 - 12:00:04 MDT