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

Amos Jeffries squid3 at treenet.co.nz
Mon Mar 27 02:12:34 UTC 2017

On 17/03/2017 6:17 a.m., Alex Rousskov wrote:
> On 03/16/2017 05:15 AM, Amos Jeffries wrote:
>> Any objections to applying this with this added:
>>   // XXX: putStr() still has String 64KB limits
>>   Must(strVia.length() < 64*1024);
> No objections from me if you replace the magic constant with a new
> inlined String::MaxSizeXXX() method. The slightly misleading source code
> comment above becomes unnecessary after that. Why XXX()? Because no
> correct caller code should know about internal String limits (but it may
> catch exceptions, including exceptions due to those limits).
>> (I kind of hate those low-level operations with Must() and assert() like
>> the former - far too little context to be useful debugging with such big
>> impact when they are triggered.)
> While it is indeed tempting to hate those Must(), we must keep in mind
> that low-level assert-replacing Must()s are not meant for debugging or
> even traditional error handling. Their purpose is to (hopefully) prevent
> Squid death.
> When the crash avoidance project completes, we will have a way to dump
> stack traces for specific Must()s, which will provide the same level of
> triage info as an assert() would, but (hopefully) without killing Squid
> in environments where such functionality is supported.
> HTH,
> Alex.

Applied with the above changes as rev.15104


More information about the squid-dev mailing list