squid-3, range-requests and brokenness

From: Adrian Chadd <adrian@dont-contact.us>
Date: Wed, 17 Mar 2004 23:14:35 -0700

Hi,

I've come across a bizarreness in the range request support.

This request, when thrown at squid-3, returns much, much less data
than it should:

adrian@mierda:~/work/squid/tests/range$ cat range-creative-2.txt
GET http://www.creative.net.au/test.txt HTTP/1.1
Host: www.creative.net.au
Accept-ranges: bytes
Accept: */*
Range: bytes=12806817-12872353
Connection: close

Ok, here's the problem. in HttpStateData::persistentConnStatus()
there's a check to see whether, if we know the body size, do we
have the entire body:

if (entry->mem_obj->endOffset() < reply->content_length + reply->hdr_sz) {
        return INCOMPLETE_MSG;
}

(brackers are mine so I can do some extra statements for debugging.)

Now, here's the catch with this request:

Breakpoint 1, HttpStateData::persistentConnStatus() const (this=0x406b6038) at http.cc:816
816 if (entry->mem_obj->endOffset() < reply->content_length + reply->hdr_sz) {
(gdb) print reply->content_length
$1 = 65537
(gdb)
$2 = 65537
(gdb) print reply->hdr_sz
$3 = 363
(gdb)
$4 = 363
(gdb) print entry->mem_obj->endOffset()
$5 = 12808165
(gdb)

.. see the problem? It'll always signify that we have enough data even though
we haven't got enough data for the range reply yet.

Any ideas? I'll keep checking out the new stmem stuff and see if there's
a nice way I can ask whether we've received the whole reply which works
in both cases.

Adrian
Received on Wed Mar 17 2004 - 23:14:35 MST

This archive was generated by hypermail pre-2.1.9 : Thu Apr 01 2004 - 12:00:04 MST