Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-24 Thread Henrik Nordström
mån 2010-08-23 klockan 01:17 +1200 skrev Amos Jeffries:

 Updated version of Henriks patch. (why did it not get committed last 
 year when approved?)

Because I forgot?

 * parser bug fixed to handle a list of exactly one parameter without 
 trailing comma (which the original would call bungled).
 
 * special parse case for htcp-oldsquid fully combined with new parser.
 
 * alters the cachemgr config dump to show the new syntax.
 
 Other than parse no operational changes. Fully backward-compatible and 
 tested.

Thanks!

Regards
Henrik



Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-23 Thread Alex Rousskov

On 08/22/2010 07:17 AM, Amos Jeffries wrote:

Henrik Nordstrom wrote:

the list of HTCP mode options had grown a bit too large. Collapse them
all into a single htcp= option taking a list of mode flags.



Updated version of Henriks patch. (why did it not get committed last
year when approved?)

* parser bug fixed to handle a list of exactly one parameter without
trailing comma (which the original would call bungled).

* special parse case for htcp-oldsquid fully combined with new parser.

* alters the cachemgr config dump to show the new syntax.

Other than parse no operational changes. Fully backward-compatible and
tested.


This is not an objection to the patch, but if the various htcp-foo 
options set combine-able flags rather than a single htcp value, then 
please consider using htcp::flag namespace syntax instead of the 
htcp=flag assignment syntax.


Thank you,

Alex.


Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-23 Thread Amos Jeffries
On Mon, 23 Aug 2010 15:28:23 -0600, Alex Rousskov
rouss...@measurement-factory.com wrote:
 On 08/22/2010 07:17 AM, Amos Jeffries wrote:
 Henrik Nordstrom wrote:
 the list of HTCP mode options had grown a bit too large. Collapse them
 all into a single htcp= option taking a list of mode flags.


 Updated version of Henriks patch. (why did it not get committed last
 year when approved?)

 * parser bug fixed to handle a list of exactly one parameter without
 trailing comma (which the original would call bungled).

 * special parse case for htcp-oldsquid fully combined with new parser.

 * alters the cachemgr config dump to show the new syntax.

 Other than parse no operational changes. Fully backward-compatible and
 tested.
 
 This is not an objection to the patch, but if the various htcp-foo 
 options set combine-able flags rather than a single htcp value, then 
 please consider using htcp::flag namespace syntax instead of the 
 htcp=flag assignment syntax.

Some are combinable some are mutually exclusive. They all enable HTCP
communication plus setting additional behaviour modifiers. The basic config
is just an htcp.

The point of this change was to avoid a series of individual flag entries
on the cache_peer line. The possibility of doing multiple behaviour
'assignments' is retained for backward-compatibility but is not exactly
desirable and undocumented to discourage.

ie the syntax meaning of htcp=oldsquid,no-clr is: HTCP on, with oldsquid
behaviour but no CLR requests.

Amos


Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-23 Thread Alex Rousskov

On 08/23/2010 06:36 PM, Amos Jeffries wrote:

On Mon, 23 Aug 2010 15:28:23 -0600, Alex Rousskov
rouss...@measurement-factory.com  wrote:

On 08/22/2010 07:17 AM, Amos Jeffries wrote:

Henrik Nordstrom wrote:

the list of HTCP mode options had grown a bit too large. Collapse them
all into a single htcp= option taking a list of mode flags.



Updated version of Henriks patch. (why did it not get committed last
year when approved?)

* parser bug fixed to handle a list of exactly one parameter without
trailing comma (which the original would call bungled).

* special parse case for htcp-oldsquid fully combined with new parser.

* alters the cachemgr config dump to show the new syntax.

Other than parse no operational changes. Fully backward-compatible and
tested.


This is not an objection to the patch, but if the various htcp-foo
options set combine-able flags rather than a single htcp value, then
please consider using htcp::flag namespace syntax instead of the
htcp=flag assignment syntax.


Some are combinable some are mutually exclusive. They all enable HTCP
communication plus setting additional behaviour modifiers. The basic config
is just an htcp.

The point of this change was to avoid a series of individual flag entries
on the cache_peer line. The possibility of doing multiple behaviour
'assignments' is retained for backward-compatibility but is not exactly
desirable and undocumented to discourage.

ie the syntax meaning of htcp=oldsquid,no-clr is: HTCP on, with oldsquid
behaviour but no CLR requests.


Sounds good. Since values are flags that we do not really assign, you 
could still do htcp::oldsquid,no-clr, but it is not clear to me whether 
that would be really better than assignment.


Thank you,

Alex.



Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-22 Thread Amos Jeffries

Henrik Nordstrom wrote:

the list of HTCP mode options had grown a bit too large. Collapse them
all into a single htcp= option taking a list of mode flags.



Updated version of Henriks patch. (why did it not get committed last 
year when approved?)


* parser bug fixed to handle a list of exactly one parameter without 
trailing comma (which the original would call bungled).


* special parse case for htcp-oldsquid fully combined with new parser.

* alters the cachemgr config dump to show the new syntax.

Other than parse no operational changes. Fully backward-compatible and 
tested.


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.6
  Beta testers wanted for 3.2.0.1
=== modified file 'doc/release-notes/release-3.2.sgml'
--- doc/release-notes/release-3.2.sgml	2010-08-02 13:55:59 +
+++ doc/release-notes/release-3.2.sgml	2010-08-22 11:38:01 +
@@ -373,6 +373,10 @@
 	   emconcurrency=N/em previously called emauth_param ... concurrency/em as a separate option.
 	pRemoved Basic, Digest, NTLM, Negotiate emauth_param ... concurrency/em setting option.
 
+	tagcache_peer/tag
+	pemhtcp-*/em options collapsed into emhtcp=/em taking an optional comma-separated list of flags.
+	   The old form is deprecated but still accepted.
+
 	tagdeny_info/tag
 	pSupport URL format tags. For dynamically generated URL in denial redirect.
 

