r5632 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl
tfheen at varnish-cache.org
tfheen at varnish-cache.org
Tue Nov 30 09:33:40 CET 2010
Author: tfheen
Date: 2010-11-30 09:33:40 +0100 (Tue, 30 Nov 2010)
New Revision: 5632
Modified:
branches/2.1/
branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
branches/2.1/varnish-cache/bin/varnishd/vparam.h
branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
branches/2.1/varnish-cache/bin/varnishtest/vtc_varnish.c
branches/2.1/varnish-cache/include/cli_common.h
branches/2.1/varnish-cache/include/vct.h
branches/2.1/varnish-cache/include/vev.h
branches/2.1/varnish-cache/lib/libvarnish/cli_serve.c
branches/2.1/varnish-cache/lib/libvarnish/tcp.c
branches/2.1/varnish-cache/lib/libvarnish/vev.c
branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
Log:
Merge r5588: Add a new feature to the CLI syntax: Bourne-shell like "here" documents.
The last argument to any CLI command can use this feature.
Typical example:
vcl.inline vcl_new << 42
backend foo {...}
sub vcl_recv {...}
42
The advantage is that no escaping is needed, as long as the magic
marker, in this case "42" does not match any line anywhere in the
lines that make up the argument.
Arguments encoded this way are not subject to the "cli_buffer"
parameters size limitation.
Property changes on: branches/2.1
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Modified: branches/2.1/varnish-cache/bin/varnishtest/vtc_varnish.c
===================================================================
--- branches/2.1/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-11-30 08:26:58 UTC (rev 5631)
+++ branches/2.1/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-11-30 08:33:40 UTC (rev 5632)
@@ -82,6 +82,8 @@
char *workdir;
};
+#define NONSENSE "%XJEIFLH|)Xspa8P"
+
static VTAILQ_HEAD(, varnish) varnishes =
VTAILQ_HEAD_INITIALIZER(varnishes);
@@ -119,28 +121,6 @@
return ((enum cli_status_e)retval);
}
-static void
-varnish_cli_encode(struct vsb *vsb, const char *str)
-{
-
- for (; *str != '\0'; str++) {
- switch (*str) {
- case '\\':
- case '"':
- vsb_printf(vsb, "\\%c", *str); break;
- case '\n':
- vsb_printf(vsb, "\\n"); break;
- case '\t':
- vsb_printf(vsb, "\\t"); break;
- default:
- if (isgraph(*str) || *str == ' ')
- vsb_putc(vsb, *str);
- else
- vsb_printf(vsb, "\\x%02x", *str);
- }
- }
-}
-
/**********************************************************************
* Allocate and initialize a varnish
*/
@@ -512,10 +492,8 @@
vsb = vsb_newauto();
AN(vsb);
- v->vcl_nbr++;
- vsb_printf(vsb, "vcl.inline vcl%d \"", v->vcl_nbr);
- varnish_cli_encode(vsb, vcl);
- vsb_printf(vsb, "\"", *vcl);
+ vsb_printf(vsb, "vcl.inline vcl%d << %s\n%s\n%s\n",
+ ++v->vcl_nbr, NONSENSE, vcl, NONSENSE);
vsb_finish(vsb);
AZ(vsb_overflowed(vsb));
@@ -561,14 +539,8 @@
vsb_finish(vsb2);
AZ(vsb_overflowed(vsb2));
- v->vcl_nbr++;
- vsb_printf(vsb, "vcl.inline vcl%d \"", v->vcl_nbr);
-
- varnish_cli_encode(vsb, vsb_data(vsb2));
-
- varnish_cli_encode(vsb, vcl);
-
- vsb_printf(vsb, "\"", *vcl);
+ vsb_printf(vsb, "vcl.inline vcl%d << %s\n%s\n%s\n%s\n",
+ ++v->vcl_nbr, NONSENSE, vsb_data(vsb2), vcl, NONSENSE);
vsb_finish(vsb);
AZ(vsb_overflowed(vsb));
Modified: branches/2.1/varnish-cache/include/cli_common.h
===================================================================
--- branches/2.1/varnish-cache/include/cli_common.h 2010-11-30 08:26:58 UTC (rev 5631)
+++ branches/2.1/varnish-cache/include/cli_common.h 2010-11-30 08:33:40 UTC (rev 5632)
@@ -37,7 +37,7 @@
#define CLI_MAGIC 0x4038d570
struct vsb *sb;
enum cli_status_e result;
- const char *cmd;
+ char *cmd;
unsigned auth;
char challenge[34];
char *ident;
Property changes on: branches/2.1/varnish-cache/include/vct.h
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/include/vev.h
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Modified: branches/2.1/varnish-cache/lib/libvarnish/cli_serve.c
===================================================================
--- branches/2.1/varnish-cache/lib/libvarnish/cli_serve.c 2010-11-30 08:26:58 UTC (rev 5631)
+++ branches/2.1/varnish-cache/lib/libvarnish/cli_serve.c 2010-11-30 08:33:40 UTC (rev 5632)
@@ -68,6 +68,9 @@
struct cli *cli, clis;
cls_cb_f *closefunc;
void *priv;
+ struct vsb *last_arg;
+ int last_idx;
+ char **argv;
};
struct cls {
@@ -234,13 +237,12 @@
*/
static int
-cls_vlu(void *priv, const char *p)
+cls_vlu2(void *priv, char * const *av)
{
struct cls_fd *cfd;
struct cls *cs;
struct cls_func *cfn;
struct cli *cli;
- char * * av;
unsigned na;
CAST_OBJ_NOTNULL(cfd, priv, CLS_FD_MAGIC);
@@ -249,23 +251,10 @@
cli = cfd->cli;
CHECK_OBJ_NOTNULL(cli, CLI_MAGIC);
- AZ(cli->cmd);
+ AN(cli->cmd);
- /*
- * Lines with only whitespace are simply ignored, in order to not
- * complicate CLI-client side scripts and TELNET users
- */
- for (; isspace(*p); p++)
- continue;
- if (*p == '\0')
- return (0);
-
- cli->cmd = p;
cli->cls = cs;
- av = ParseArgv(p, 0);
- AN(av);
-
cli->result = CLIS_UNKNOWN;
vsb_clear(cli->sb);
cli_out(cli, "Unknown request.\nType 'help' for more info.\n");
@@ -306,9 +295,7 @@
if (cs->after != NULL)
cs->after(cli);
- cli->cmd = NULL;
cli->cls = NULL;
- FreeArgv(av);
if (cli_writeres(cfd->fdo, cli) || cli->result == CLIS_CLOSE)
return (1);
@@ -316,6 +303,82 @@
return (0);
}
+static int
+cls_vlu(void *priv, const char *p)
+{
+ struct cls_fd *cfd;
+ struct cli *cli;
+ int i;
+ char **av;
+
+ CAST_OBJ_NOTNULL(cfd, priv, CLS_FD_MAGIC);
+
+ cli = cfd->cli;
+ CHECK_OBJ_NOTNULL(cli, CLI_MAGIC);
+
+ if (cfd->argv == NULL) {
+ /*
+ * Lines with only whitespace are simply ignored, in order
+ * to not complicate CLI-client side scripts and TELNET users
+ */
+ for (; isspace(*p); p++)
+ continue;
+ if (*p == '\0')
+ return (0);
+ REPLACE(cli->cmd, p);
+
+ av = ParseArgv(p, 0);
+ AN(av);
+ if (av[0] != NULL) {
+ i = cls_vlu2(priv, av);
+ FreeArgv(av);
+ free(cli->cmd);
+ cli->cmd = NULL;
+ return (i);
+ }
+ for (i = 1; av[i] != NULL; i++)
+ continue;
+ if (i < 3 || strcmp(av[i - 2], "<<")) {
+ i = cls_vlu2(priv, av);
+ FreeArgv(av);
+ free(cli->cmd);
+ cli->cmd = NULL;
+ return (i);
+ }
+ cfd->argv = av;
+ cfd->last_idx = i - 2;
+ cfd->last_arg = vsb_newauto();
+ AN(cfd->last_arg);
+ return (0);
+ } else {
+ AN(cfd->argv[cfd->last_idx]);
+ assert(!strcmp(cfd->argv[cfd->last_idx], "<<"));
+ AN(cfd->argv[cfd->last_idx + 1]);
+ if (strcmp(p, cfd->argv[cfd->last_idx + 1])) {
+ vsb_cat(cfd->last_arg, p);
+ vsb_cat(cfd->last_arg, "\n");
+ return (0);
+ }
+ vsb_finish(cfd->last_arg);
+ AZ(vsb_overflowed(cfd->last_arg));
+ free(cfd->argv[cfd->last_idx]);
+ cfd->argv[cfd->last_idx] = NULL;
+ free(cfd->argv[cfd->last_idx + 1]);
+ cfd->argv[cfd->last_idx + 1] = NULL;
+ cfd->argv[cfd->last_idx] = vsb_data(cfd->last_arg);
+ i = cls_vlu2(priv, cfd->argv);
+ cfd->argv[cfd->last_idx] = NULL;
+ FreeArgv(cfd->argv);
+ cfd->argv = NULL;
+ free(cli->cmd);
+ cli->cmd = NULL;
+ vsb_delete(cfd->last_arg);
+ cfd->last_arg = NULL;
+ cfd->last_idx = 0;
+ return (i);
+ }
+}
+
struct cls *
CLS_New(cls_cbc_f *before, cls_cbc_f *after, unsigned maxlen)
{
Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580
+ /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4696-4702,4706,4712,4715-4719,4729-4731,4747,4749-4750,4754,4757-4758,4762,4781-4790,4792-4793,4810,4818,4823,4826,4828-4829,4842,4852-4853,4856,4858-4870,4874-4876,4878-4881,4888-4889,4912,4922-4923,4946-4950,4967-4968,4971,4973-4975,4977,4979-4981,4986-4989,4992,4996,5009-5010,5015-5016,5035,5048,5058-5061,5067-5076,5080-5086,5096,5101-5122,5124-5125,5128,5135,5158,5160,5162,5167-5170,5176,5178,5189-5193,5195,5198-5199,5210-5211,5216-5218,5225-5227,5304,5334-5335,5427,5429,5432,5435,5439-5440,5449,5459,5461-5462,5466,5468,5476-5478,5485-5488,5491,5494,5496,5499-5506,5508-5509,5511-5514,5518,5524-5525,5530-5532,5545,5576-5577,5580,5588
More information about the varnish-commit
mailing list