Re: Proposal: Helper response: concatenated values with custom delimiter
Andrey K <[email protected]> Wed, 22 Apr 2026 12:45:23 +0300
| Newsgroups | gmane.comp.web.squid.devel |
|---|---|
| Message-ID | <CADJd0Y0HWzDK6L13piLt03VyM+6uVCc3wh8wc-38i5=MAaYhwQ@mail.gmail.com> |
--===============5933093095821701314==
Content-Type: multipart/alternative; boundary="000000000000bed7ab06500964a9"
--000000000000bed7ab06500964a9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello, Alex and Amos,
I have submitted the PR: https://github.com/squid-cache/squid/pull/2410
Alex, thank you very much for your recommendations regarding the code
refactoring.
> Ideally, explicitOrDefaultValue should be private, but achieving that
> ideal requires more refactoring work, and I do not recommend it at this
> time.
I didn't see any difficulties there, so I've already made
explicitOrDefaultValue private.
> The "TODO: Some callers..." comment will need to be
> adjusted as well.
I have removed the "TODO" comment entirely since access to the storage
variable is now properly protected via accessors.
Kind regards,
Ankor.
=D1=81=D1=80, 22 =D0=B0=D0=BF=D1=80. 2026=E2=80=AF=D0=B3. =D0=B2 00:17, Ale=
x Rousskov <[email protected]
>:
> 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=3D,)name=3Dvalue1,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 =3D [ '_' ] key [ flag ] '=3D' ( 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{...}=3Dvalue...
>
> For example:
>
> name{m}=3Dvalue1,value2
>
> or
>
> name{m=3D:}=3Dvalue1: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.
>
> _______________________________________________
> squid-dev mailing list
> [email protected]
> https://lists.squid-cache.org/listinfo/squid-dev
>
--000000000000bed7ab06500964a9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hello, Alex and Amos,<div><br></div><div>I have submitted =
the PR: <a href=3D"https://github.com/squid-cache/squid/pull/2410">https://=
github.com/squid-cache/squid/pull/2410</a></div><div><br></div><div>Alex, t=
hank you very much for your recommendations regarding the code refactoring.=
</div><div><br></div><div>> Ideally, explicitOrDefaultValue should be pr=
ivate, but achieving that<br>> ideal requires more refactoring work, and=
I do not recommend it at this<br>> time.</div><div><br></div><div>I did=
n't see any difficulties there, so I've already made <font face=3D"=
monospace">explicitOrDefaultValue</font> private.<br><br><br>> The "=
;TODO: Some callers..." comment will need to be<br>> adjusted as we=
ll.</div><div><br></div><div>I have removed the <font face=3D"monospace">&q=
uot;TODO"</font> comment entirely since access to the storage variable=
is now properly protected via accessors.</div><div><br></div><div>Kind reg=
ards,</div><div>=C2=A0 =C2=A0 Ankor.</div></div><br><div class=3D"gmail_quo=
te gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">=D1=81=D1=
=80, 22 =D0=B0=D0=BF=D1=80. 2026=E2=80=AF=D0=B3. =D0=B2 00:17, Alex Roussko=
v <<a href=3D"mailto:[email protected]">rousskov@measurem=
ent-factory.com</a>>:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">On 2026-04-21 15:57, Amos Jeffries wrote:<br>
<br>
> The helper protocol documents ',' as list delimiter<br>
<br>
Where do we document ',' as a delimiter for annotation values in he=
lper <br>
responses? I cannot find any such text on AddonHelpers page or inside <br>
cf.data.pre.<br>
<br>
> On 22/04/2026 03:11, Alex Rousskov wrote:<br>
>> [ If there is a real, serious need to optimize that existing suppo=
rt, <br>
>> then ] can we invent another syntax that will not result in <br>
>> mishandling any existing helper annotation (that is not treated as=
a <br>
>> list today)? For example, perhaps we can use isKeyNameChar() <br>
>> restrictions to place the delimiter first, before the annotation n=
ame?<br>
>><br>
>> =C2=A0=C2=A0=C2=A0=C2=A0 (m=3D,)name=3Dvalue1,value2<br>
>><br>
> <br>
> Hmm.=C2=A0 When I combine that idea with older proposals floated about=
<br>
> kv-pair append/replace syntax there are some nice implications.<br>
> <br>
> How about this:<br>
> <br>
> 1) change of kv-pair grammar to:<br>
> <br>
>=C2=A0 =C2=A0=C2=A0 kv-pair =3D [ '_' ] key [ flag ] '=3D&#=
39; ( value / list )<br>
<br>
Yes, AFAICT, placing handling instructions _after_ the key should also <br>
work (for the same isKeyNameChar) reason) and is more aesthetically <br>
pleasing than my sketch above.<br>
<br>
If we really have to add this new feature, then I would probably use <br>
curly braces for these optional instructions, to make it similar to our <br=
>
logformat %codes:<br>
<br>
=C2=A0 =C2=A0 =C2=A0name{...}=3Dvalue...<br>
<br>
For example:<br>
<br>
=C2=A0 =C2=A0 =C2=A0name{m}=3Dvalue1,value2<br>
<br>
or<br>
<br>
=C2=A0 =C2=A0 =C2=A0name{m=3D:}=3Dvalue1:value2<br>
<br>
<br>
> * flag does not need to be limited to a single character. It could be =
<br>
> several.<br>
<br>
Any syntax should allow adding safe, backward-compatible support for <br>
additional/complex instructions in the future, of course, including <br>
multiple instructions.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
_______________________________________________<br>
squid-dev mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">squid-=
[email protected]</a><br>
<a href=3D"https://lists.squid-cache.org/listinfo/squid-dev" rel=3D"norefer=
rer" target=3D"_blank">https://lists.squid-cache.org/listinfo/squid-dev</a>=
<br>
</blockquote></div>
--000000000000bed7ab06500964a9--
--===============5933093095821701314==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
squid-dev mailing list
[email protected]
https://lists.squid-cache.org/listinfo/squid-dev
--===============5933093095821701314==--