Search squid archive

Re: Squid caching bad objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/26/2017 10:11 AM, Razor Cross wrote:

> We are using squid 3.5. for our server. Recently we have noticed that
> squid is caching incomplete objects in case of chunked response.
> 
> We have gone through the squid code. It looks likes squid is caching
> incomplete response in case of EOF from the server even though it does
> not receive the last empty chunk.
> 
> 
>  if (eof) // already reached EOF
>         return COMPLETE_NONPERSISTENT_MSG;

You are looking at the wrong code. HttpStateData::persistentConnStatus()
and related *_MSG codes do not determine whether the entire object was
received. They determine whether

(a) Squid should expect more response bytes and

(b) The connection can be kept open if no more response bytes are expected.

The COMPLETE_NONPERSISTENT_MSG return value is correct here (I am
ignoring the sad fact that we are abusing the word "complete" to cover
both whole and truncated responses).


> Is this expected? Because of this problem, our server ends up serving
> bad objects to the user.

What you describe sounds like a bug, but the exact code you are quoting
is not responsible for that bug. I di not study this in detail, but I
suspect that the COMPLETE_NONPERSISTENT_MSG case in
HttpStateData::processReplyBody() should be changed to call
StoreEntry::lengthWentBad("missing last-chunk") when lastChunk is false
and HttpStateData::flags.chunked is true.


HTH,

Alex.
_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users




[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux