[squid-dev] [PATCH] VIA creation code duplication

Amos Jeffries squid3 at treenet.co.nz
Thu Mar 16 07:38:47 UTC 2017


On 14/03/2017 5:24 a.m., Alex Rousskov wrote:
> On 03/13/2017 08:25 AM, Eduard Bagdasaryan wrote:
>> On 14.02.2017 04:22, Amos Jeffries wrote:
>>> The problem is with proxy where the admin has configured large headers
>>> to be allowed, and receives a Via just under the 6KB liit. Our append
>>> pushing it over by even one byte would assert.
> 
> Yes, except s/6/64/ and no special configuration is probably needed:
> reply_header_max_size is 64KB by default (and so is String::SizeMax_).
> 
> 
>> I am attaching a patch using SBuf instead of String for Via
>> accumulating, as you previously suggested. I am not
>> sure this is a much better solution since we have to do an
>> extra copy into SBuf.
> 
> Will this new patch assert in String::setBuffer(?) when the final Via
> value exceeds String::SizeMax_ and putStr() is called with a 64KB+1 or
> longer value string?

Yes I think it still misses the size check there.

Any objections to applying this with this added:

  // XXX: putStr() still has String 64KB limits
  Must(strVia.length() < 64*1024);

Amos



More information about the squid-dev mailing list