=== modified file 'src/cache_cf.cc'
--- src/cache_cf.cc	2010-08-15 00:12:43 +
+++ src/cache_cf.cc	2010-08-22 13:06:51 +
@@ -1908,30 +1908,38 @@
 } else if (!strcasecmp(token, weighted-round-robin)) {
 p-options.weighted_roundrobin = 1;
 #if USE_HTCP
-
 } else if (!strcasecmp(token, htcp)) {
 p-options.htcp = 1;
-} else if (!strcasecmp(token, htcp-oldsquid)) {
-p-options.htcp = 1;
-p-options.htcp_oldsquid = 1;
-} else if (!strcasecmp(token, htcp-no-clr)) {
-if (p-options.htcp_only_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_no_clr = 1;
-} else if (!strcasecmp(token, htcp-no-purge-clr)) {
-p-options.htcp = 1;
-p-options.htcp_no_purge_clr = 1;
-} else if (!strcasecmp(token, htcp-only-clr)) {
-if (p-options.htcp_no_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_only_clr = 1;
-} else if (!strcasecmp(token, htcp-forward-clr)) {
-p-options.htcp = 1;
-p-options.htcp_forward_clr = 1;
+} else if (!strncasecmp(token, htcp=, 5) || !strncasecmp(token, htcp-, 5)) {
+/* Note: The htcp- form is deprecated, replaced by htcp= */
+p-options.htcp = 1;
+char *tmp = xstrdup(token+5);
+char *mode, *nextmode;
+for (mode = nextmode = tmp; mode; mode = nextmode) {
+nextmode = strchr(mode, ',');
+		debugs(0,0,HTCP mode '  mode  ' next=  nextmode);
+if (nextmode)
+*nextmode++ = '\0';
+if (!strcasecmp(mode, no-clr)) {
+if (p-options.htcp_only_clr)
+fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
+p-options.htcp_no_clr = 1;
+} else if (!strcasecmp(mode, no-purge-clr)) {
+p-options.htcp_no_purge_clr = 1;
+} else if (!strcasecmp(mode, only-clr)) {
+if (p-options.htcp_no_clr)
+fatalf(parse_peer: can't set htcp no-clr and only-clr simultaneously);
+p-options.htcp_only_clr = 1;
+} else if (!strcasecmp(mode, forward-clr)) {
+p-options.htcp_forward_clr = 1;
+} else if (!strcasecmp(mode, oldsquid)) {
+p-options.htcp_oldsquid = 1;
+} else {
+fatalf(invalid HTCP mode '%s', mode);
+}
+}
+safe_free(tmp);
 #endif
-
 } else if (!strcasecmp(token, no-netdb-exchange)) {
 p-options.no_netdb_exchange = 1;
 

=== modified file 'src/cf.data.pre'
--- src/cf.data.pre	2010-08-14 16:38:27 +
+++ src/cf.data.pre	2010-08-22 11:28:25 +
@@ -1053,7 +1053,7 @@
 
 	NOTE: The default if no htcp_access lines are present is to
 	deny all traffic. This default may cause problems with peers
-	using the htcp or htcp-oldsquid options.
+	using the htcp option.
 
 	This clause only supports fast acl types.
 	See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
@@ -1904,22 +1904,23 @@
 	
 	htcp		Send HTCP, instead of ICP, queries to the neighbor.
 			You probably also want to set the icp-port to 4827
-			instead of 3130.
-	
-	htcp-oldsquid	Send HTCP to old Squid versions.
-	
-	htcp-no-clr	Send HTCP to the neighbor 

Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2009-10-05 Thread Bundle Buggy

Bundle Buggy has detected this merge request.

For details, see: 
http://bundlebuggy.aaronbentley.com/project/squid/request/%3C1253226143.599.1.camel%40localhost.localdomain%3E

Project: Squid


[MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2009-09-17 Thread Henrik Nordstrom
the list of HTCP mode options had grown a bit too large. Collapse them
all into a single htcp= option taking a list of mode flags.

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: hen...@henriknordstrom.net-20090917222032-\
#   nns17iudtio5jovr
# target_branch: http://www.squid-cache.org/bzr/squid3/trunk/
# testament_sha1: 8bd7245c3b25c9acc89a037834f39bc71100b3ea
# timestamp: 2009-09-18 00:21:15 +0200
# base_revision_id: amosjeffr...@squid-cache.org-20090916095346-\
#   m7liji2knguolxxw
# 
# Begin patch
=== modified file 'src/cache_cf.cc'
--- src/cache_cf.cc	2009-09-15 11:59:51 +
+++ src/cache_cf.cc	2009-09-17 22:11:15 +
@@ -1753,30 +1753,41 @@
 } else if (!strcasecmp(token, weighted-round-robin)) {
 p-options.weighted_roundrobin = 1;
 #if USE_HTCP
-
 } else if (!strcasecmp(token, htcp)) {
 p-options.htcp = 1;
 } else if (!strcasecmp(token, htcp-oldsquid)) {
+	/* Note: This form is deprecated, replaced by htcp=oldsquid */
 p-options.htcp = 1;
 p-options.htcp_oldsquid = 1;
-} else if (!strcasecmp(token, htcp-no-clr)) {
-if (p-options.htcp_only_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_no_clr = 1;
-} else if (!strcasecmp(token, htcp-no-purge-clr)) {
-p-options.htcp = 1;
-p-options.htcp_no_purge_clr = 1;
-} else if (!strcasecmp(token, htcp-only-clr)) {
-if (p-options.htcp_no_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_only_clr = 1;
-} else if (!strcasecmp(token, htcp-forward-clr)) {
-p-options.htcp = 1;
-p-options.htcp_forward_clr = 1;
+} else if (!strncasecmp(token, htcp=, 5) || !strncasecmp(token, htcp-, 5)) {
+	/* Note: The htcp- form is deprecated, replaced by htcp= */
+p-options.htcp = 1;
+char *tmp = xstrdup(token+5);
+char *mode, *nextmode;
+for (mode = nextmode = token; mode; mode = nextmode) {
+nextmode = strchr(mode, ',');
+if (nextmode)
+*nextmode++ = '\0';
+if (!strcasecmp(mode, no-clr)) {
+if (p-options.htcp_only_clr)
+fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
+p-options.htcp_no_clr = 1;
+} else if (!strcasecmp(mode, no-purge-clr)) {
+p-options.htcp_no_purge_clr = 1;
+} else if (!strcasecmp(mode, only-clr)) {
+if (p-options.htcp_no_clr)
+fatalf(parse_peer: can't set htcp no-clr and only-clr simultaneously);
+p-options.htcp_only_clr = 1;
+} else if (!strcasecmp(mode, forward-clr)) {
+p-options.htcp_forward_clr = 1;
+		} else if (!strcasecmp(mode, oldsquid)) {
+		p-options.htcp_oldsquid = 1;
+} else {
+fatalf(invalid HTCP mode '%s', mode);
+}
+}
+safe_free(tmp);
 #endif
-
 } else if (!strcasecmp(token, no-netdb-exchange)) {
 p-options.no_netdb_exchange = 1;
 

=== modified file 'src/cf.data.pre'
--- src/cf.data.pre	2009-09-15 23:49:34 +
+++ src/cf.data.pre	2009-09-17 22:20:32 +
@@ -922,7 +922,7 @@
 
 	NOTE: The default if no htcp_access lines are present is to
 	deny all traffic. This default may cause problems with peers
-	using the htcp or htcp-oldsquid options.
+	using the htcp option.
 
 	This clause only supports fast acl types.
 	See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
@@ -1682,22 +1682,23 @@
 	
 	htcp		Send HTCP, instead of ICP, queries to the neighbor.
 			You probably also want to set the icp-port to 4827
-			instead of 3130.
-	
-	htcp-oldsquid	Send HTCP to old Squid versions.
-	
-	htcp-no-clr	Send HTCP to the neighbor but without
+			instead of 3130. This directive accepts a comma separated
+			list of options described below.
+	
+	htcp=oldsquid	Send HTCP to old Squid versions (2.5 or earlier).
+	
+	htcp=no-clr	Send HTCP to the neighbor but without
 			sending any CLR requests.  This cannot be used with
-			htcp-only-clr.
-	
-	htcp-only-clr	Send HTCP to the neighbor but ONLY CLR requests.
-			This cannot be used with htcp-no-clr.
-	
-	htcp-no-purge-clr
+			only-clr.
+	
+	htcp=only-clr	Send HTCP to the neighbor but ONLY CLR requests.
+			This cannot be used with no-clr.
+	
+	htcp=no-purge-clr
 			Send HTCP to the neighbor including CLRs but only when
 			they do not result from PURGE requests.
 	
-	htcp-forward-clr
+	htcp=forward-clr
 			Forward any HTCP CLR requests this proxy receives to the peer.
 	
 	

# Begin bundle

Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2009-09-17 Thread Robert Collins
On Fri, 2009-09-18 at 00:22 +0200, Henrik Nordstrom wrote:
 the list of HTCP mode options had grown a bit too large. Collapse them
 all into a single htcp= option taking a list of mode flags.

Its not clear from the docs whether folk should do
htcp=foo htcp=bar
or
htcp=foo,bar

-Rob


signature.asc
Description: This is a digitally signed message part


Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2009-09-17 Thread Henrik Nordstrom
fre 2009-09-18 klockan 08:28 +1000 skrev Robert Collins:
 On Fri, 2009-09-18 at 00:22 +0200, Henrik Nordstrom wrote:
  the list of HTCP mode options had grown a bit too large. Collapse them
  all into a single htcp= option taking a list of mode flags.
 
 Its not clear from the docs whether folk should do
 htcp=foo htcp=bar
 or
 htcp=foo,bar

both works.

But the documentation do say (after unwinding the patch)

   htcpSend HTCP, instead of ICP, queries to the neighbor.
   You probably also want to set the icp-port to 4827
   instead of 3130. This directive accepts a comma separated
   list of options described below.

Regards
Henrik



Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2009-09-17 Thread Robert Collins
+1 then


signature.asc
Description: This is a digitally signed message part