Re: squid-3, range-requests and brokenness

2004-03-22 Thread Vladimir V. Ivanov
On Wed, 17 Mar 2004 23:14:35 -0700
Adrian Chadd [EMAIL PROTECTED] wrote:

 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:
 ...[skipped]

Please look at bug#900 with attached patch
[ http://www.squid-cache.org/bugs/show_bug.cgi?id=900 ]

May be this is related to subject


-- 
Regards,
Vladimir Ivanov


squid-3, range-requests and brokenness

2004-03-17 Thread Adrian Chadd

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:

[EMAIL PROTECTED]:~/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