[squid-dev] Proposal: Helper response: concatenated values with custom delimiter

Alex Rousskov rousskov at measurement-factory.com
Tue Apr 21 21:17:15 UTC 2026


On 2026-04-21 15:57, Amos Jeffries wrote:

> The helper protocol documents ',' as list delimiter

Where do we document ',' as a delimiter for annotation values in helper 
responses? I cannot find any such text on AddonHelpers page or inside 
cf.data.pre.

> On 22/04/2026 03:11, Alex Rousskov wrote:
>> [ If there is a real, serious need to optimize that existing support, 
>> then ] can we invent another syntax that will not result in 
>> mishandling any existing helper annotation (that is not treated as a 
>> list today)? For example, perhaps we can use isKeyNameChar() 
>> restrictions to place the delimiter first, before the annotation name?
>>
>>      (m=,)name=value1,value2
>>
> 
> Hmm.  When I combine that idea with older proposals floated about 
> kv-pair append/replace syntax there are some nice implications.
> 
> How about this:
> 
> 1) change of kv-pair grammar to:
> 
>     kv-pair = [ '_' ] key [ flag ] '=' ( value / list )

Yes, AFAICT, placing handling instructions _after_ the key should also 
work (for the same isKeyNameChar) reason) and is more aesthetically 
pleasing than my sketch above.

If we really have to add this new feature, then I would probably use 
curly braces for these optional instructions, to make it similar to our 
logformat %codes:

     name{...}=value...

For example:

     name{m}=value1,value2

or

     name{m=:}=value1:value2


> * flag does not need to be limited to a single character. It could be 
> several.

Any syntax should allow adding safe, backward-compatible support for 
additional/complex instructions in the future, of course, including 
multiple instructions.


HTH,

Alex.



More information about the squid-dev mailing list