[squid-users] source code question

Alex Rousskov rousskov at measurement-factory.com
Sun Nov 29 17:26:32 UTC 2015


On 11/29/2015 09:03 AM, joe wrote:
> pls don't mind me if i ask. purpose learning and have capability of helping 

Please post Squid development questions to squid-dev, not squid-users.


> int64_t expectlen = entry->getReply()->content_length + entry->getReply()->hdr_sz;
> int64_t curlen =  mem->endOffset();
> 
> expectlen  is the content_length + 
> the  curlen is it = expectlen  ???


I do not fully understand your question, but, in many cases:

* expectlen is the total number of response bytes we expect to get

* curlen is the number of response bytes we got so far

Both variables include response headers and body.


The complete answer is actually more complex because of responses
without known Content-Length, Range responses, and other special cases.
I do not recommend assuming that CheckQuickAbortIsReasonable() code
handles all those cases 100% correctly.


HTH,

Alex.



More information about the squid-users mailing list