|
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | +<HTML> |
| 3 | + <HEAD> |
| 4 | + <TITLE> [squid-dev] Proposal: Helper response: concatenated values with custom delimiter |
| 5 | + </TITLE> |
| 6 | + <LINK REL="Index" HREF="index.html" > |
| 7 | + <LINK REL="made" HREF="mailto:squid-dev%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-dev%5D%20Proposal%3A%20Helper%20response%3A%20concatenated%20values%20with%0A%20custom%20delimiter&In-Reply-To=%3CCADJd0Y2fXgTkm4nCQw4WqymYFWY0EDUPk_bifHh2bhKvZYC8XQ%40mail.gmail.com%3E"> |
| 8 | + <META NAME="robots" CONTENT="index,nofollow"> |
| 9 | + <style type="text/css"> |
| 10 | + pre { |
| 11 | + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ |
| 12 | + } |
| 13 | + </style> |
| 14 | + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 15 | + <LINK REL="Previous" HREF="010023.html"> |
| 16 | + <LINK REL="Next" HREF="010029.html"> |
| 17 | + </HEAD> |
| 18 | + <BODY BGCOLOR="#ffffff"> |
| 19 | + <H1>[squid-dev] Proposal: Helper response: concatenated values with custom delimiter</H1> |
| 20 | + <B>Andrey K</B> |
| 21 | + <A HREF="mailto:squid-dev%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-dev%5D%20Proposal%3A%20Helper%20response%3A%20concatenated%20values%20with%0A%20custom%20delimiter&In-Reply-To=%3CCADJd0Y2fXgTkm4nCQw4WqymYFWY0EDUPk_bifHh2bhKvZYC8XQ%40mail.gmail.com%3E" |
| 22 | + TITLE="[squid-dev] Proposal: Helper response: concatenated values with custom delimiter">ankor2023 at gmail.com |
| 23 | + </A><BR> |
| 24 | + <I>Tue Apr 21 13:06:03 UTC 2026</I> |
| 25 | + <P><UL> |
| 26 | + <LI>Previous message (by thread): <A HREF="010023.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods |
| 27 | +</A></li> |
| 28 | + <LI>Next message (by thread): <A HREF="010029.html">[squid-dev] Proposal: Helper response: concatenated values with custom delimiter |
| 29 | +</A></li> |
| 30 | + <LI> <B>Messages sorted by:</B> |
| 31 | + <a href="date.html#10026">[ date ]</a> |
| 32 | + <a href="thread.html#10026">[ thread ]</a> |
| 33 | + <a href="subject.html#10026">[ subject ]</a> |
| 34 | + <a href="author.html#10026">[ author ]</a> |
| 35 | + </LI> |
| 36 | + </UL> |
| 37 | + <HR> |
| 38 | +<!--beginarticle--> |
| 39 | +<PRE>Hello, |
| 40 | + |
| 41 | +I've mentioned this briefly in another thread, but I’d like to start a |
| 42 | +dedicated discussion regarding the support for a "concatenated" value |
| 43 | +format in helper responses. |
| 44 | + |
| 45 | +In a recent PR discussion ( |
| 46 | +<A HREF="https://github.com/squid-cache/squid/pull/2395#discussion_r3022844826">https://github.com/squid-cache/squid/pull/2395#discussion_r3022844826</A>), |
| 47 | +Alex pointed out issues with using concatenated formats for passing tag |
| 48 | +values. |
| 49 | + |
| 50 | +I propose adding support for a custom delimiter for concatenated values |
| 51 | +within a single KV-pair in the helper output. |
| 52 | + |
| 53 | +The proposed syntax is: |
| 54 | + <key>=<delimiter>"<value1><delimiter><value2>..." |
| 55 | + |
| 56 | +Examples: |
| 57 | + group=,"group1,group2,group3" |
| 58 | + clt_con_tag=;"tag1;tag2;tag3" |
| 59 | + |
| 60 | +Escaping logic: |
| 61 | + If the delimiter appears inside a value within the token, it must be |
| 62 | +double-escaped (\\) by the helper. |
| 63 | +For example: |
| 64 | + group=,"Staff:accountants\\,lawyers\\,security,Main_Office" |
| 65 | +This should produce two separate annotations: |
| 66 | + group=Staff:accountants,lawyers,security |
| 67 | + group=Main_Office |
| 68 | + |
| 69 | +The choice of double escaping is intentional to maintain consistency with |
| 70 | +the way strwordtok() processes quoted values in Squid. |
| 71 | +This approach ensures that we can preserve the underlying logic for |
| 72 | +handling values while correctly splitting the "glued" tokens. |
| 73 | + |
| 74 | +Currently, a comma-separated format is often used de facto, but Squid |
| 75 | +stores these as a single Entry, requiring the -m option for annotation |
| 76 | +checks. |
| 77 | + |
| 78 | +Proposed Change: |
| 79 | +A minor modification to Helper::Reply::parseResponseKeys(). |
| 80 | + |
| 81 | +Pros: |
| 82 | +- More compact data transfer format. |
| 83 | +- Proper data storage on the Squid side (separate values instead of one |
| 84 | +blob). |
| 85 | +- Flexibility for plugin developers via custom delimiters. |
| 86 | +- Eliminates the need for admins to manually manage the -m option for these |
| 87 | +cases. |
| 88 | + |
| 89 | +I am interested in implementing this and submitting a PR. Do you think this |
| 90 | +solution is needed and fits the project's direction? |
| 91 | + |
| 92 | +Kind regards, |
| 93 | + Ankor. |
| 94 | +-------------- next part -------------- |
| 95 | +An HTML attachment was scrubbed... |
| 96 | +URL: <<A HREF="http://lists.squid-cache.org/pipermail/squid-dev/attachments/20260421/18152172/attachment.htm">http://lists.squid-cache.org/pipermail/squid-dev/attachments/20260421/18152172/attachment.htm</A>> |
| 97 | +</PRE> |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +<!--endarticle--> |
| 103 | + <HR> |
| 104 | + <P><UL> |
| 105 | + <!--threads--> |
| 106 | + <LI>Previous message (by thread): <A HREF="010023.html">[squid-dev] NO_SPECIAL_HANDLING define for HTTP methods |
| 107 | +</A></li> |
| 108 | + <LI>Next message (by thread): <A HREF="010029.html">[squid-dev] Proposal: Helper response: concatenated values with custom delimiter |
| 109 | +</A></li> |
| 110 | + <LI> <B>Messages sorted by:</B> |
| 111 | + <a href="date.html#10026">[ date ]</a> |
| 112 | + <a href="thread.html#10026">[ thread ]</a> |
| 113 | + <a href="subject.html#10026">[ subject ]</a> |
| 114 | + <a href="author.html#10026">[ author ]</a> |
| 115 | + </LI> |
| 116 | + </UL> |
| 117 | + |
| 118 | +<hr> |
| 119 | +<a href="https://lists.squid-cache.org/listinfo/squid-dev">More information about the squid-dev |
| 120 | +mailing list</a><br> |
| 121 | +</body></html> |
0 commit comments