From tfheen at varnish-cache.org Fri Oct 1 07:21:18 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Fri, 1 Oct 2010 09:21:18 +0200 Subject: r5372 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-01 09:21:18 +0200 (Fri, 01 Oct 2010) New Revision: 5372 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/b00030.vtc 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/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 branches/2.1/varnish-cache/lib/libvcl/vcc_string.c Log: Merge r4788: Add missing bits for string version of "now" 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 Modified: branches/2.1/varnish-cache/bin/varnishtest/tests/b00030.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/b00030.vtc 2010-09-30 11:10:07 UTC (rev 5371) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/b00030.vtc 2010-10-01 07:21:18 UTC (rev 5372) @@ -1,4 +1,6 @@ # $Id$ +# We can't test the value of x-timestamp, but this should fail +# if we can't set the header at all. test "Test formatting of timestamps" @@ -11,6 +13,9 @@ sub vcl_recv { error 200 req.grace; } + sub vcl_error { + set obj.http.x-timestamp = now; + } } -start client c1 { 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 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-4787,4789-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 + /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 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_string.c 2010-09-30 11:10:07 UTC (rev 5371) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_string.c 2010-10-01 07:21:18 UTC (rev 5372) @@ -153,6 +153,11 @@ return (vcc_regsub(tl, 0)); if (tl->t->tok == ID && vcc_IdIs(tl->t, "regsuball")) return (vcc_regsub(tl, 1)); + if (tl->t->tok == ID && vcc_IdIs(tl->t, "now")) { + Fb(tl, 0, "VRT_time_string(sp, VRT_r_now(sp))"); + vcc_NextToken(tl); + return 1; + } if (tl->t->tok == VAR) { vp = vcc_FindVar(tl, tl->t, vcc_vars); if (tl->err) From phk at varnish-cache.org Fri Oct 1 07:50:45 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 09:50:45 +0200 Subject: r5373 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 09:50:44 +0200 (Fri, 01 Oct 2010) New Revision: 5373 Modified: trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Nitpicking style etc. Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-01 07:21:18 UTC (rev 5372) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-01 07:50:44 UTC (rev 5373) @@ -1049,6 +1049,8 @@ sp->disable_esi = 0; sp->pass = 0; + sp->hash_always_miss = 0; + sp->hash_ignore_busy = 0; sp->client_identity = NULL; VCL_recv_method(sp); Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 07:21:18 UTC (rev 5372) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 07:50:44 UTC (rev 5373) @@ -709,10 +709,12 @@ VRT_l_req_esi(struct sess *sp, unsigned process_esi) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - /* only allow you to turn of esi in the main request - else everything gets confused */ + /* + * Only allow you to turn of esi in the main request + * else everything gets confused + */ if(sp->esis == 0) - sp->disable_esi = !process_esi; + sp->disable_esi = !process_esi; } unsigned @@ -781,15 +783,17 @@ void VRT_l_req_hash_ignore_busy(struct sess *sp, unsigned ignore_busy) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_ignore_busy = !!ignore_busy; + sp->hash_ignore_busy = ignore_busy; } unsigned VRT_r_req_hash_ignore_busy(struct sess *sp) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return sp->hash_ignore_busy; + return (sp->hash_ignore_busy); } /*-------------------------------------------------------------------- @@ -799,15 +803,17 @@ void VRT_l_req_hash_always_miss(struct sess *sp, unsigned always_miss) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_always_miss = !!always_miss; + sp->hash_always_miss = always_miss; } unsigned VRT_r_req_hash_always_miss(struct sess *sp) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return sp->hash_always_miss; + return (sp->hash_always_miss); } /*--------------------------------------------------------------------*/ From phk at varnish-cache.org Fri Oct 1 08:07:59 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 10:07:59 +0200 Subject: r5374 - in trunk/varnish-cache: bin/varnishd include lib/libvarnish Message-ID: Author: phk Date: 2010-10-01 10:07:58 +0200 (Fri, 01 Oct 2010) New Revision: 5374 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/lib/libvarnish/tcp.c Log: Add a TCP_Port() function and avoid the detour over ascii representation. Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 07:50:44 UTC (rev 5373) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:07:58 UTC (rev 5374) @@ -573,15 +573,10 @@ int VRT_r_beresp_backend_port(const struct sess *sp) { - char abuf[TCP_ADDRBUFSIZE]; - char pbuf[TCP_PORTBUFSIZE]; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); - TCP_name(sp->vbc->addr, sp->vbc->addrlen, - abuf, sizeof abuf, pbuf, sizeof pbuf); - - return (atoi(pbuf)); + return (TCP_port(sp->vbc->addr)); } /*--------------------------------------------------------------------*/ @@ -856,7 +851,7 @@ (void)sp; if (vrt_hostname[0] == '\0') - AZ(gethostname(vrt_hostname, 255)); + AZ(gethostname(vrt_hostname, sizeof(vrt_hostname))); return (vrt_hostname); } @@ -868,15 +863,10 @@ int VRT_r_server_port(struct sess *sp) { - char abuf[TCP_ADDRBUFSIZE]; - char pbuf[TCP_PORTBUFSIZE]; if (sp->mysockaddr->sa_family == AF_UNSPEC) AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen)); - TCP_name(sp->mysockaddr, sp->mysockaddrlen, - abuf, sizeof abuf, pbuf, sizeof pbuf); - - return (atoi(pbuf)); + return (TCP_port(sp->mysockaddr)); } /*-------------------------------------------------------------------- Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2010-10-01 07:50:44 UTC (rev 5373) +++ trunk/varnish-cache/include/libvarnish.h 2010-10-01 08:07:58 UTC (rev 5374) @@ -76,6 +76,7 @@ int TCP_nonblocking(int sock); int TCP_linger(int sock, int linger); #ifdef SOL_SOCKET +int TCP_port(const struct sockaddr *addr); void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen); int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, Modified: trunk/varnish-cache/lib/libvarnish/tcp.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/tcp.c 2010-10-01 07:50:44 UTC (rev 5373) +++ trunk/varnish-cache/lib/libvarnish/tcp.c 2010-10-01 08:07:58 UTC (rev 5374) @@ -63,6 +63,24 @@ /*--------------------------------------------------------------------*/ +int +TCP_port(const struct sockaddr *addr) +{ + + if (addr->sa_family == AF_INET) { + const struct sockaddr_in *ain = (const void *)addr; + return ntohs((ain->sin_port)); + } + if (addr->sa_family == AF_INET6) { + const struct sockaddr_in6 *ain = (const void *)addr; + return ntohs((ain->sin6_port)); + } + return (-1); +} + + +/*--------------------------------------------------------------------*/ + void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen) From phk at varnish-cache.org Fri Oct 1 08:29:36 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 10:29:36 +0200 Subject: r5375 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 10:29:36 +0200 (Fri, 01 Oct 2010) New Revision: 5375 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Nitpicking Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:07:58 UTC (rev 5374) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:29:36 UTC (rev 5375) @@ -403,7 +403,7 @@ /*--------------------------------------------------------------------*/ -#define VBEREQ(dir, type, onm, field) \ +#define VBERESP(dir, type, onm, field) \ void \ VRT_l_##dir##_##onm(const struct sess *sp, type a) \ { \ @@ -418,8 +418,8 @@ return (sp->wrk->field); \ } -VBEREQ(beresp, unsigned, cacheable, cacheable) -VBEREQ(beresp, double, grace, grace) +VBERESP(beresp, unsigned, cacheable, cacheable) +VBERESP(beresp, double, grace, grace) /*--------------------------------------------------------------------*/ From phk at varnish-cache.org Fri Oct 1 08:50:43 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 10:50:43 +0200 Subject: r5376 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 10:50:43 +0200 (Fri, 01 Oct 2010) New Revision: 5376 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_http.c trunk/varnish-cache/bin/varnishd/cache_response.c trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Isolate the text-representation of the HTTP response status field in http_cache.h, and use the integer representation everywhere else. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2010-10-01 08:29:36 UTC (rev 5375) +++ trunk/varnish-cache/bin/varnishd/cache.h 2010-10-01 08:50:43 UTC (rev 5376) @@ -65,6 +65,11 @@ #include "vsc.h" #include "vsl.h" +/* + * NB: HDR_STATUS is only used in cache_http.c, everybody else uses the + * http->status integer field. + */ + enum { /* Fields from the first line of HTTP proto */ HTTP_HDR_REQ, @@ -551,15 +556,15 @@ void HTTP_Init(void); void http_ClrHeader(struct http *to); unsigned http_Write(struct worker *w, const struct http *hp, int resp); -void http_CopyResp(const struct http *to, const struct http *fm); -void http_SetResp(const struct http *to, const char *proto, const char *status, +void http_CopyResp(struct http *to, const struct http *fm); +void http_SetResp(struct http *to, const char *proto, int status, const char *response); void http_FilterFields(struct worker *w, int fd, struct http *to, const struct http *fm, unsigned how); void http_FilterHeader(const struct sess *sp, unsigned how); void http_PutProtocol(struct worker *w, int fd, const struct http *to, const char *protocol); -void http_PutStatus(struct worker *w, int fd, struct http *to, int status); +void http_PutStatus(struct http *to, int status); void http_PutResponse(struct worker *w, int fd, const struct http *to, const char *response); void http_PrintfHeader(struct worker *w, int fd, struct http *to, Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-01 08:29:36 UTC (rev 5375) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-01 08:50:43 UTC (rev 5376) @@ -354,7 +354,7 @@ sp->err_code = 501; http_PutProtocol(w, sp->fd, h, "HTTP/1.1"); - http_PutStatus(w, sp->fd, h, sp->err_code); + http_PutStatus(h, sp->err_code); TIM_format(TIM_real(), date); http_PrintfHeader(w, sp->fd, h, "Date: %s", date); http_PrintfHeader(w, sp->fd, h, "Server: Varnish"); Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2010-10-01 08:29:36 UTC (rev 5375) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2010-10-01 08:50:43 UTC (rev 5376) @@ -337,7 +337,6 @@ http_GetStatus(const struct http *hp) { - Tcheck(hp->hd[HTTP_HDR_STATUS]); return (hp->status); } @@ -615,24 +614,24 @@ } void -http_CopyResp(const struct http *to, const struct http *fm) +http_CopyResp(struct http *to, const struct http *fm) { CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC); CHECK_OBJ_NOTNULL(to, HTTP_MAGIC); http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1"); - http_copyh(to, fm, HTTP_HDR_STATUS); + to->status = fm->status; http_copyh(to, fm, HTTP_HDR_RESPONSE); } void -http_SetResp(const struct http *to, const char *proto, const char *status, +http_SetResp(struct http *to, const char *proto, int status, const char *response) { CHECK_OBJ_NOTNULL(to, HTTP_MAGIC); http_SetH(to, HTTP_HDR_PROTO, proto); - http_SetH(to, HTTP_HDR_STATUS, status); + to->status = status; http_SetH(to, HTTP_HDR_RESPONSE, response); } @@ -828,13 +827,10 @@ } void -http_PutStatus(struct worker *w, int fd, struct http *to, int status) +http_PutStatus(struct http *to, int status) { - char stat[4]; assert(status >= 0 && status <= 999); - sprintf(stat, "%d", status); - http_PutField(w, fd, to, HTTP_HDR_STATUS, stat); to->status = status; } @@ -915,11 +911,18 @@ unsigned u, l; if (resp) { - AN(hp->hd[HTTP_HDR_STATUS].b); l = WRW_WriteH(w, &hp->hd[HTTP_HDR_PROTO], " "); WSLH(w, *w->wfd, hp, HTTP_HDR_PROTO); + + hp->hd[HTTP_HDR_STATUS].b = WS_Alloc(w->ws, 4); + AN(hp->hd[HTTP_HDR_STATUS].b); + + sprintf(hp->hd[HTTP_HDR_STATUS].b, "%3d", hp->status); + hp->hd[HTTP_HDR_STATUS].e = hp->hd[HTTP_HDR_STATUS].b + 3; + l += WRW_WriteH(w, &hp->hd[HTTP_HDR_STATUS], " "); WSLH(w, *w->wfd, hp, HTTP_HDR_STATUS); + l += WRW_WriteH(w, &hp->hd[HTTP_HDR_RESPONSE], "\r\n"); WSLH(w, *w->wfd, hp, HTTP_HDR_RESPONSE); } else { Modified: trunk/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_response.c 2010-10-01 08:29:36 UTC (rev 5375) +++ trunk/varnish-cache/bin/varnishd/cache_response.c 2010-10-01 08:50:43 UTC (rev 5376) @@ -51,7 +51,7 @@ http_ClrHeader(sp->wrk->resp); sp->wrk->resp->logtag = HTTP_Tx; - http_SetResp(sp->wrk->resp, "HTTP/1.1", "304", "Not Modified"); + http_SetResp(sp->wrk->resp, "HTTP/1.1", 304, "Not Modified"); TIM_format(sp->t_req, lm); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Date: %s", lm); http_SetHeader(sp->wrk, sp->fd, sp->wrk->resp, "Via: 1.1 varnish"); @@ -181,7 +181,7 @@ http_Unset(sp->wrk->resp, H_Content_Length); http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Content-Length: %u", 1 + high - low); - http_SetResp(sp->wrk->resp, "HTTP/1.1", "206", "Partial Content"); + http_SetResp(sp->wrk->resp, "HTTP/1.1", 206, "Partial Content"); *plow = low; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:29:36 UTC (rev 5375) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:50:43 UTC (rev 5376) @@ -298,15 +298,8 @@ void VRT_l_obj_status(const struct sess *sp, int num) { - char *p; assert(num >= 100 && num <= 999); - p = WS_Alloc(sp->obj->http->ws, 4); - if (p == NULL) - WSP(sp, SLT_LostHeader, "%s", "obj.status"); - else - sprintf(p, "%d", num); - http_SetH(sp->obj->http, HTTP_HDR_STATUS, p); sp->obj->http->status = num; } @@ -367,38 +360,27 @@ int VRT_r_obj_status(const struct sess *sp) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - /* XXX: use http_GetStatus() */ - if (sp->obj->http->status) - return (sp->obj->http->status); - AN(sp->obj->http->hd[HTTP_HDR_STATUS].b); - return (atoi(sp->obj->http->hd[HTTP_HDR_STATUS].b)); + return (sp->obj->http->status); } void VRT_l_resp_status(const struct sess *sp, int num) { - char *p; assert(num >= 100 && num <= 999); - p = WS_Alloc(sp->wrk->ws, 4); - if (p == NULL) - WSP(sp, SLT_LostHeader, "%s", "resp.status"); - else - sprintf(p, "%d", num); - http_SetH(sp->wrk->resp, HTTP_HDR_STATUS, p); sp->wrk->resp->status = num; } int VRT_r_resp_status(const struct sess *sp) { + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk->resp, HTTP_MAGIC); - if (sp->wrk->resp->status) - return (sp->wrk->resp->status); - return (atoi(sp->wrk->resp->hd[HTTP_HDR_STATUS].b)); + return (sp->wrk->resp->status); } /*--------------------------------------------------------------------*/ @@ -484,15 +466,8 @@ void VRT_l_beresp_status(const struct sess *sp, int num) { - char *p; assert(num >= 100 && num <= 999); - p = WS_Alloc(sp->wrk->beresp->ws, 4); - if (p == NULL) - WSP(sp, SLT_LostHeader, "%s", "obj.status"); - else - sprintf(p, "%d", num); - http_SetH(sp->wrk->beresp, HTTP_HDR_STATUS, p); sp->wrk->beresp->status = num; } @@ -500,11 +475,7 @@ VRT_r_beresp_status(const struct sess *sp) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - /* XXX: use http_GetStatus() */ - if (sp->wrk->beresp->status) - return (sp->wrk->beresp->status); - AN(sp->wrk->beresp->hd[HTTP_HDR_STATUS].b); - return (atoi(sp->wrk->beresp->hd[HTTP_HDR_STATUS].b)); + return (sp->wrk->beresp->status); } @@ -780,7 +751,7 @@ { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_ignore_busy = ignore_busy; + sp->hash_ignore_busy = ignore_busy ? 1 : 0; } unsigned @@ -800,7 +771,7 @@ { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_always_miss = always_miss; + sp->hash_always_miss = always_miss ? 1 : 0; } unsigned From phk at varnish-cache.org Fri Oct 1 09:00:09 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 11:00:09 +0200 Subject: r5377 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 11:00:08 +0200 (Fri, 01 Oct 2010) New Revision: 5377 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Unify/macroize handling of http->status fields Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 08:50:43 UTC (rev 5376) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 09:00:08 UTC (rev 5377) @@ -293,16 +293,30 @@ /*--------------------------------------------------------------------*/ -/* XXX: review this */ +#define VRT_DO_STATUS(obj, http) \ +void \ +VRT_l_##obj##_status(const struct sess *sp, int num) \ +{ \ + \ + assert(num >= 100 && num <= 999); \ + http->status = num; \ +} \ + \ +int \ +VRT_r_##obj##_status(const struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(http->status); \ +} -void -VRT_l_obj_status(const struct sess *sp, int num) -{ +VRT_DO_STATUS(obj, sp->obj->http); +VRT_DO_STATUS(beresp, sp->wrk->beresp); +VRT_DO_STATUS(resp, sp->wrk->resp); - assert(num >= 100 && num <= 999); - sp->obj->http->status = num; -} +/*--------------------------------------------------------------------*/ +/* XXX: review this */ /* Add an objecthead to the saintmode list for the (hopefully) relevant * backend. Some double-up asserting here to avoid assert-errors when there * is no object. @@ -356,33 +370,6 @@ Lck_Unlock(&sp->vbc->backend->mtx); } - -int -VRT_r_obj_status(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - return (sp->obj->http->status); -} - -void -VRT_l_resp_status(const struct sess *sp, int num) -{ - - assert(num >= 100 && num <= 999); - sp->wrk->resp->status = num; -} - -int -VRT_r_resp_status(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->wrk->resp, HTTP_MAGIC); - return (sp->wrk->resp->status); -} - /*--------------------------------------------------------------------*/ #define VBERESP(dir, type, onm, field) \ @@ -463,22 +450,7 @@ return (sp->wrk->ttl - sp->t_req); } -void -VRT_l_beresp_status(const struct sess *sp, int num) -{ - assert(num >= 100 && num <= 999); - sp->wrk->beresp->status = num; -} - -int -VRT_r_beresp_status(const struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->wrk->beresp->status); -} - - void VRT_l_bereq_connect_timeout(struct sess *sp, double num) { From phk at varnish-cache.org Fri Oct 1 09:07:42 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 11:07:42 +0200 Subject: r5378 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 11:07:42 +0200 (Fri, 01 Oct 2010) New Revision: 5378 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Unify/Macroize bereq timeout fields Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 09:00:08 UTC (rev 5377) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 09:07:42 UTC (rev 5378) @@ -450,49 +450,29 @@ return (sp->wrk->ttl - sp->t_req); } +/*--------------------------------------------------------------------*/ -void -VRT_l_bereq_connect_timeout(struct sess *sp, double num) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->wrk->connect_timeout = (num > 0 ? num : 0); +#define BEREQ_TIMEOUT(which) \ +void \ +VRT_l_bereq_##which(struct sess *sp, double num) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + sp->wrk->which = (num > 0.0 ? num : 0.0); \ +} \ + \ +double \ +VRT_r_bereq_##which(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(sp->wrk->which); \ } -double -VRT_r_bereq_connect_timeout(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->wrk->connect_timeout); -} +BEREQ_TIMEOUT(connect_timeout) +BEREQ_TIMEOUT(first_byte_timeout) +BEREQ_TIMEOUT(between_bytes_timeout) -void -VRT_l_bereq_first_byte_timeout(struct sess *sp, double num) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->wrk->first_byte_timeout = (num > 0 ? num : 0); -} - -double -VRT_r_bereq_first_byte_timeout(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->wrk->first_byte_timeout); -} - -void -VRT_l_bereq_between_bytes_timeout(struct sess *sp, double num) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->wrk->between_bytes_timeout = (num > 0 ? num : 0); -} - -double -VRT_r_bereq_between_bytes_timeout(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->wrk->between_bytes_timeout); -} - /*--------------------------------------------------------------------*/ const char * From phk at varnish-cache.org Fri Oct 1 09:26:54 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 11:26:54 +0200 Subject: r5379 - in trunk/varnish-cache: bin/varnishd lib/libvcl Message-ID: Author: phk Date: 2010-10-01 11:26:53 +0200 (Fri, 01 Oct 2010) New Revision: 5379 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/lib/libvcl/generate.py Log: More unification/macroization of VRT functions: req.${boolean} and *.grace Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 09:07:42 UTC (rev 5378) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 09:26:53 UTC (rev 5379) @@ -388,7 +388,6 @@ } VBERESP(beresp, unsigned, cacheable, cacheable) -VBERESP(beresp, double, grace, grace) /*--------------------------------------------------------------------*/ @@ -557,32 +556,7 @@ return (sp->obj->ttl - sp->t_req); } -/*-------------------------------------------------------------------- - * obj.grace is relative to obj.ttl, so no special magic is necessary. - */ -void -VRT_l_obj_grace(const struct sess *sp, double a) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - if (a < 0) - a = 0; - sp->obj->grace = a; - EXP_Rearm(sp->obj); -} - -double -VRT_r_obj_grace(const struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - if (isnan(sp->obj->grace)) - return ((double)params->default_grace); - return (sp->obj->grace); -} - /*--------------------------------------------------------------------*/ #define VOBJ(type,onm,field) \ @@ -652,29 +626,31 @@ return (sp->restarts); } -/*-------------------------------------------------------------------- - * req.grace - */ +/*--------------------------------------------------------------------*/ -void -VRT_l_req_grace(struct sess *sp, double a) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - if (a < 0) - a = 0; - sp->grace = a; +#define VRT_DO_GRACE(which, fld, extra) \ +void \ +VRT_l_##which##_grace(struct sess *sp, double a) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + fld = a >= 0.0 ? a : NAN; \ + extra; \ +} \ + \ +double \ +VRT_r_##which##_grace(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + if (isnan(fld)) \ + return ((double)params->default_grace); \ + return(fld); \ } -/*lint -e{818} sp could be const */ -double -VRT_r_req_grace(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - if (isnan(sp->grace)) - return ((double)params->default_grace); - return (sp->grace); -} +VRT_DO_GRACE(req, sp->grace, ) +VRT_DO_GRACE(obj, sp->obj->grace, EXP_Rearm(sp->obj)) +VRT_DO_GRACE(beresp, sp->wrk->grace, ) /*-------------------------------------------------------------------- * req.xid @@ -694,46 +670,28 @@ return (p); } -/*-------------------------------------------------------------------- - * req.hash_ignore_busy - */ +/*--------------------------------------------------------------------*/ -void -VRT_l_req_hash_ignore_busy(struct sess *sp, unsigned ignore_busy) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_ignore_busy = ignore_busy ? 1 : 0; +#define REQ_BOOL(which) \ +void \ +VRT_l_req_##which(struct sess *sp, unsigned val) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + sp->which = val ? 1 : 0; \ +} \ + \ +unsigned \ +VRT_r_req_##which(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(sp->which); \ } -unsigned -VRT_r_req_hash_ignore_busy(struct sess *sp) -{ +REQ_BOOL(hash_ignore_busy) +REQ_BOOL(hash_always_miss) - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->hash_ignore_busy); -} - -/*-------------------------------------------------------------------- - * req.hash_always_miss - */ - -void -VRT_l_req_hash_always_miss(struct sess *sp, unsigned always_miss) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->hash_always_miss = always_miss ? 1 : 0; -} - -unsigned -VRT_r_req_hash_always_miss(struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->hash_always_miss); -} - /*--------------------------------------------------------------------*/ struct sockaddr * Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-10-01 09:07:42 UTC (rev 5378) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-10-01 09:26:53 UTC (rev 5379) @@ -296,7 +296,7 @@ 'DURATION', ( 'fetch',), ( 'fetch',), - 'const struct sess *' + 'struct sess *' ), ('beresp.backend.name', 'STRING', @@ -362,7 +362,7 @@ 'DURATION', ( 'hit', 'error',), ( 'hit', 'error',), - 'const struct sess *' + 'struct sess *' ), ('obj.lastuse', 'DURATION', From phk at varnish-cache.org Fri Oct 1 10:01:31 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 12:01:31 +0200 Subject: r5380 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-01 12:01:30 +0200 (Fri, 01 Oct 2010) New Revision: 5380 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try to improve timing resistance without resorting to delays yet. Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-01 09:26:53 UTC (rev 5379) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-01 10:01:30 UTC (rev 5380) @@ -40,16 +40,16 @@ client c1 -run -varnish v1 -expect vmods == 1 varnish v1 -cliok "debug.vmod" varnish v1 -cliok "vcl.list" + +varnish v1 -expect vmods == 1 + varnish v1 -cliok "vcl.discard vcl1" varnish v1 -cliok "vcl.list" varnish v1 -cliok "debug.vmod" -varnish v1 -expect vmods == 0 - varnish v1 -badvcl { import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; @@ -64,3 +64,6 @@ } } +varnish v1 -expect vmods == 0 + + From phk at varnish-cache.org Fri Oct 1 10:02:54 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 12:02:54 +0200 Subject: r5381 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: Author: phk Date: 2010-10-01 12:02:54 +0200 (Fri, 01 Oct 2010) New Revision: 5381 Added: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c Modified: trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Split vrt functions for variables into a separate source file Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-01 10:01:30 UTC (rev 5380) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-01 10:02:54 UTC (rev 5381) @@ -42,6 +42,7 @@ cache_vcl.c \ cache_vrt.c \ cache_vrt_re.c \ + cache_vrt_var.c \ cache_vrt_vmod.c \ cache_wrw.c \ cache_ws.c \ Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2010-10-01 10:01:30 UTC (rev 5380) +++ trunk/varnish-cache/bin/varnishd/cache.h 2010-10-01 10:02:54 UTC (rev 5381) @@ -43,6 +43,7 @@ #ifdef HAVE_PTHREAD_NP_H #include #endif +#include #include #include #include @@ -708,6 +709,10 @@ #include "vcl_returns.h" #undef VCL_MET_MAC +/* cache_vrt.c */ + +char *VRT_String(struct ws *ws, const char *h, const char *p, va_list ap); + /* cache_vrt_esi.c */ void ESI_Deliver(struct sess *); Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 10:01:30 UTC (rev 5380) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-01 10:02:54 UTC (rev 5381) @@ -57,7 +57,6 @@ /*lint -save -esym(818,sp) */ const void * const vrt_magic_string_end = &vrt_magic_string_end; -static char vrt_hostname[255] = ""; /*--------------------------------------------------------------------*/ @@ -142,8 +141,8 @@ */ /*lint -e{818} ap,hp could be const */ -static char * -vrt_build_string(struct ws *ws, const char *h, const char *p, va_list ap) +char * +VRT_String(struct ws *ws, const char *h, const char *p, va_list ap) { char *b, *e; unsigned u, x; @@ -192,7 +191,7 @@ vrt_assemble_string(struct http *hp, const char *h, const char *p, va_list ap) { - return (vrt_build_string(hp->ws, h, p, ap)); + return (VRT_String(hp->ws, h, p, ap)); } /*-------------------------------------------------------------------- @@ -200,14 +199,14 @@ */ const char * -VRT_String(const struct sess *sp, const char *p, ...) +VRT_WrkString(const struct sess *sp, const char *p, ...) { va_list ap; char *b; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); va_start(ap, p); - b = vrt_build_string(sp->wrk->ws, NULL, p, ap); + b = VRT_String(sp->wrk->ws, NULL, p, ap); va_end(ap); return (b); } @@ -241,269 +240,7 @@ /*--------------------------------------------------------------------*/ -static void -vrt_do_string(struct worker *w, int fd, struct http *hp, int fld, - const char *err, const char *p, va_list ap) -{ - char *b; - - // AN(p); - AN(hp); - b = vrt_assemble_string(hp, NULL, p, ap); - if (b == NULL || *b == '\0') { - WSL(w, SLT_LostHeader, fd, err); - } else { - http_SetH(hp, fld, b); - } - va_end(ap); -} - -#define VRT_DO_HDR(obj, hdr, http, fld) \ -void \ -VRT_l_##obj##_##hdr(const struct sess *sp, const char *p, ...) \ -{ \ - va_list ap; \ - \ - va_start(ap, p); \ - vrt_do_string(sp->wrk, sp->fd, \ - http, fld, #obj "." #hdr, p, ap); \ - va_end(ap); \ -} \ - \ -const char * \ -VRT_r_##obj##_##hdr(const struct sess *sp) \ -{ \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - CHECK_OBJ_NOTNULL(http, HTTP_MAGIC); \ - return (http->hd[fld].b); \ -} - -VRT_DO_HDR(req, request, sp->http, HTTP_HDR_REQ) -VRT_DO_HDR(req, url, sp->http, HTTP_HDR_URL) -VRT_DO_HDR(req, proto, sp->http, HTTP_HDR_PROTO) -VRT_DO_HDR(bereq, request, sp->wrk->bereq, HTTP_HDR_REQ) -VRT_DO_HDR(bereq, url, sp->wrk->bereq, HTTP_HDR_URL) -VRT_DO_HDR(bereq, proto, sp->wrk->bereq, HTTP_HDR_PROTO) -VRT_DO_HDR(obj, proto, sp->obj->http, HTTP_HDR_PROTO) -VRT_DO_HDR(obj, response, sp->obj->http, HTTP_HDR_RESPONSE) -VRT_DO_HDR(resp, proto, sp->wrk->resp, HTTP_HDR_PROTO) -VRT_DO_HDR(resp, response, sp->wrk->resp, HTTP_HDR_RESPONSE) -VRT_DO_HDR(beresp, proto, sp->wrk->beresp, HTTP_HDR_PROTO) -VRT_DO_HDR(beresp, response, sp->wrk->beresp, HTTP_HDR_RESPONSE) - -/*--------------------------------------------------------------------*/ - -#define VRT_DO_STATUS(obj, http) \ -void \ -VRT_l_##obj##_status(const struct sess *sp, int num) \ -{ \ - \ - assert(num >= 100 && num <= 999); \ - http->status = num; \ -} \ - \ -int \ -VRT_r_##obj##_status(const struct sess *sp) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - return(http->status); \ -} - -VRT_DO_STATUS(obj, sp->obj->http); -VRT_DO_STATUS(beresp, sp->wrk->beresp); -VRT_DO_STATUS(resp, sp->wrk->resp); - -/*--------------------------------------------------------------------*/ - -/* XXX: review this */ -/* Add an objecthead to the saintmode list for the (hopefully) relevant - * backend. Some double-up asserting here to avoid assert-errors when there - * is no object. - */ void -VRT_l_beresp_saintmode(const struct sess *sp, double a) -{ - struct trouble *new; - struct trouble *tr; - struct trouble *tr2; - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - if (!sp->vbc) - return; - CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); - if (!sp->vbc->backend) - return; - CHECK_OBJ_NOTNULL(sp->vbc->backend, BACKEND_MAGIC); - if (!sp->objhead) - return; - CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC); - - /* Setting a negative holdoff period is a mistake. Detecting this - * when compiling the VCL would be better. - */ - assert(a > 0); - - ALLOC_OBJ(new, TROUBLE_MAGIC); - AN(new); - new->target = (uintptr_t)sp->objhead; - new->timeout = sp->t_req + a; - - /* Insert the new item on the list before the first item with a - * timeout at a later date (ie: sort by which entry will time out - * from the list - */ - Lck_Lock(&sp->vbc->backend->mtx); - VTAILQ_FOREACH_SAFE(tr, &sp->vbc->backend->troublelist, list, tr2) { - if (tr->timeout < new->timeout) { - VTAILQ_INSERT_BEFORE(tr, new, list); - new = NULL; - break; - } - } - - /* Insert the item at the end if the list is empty or all other - * items have a longer timeout. - */ - if (new) - VTAILQ_INSERT_TAIL(&sp->vbc->backend->troublelist, new, list); - - Lck_Unlock(&sp->vbc->backend->mtx); -} -/*--------------------------------------------------------------------*/ - -#define VBERESP(dir, type, onm, field) \ -void \ -VRT_l_##dir##_##onm(const struct sess *sp, type a) \ -{ \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - sp->wrk->field = a; \ -} \ - \ -type \ -VRT_r_##dir##_##onm(const struct sess *sp) \ -{ \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - return (sp->wrk->field); \ -} - -VBERESP(beresp, unsigned, cacheable, cacheable) - -/*--------------------------------------------------------------------*/ - -const char * -VRT_r_client_identity(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - if (sp->client_identity != NULL) - return (sp->client_identity); - else - return (sp->addr); -} - -void -VRT_l_client_identity(struct sess *sp, const char *str, ...) -{ - va_list ap; - char *b; - - va_start(ap, str); - b = vrt_assemble_string(sp->http, NULL, str, ap); - va_end(ap); - sp->client_identity = b; -} - -/*-------------------------------------------------------------------- - * XXX: Working relative to t_req is maybe not the right thing, we could - * XXX: have spent a long time talking to the backend since then. - * XXX: It might make sense to cache a timestamp as "current time" - * XXX: before vcl_recv (== t_req) and vcl_fetch. - * XXX: On the other hand, that might lead to inconsistent behaviour - * XXX: where an object expires while we are running VCL code, and - * XXX: and that may not be a good idea either. - * XXX: See also related t_req use in cache_hash.c - */ - -void -VRT_l_beresp_ttl(const struct sess *sp, double a) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", sp->xid, a, sp->t_req); - /* - * If people set obj.ttl = 0s, they don't expect it to be cacheable - * any longer, but it will still be for up to 1s - epsilon because - * of the rounding to seconds. - * We special case and make sure that rounding does not surprise. - */ - if (a <= 0) - sp->wrk->ttl = sp->t_req - 1; - else - sp->wrk->ttl = sp->t_req + a; -} - -double -VRT_r_beresp_ttl(const struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->wrk->ttl - sp->t_req); -} - -/*--------------------------------------------------------------------*/ - -#define BEREQ_TIMEOUT(which) \ -void \ -VRT_l_bereq_##which(struct sess *sp, double num) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - sp->wrk->which = (num > 0.0 ? num : 0.0); \ -} \ - \ -double \ -VRT_r_bereq_##which(struct sess *sp) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - return(sp->wrk->which); \ -} - -BEREQ_TIMEOUT(connect_timeout) -BEREQ_TIMEOUT(first_byte_timeout) -BEREQ_TIMEOUT(between_bytes_timeout) - -/*--------------------------------------------------------------------*/ - -const char * -VRT_r_beresp_backend_name(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); - return(sp->vbc->backend->vcl_name); -} - -struct sockaddr * -VRT_r_beresp_backend_ip(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); - return(sp->vbc->addr); -} - -int -VRT_r_beresp_backend_port(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); - return (TCP_port(sp->vbc->addr)); -} - -/*--------------------------------------------------------------------*/ - -void VRT_handling(struct sess *sp, unsigned hand) { @@ -513,244 +250,6 @@ } /*-------------------------------------------------------------------- - * XXX: Working relative to t_req is maybe not the right thing, we could - * XXX: have spent a long time talking to the backend since then. - * XXX: It might make sense to cache a timestamp as "current time" - * XXX: before vcl_recv (== t_req) and vcl_fetch. - * XXX: On the other hand, that might lead to inconsistent behaviour - * XXX: where an object expires while we are running VCL code, and - * XXX: and that may not be a good idea either. - * XXX: See also related t_req use in cache_hash.c - */ - -void -VRT_l_obj_ttl(const struct sess *sp, double a) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - if (sp->obj->objcore == NULL) - return; - WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", - sp->obj->xid, a, sp->t_req); - /* - * If people set obj.ttl = 0s, they don't expect it to be cacheable - * any longer, but it will still be for up to 1s - epsilon because - * of the rounding to seconds. - * We special case and make sure that rounding does not surprise. - */ - if (a <= 0) - sp->obj->ttl = sp->t_req - 1; - else - sp->obj->ttl = sp->t_req + a; - EXP_Rearm(sp->obj); -} - -double -VRT_r_obj_ttl(const struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - if (sp->obj->objcore == NULL) - return (0.0); - return (sp->obj->ttl - sp->t_req); -} - - -/*--------------------------------------------------------------------*/ - -#define VOBJ(type,onm,field) \ -void \ -VRT_l_obj_##onm(const struct sess *sp, type a) \ -{ \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \ - sp->obj->field = a; \ -} \ - \ -type \ -VRT_r_obj_##onm(const struct sess *sp) \ -{ \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \ - return (sp->obj->field); \ -} - -VOBJ(unsigned, cacheable, cacheable) - -/*--------------------------------------------------------------------*/ - -void -VRT_l_req_backend(struct sess *sp, struct director *be) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - sp->director = be; -} - -/*lint -e{818} sp could be const */ -struct director * -VRT_r_req_backend(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->director); -} - -/*--------------------------------------------------------------------*/ - -void -VRT_l_req_esi(struct sess *sp, unsigned process_esi) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - /* - * Only allow you to turn of esi in the main request - * else everything gets confused - */ - if(sp->esis == 0) - sp->disable_esi = !process_esi; -} - -unsigned -VRT_r_req_esi(struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (!sp->disable_esi); -} - -/*--------------------------------------------------------------------*/ - -int -VRT_r_req_restarts(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - return (sp->restarts); -} - -/*--------------------------------------------------------------------*/ - -#define VRT_DO_GRACE(which, fld, extra) \ -void \ -VRT_l_##which##_grace(struct sess *sp, double a) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - fld = a >= 0.0 ? a : NAN; \ - extra; \ -} \ - \ -double \ -VRT_r_##which##_grace(struct sess *sp) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - if (isnan(fld)) \ - return ((double)params->default_grace); \ - return(fld); \ -} - -VRT_DO_GRACE(req, sp->grace, ) -VRT_DO_GRACE(obj, sp->obj->grace, EXP_Rearm(sp->obj)) -VRT_DO_GRACE(beresp, sp->wrk->grace, ) - -/*-------------------------------------------------------------------- - * req.xid - */ - -/*lint -e{818} sp could be const */ -const char * -VRT_r_req_xid(struct sess *sp) -{ - char *p; - int size; - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - - size = snprintf(NULL, 0, "%u", sp->xid) + 1; - AN(p = WS_Alloc(sp->http->ws, size)); - assert(snprintf(p, size, "%u", sp->xid) < size); - return (p); -} - -/*--------------------------------------------------------------------*/ - -#define REQ_BOOL(which) \ -void \ -VRT_l_req_##which(struct sess *sp, unsigned val) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - sp->which = val ? 1 : 0; \ -} \ - \ -unsigned \ -VRT_r_req_##which(struct sess *sp) \ -{ \ - \ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ - return(sp->which); \ -} - -REQ_BOOL(hash_ignore_busy) -REQ_BOOL(hash_always_miss) - -/*--------------------------------------------------------------------*/ - -struct sockaddr * -VRT_r_client_ip(const struct sess *sp) -{ - - return (sp->sockaddr); -} - -struct sockaddr * -VRT_r_server_ip(struct sess *sp) -{ - int i; - - if (sp->mysockaddr->sa_family == AF_UNSPEC) { - i = getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen); - assert(TCP_Check(i)); - } - - return (sp->mysockaddr); -} - -const char* -VRT_r_server_identity(struct sess *sp) -{ - (void)sp; - - if (heritage.identity[0] != '\0') - return heritage.identity; - else - return heritage.name; -} - - -const char* -VRT_r_server_hostname(struct sess *sp) -{ - (void)sp; - - if (vrt_hostname[0] == '\0') - AZ(gethostname(vrt_hostname, sizeof(vrt_hostname))); - - return (vrt_hostname); -} - -/*-------------------------------------------------------------------- - * XXX: This is pessimistically silly - */ - -int -VRT_r_server_port(struct sess *sp) -{ - - if (sp->mysockaddr->sa_family == AF_UNSPEC) - AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen)); - return (TCP_port(sp->mysockaddr)); -} - -/*-------------------------------------------------------------------- * Add an element to the array/list of hash bits. */ @@ -780,32 +279,6 @@ return (TIM_real()); } -int -VRT_r_obj_hits(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - return (sp->obj->hits); -} - -double -VRT_r_obj_lastuse(const struct sess *sp) -{ - - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - return (TIM_real() - sp->obj->last_use); -} - -unsigned -VRT_r_req_backend_healthy(const struct sess *sp) -{ - CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); - CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC); - return (VDI_Healthy_sp(sp, sp->director)); -} - /*--------------------------------------------------------------------*/ char * Copied: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c (from rev 5379, trunk/varnish-cache/bin/varnishd/cache_vrt.c) =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_var.c (rev 0) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-10-01 10:02:54 UTC (rev 5381) @@ -0,0 +1,566 @@ +/*- + * Copyright (c) 2006 Verdens Gang AS + * Copyright (c) 2006-2009 Linpro AS + * All rights reserved. + * + * Author: Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Runtime support for compiled VCL programs + */ +#include "config.h" + +#include "svnid.h" +SVNID("$Id$") + +#include +#include +#include +#include + +#include "vrt.h" +#include "vrt_obj.h" +#include "cache.h" +#include "cache_backend.h" +#include "hash_slinger.h" + +static char vrt_hostname[255] = ""; + +/*--------------------------------------------------------------------*/ + +static void +vrt_do_string(struct worker *w, int fd, struct http *hp, int fld, + const char *err, const char *p, va_list ap) +{ + char *b; + + // AN(p); + AN(hp); + b = VRT_String(hp->ws, NULL, p, ap); + if (b == NULL || *b == '\0') { + WSL(w, SLT_LostHeader, fd, err); + } else { + http_SetH(hp, fld, b); + } + va_end(ap); +} + +#define VRT_DO_HDR(obj, hdr, http, fld) \ +void \ +VRT_l_##obj##_##hdr(const struct sess *sp, const char *p, ...) \ +{ \ + va_list ap; \ + \ + va_start(ap, p); \ + vrt_do_string(sp->wrk, sp->fd, \ + http, fld, #obj "." #hdr, p, ap); \ + va_end(ap); \ +} \ + \ +const char * \ +VRT_r_##obj##_##hdr(const struct sess *sp) \ +{ \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + CHECK_OBJ_NOTNULL(http, HTTP_MAGIC); \ + return (http->hd[fld].b); \ +} + +VRT_DO_HDR(req, request, sp->http, HTTP_HDR_REQ) +VRT_DO_HDR(req, url, sp->http, HTTP_HDR_URL) +VRT_DO_HDR(req, proto, sp->http, HTTP_HDR_PROTO) +VRT_DO_HDR(bereq, request, sp->wrk->bereq, HTTP_HDR_REQ) +VRT_DO_HDR(bereq, url, sp->wrk->bereq, HTTP_HDR_URL) +VRT_DO_HDR(bereq, proto, sp->wrk->bereq, HTTP_HDR_PROTO) +VRT_DO_HDR(obj, proto, sp->obj->http, HTTP_HDR_PROTO) +VRT_DO_HDR(obj, response, sp->obj->http, HTTP_HDR_RESPONSE) +VRT_DO_HDR(resp, proto, sp->wrk->resp, HTTP_HDR_PROTO) +VRT_DO_HDR(resp, response, sp->wrk->resp, HTTP_HDR_RESPONSE) +VRT_DO_HDR(beresp, proto, sp->wrk->beresp, HTTP_HDR_PROTO) +VRT_DO_HDR(beresp, response, sp->wrk->beresp, HTTP_HDR_RESPONSE) + +/*--------------------------------------------------------------------*/ + +#define VRT_DO_STATUS(obj, http) \ +void \ +VRT_l_##obj##_status(const struct sess *sp, int num) \ +{ \ + \ + assert(num >= 100 && num <= 999); \ + http->status = num; \ +} \ + \ +int \ +VRT_r_##obj##_status(const struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(http->status); \ +} + +VRT_DO_STATUS(obj, sp->obj->http); +VRT_DO_STATUS(beresp, sp->wrk->beresp); +VRT_DO_STATUS(resp, sp->wrk->resp); + +/*--------------------------------------------------------------------*/ + +/* XXX: review this */ +/* Add an objecthead to the saintmode list for the (hopefully) relevant + * backend. Some double-up asserting here to avoid assert-errors when there + * is no object. + */ +void +VRT_l_beresp_saintmode(const struct sess *sp, double a) +{ + struct trouble *new; + struct trouble *tr; + struct trouble *tr2; + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + if (!sp->vbc) + return; + CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); + if (!sp->vbc->backend) + return; + CHECK_OBJ_NOTNULL(sp->vbc->backend, BACKEND_MAGIC); + if (!sp->objhead) + return; + CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC); + + /* Setting a negative holdoff period is a mistake. Detecting this + * when compiling the VCL would be better. + */ + assert(a > 0); + + ALLOC_OBJ(new, TROUBLE_MAGIC); + AN(new); + new->target = (uintptr_t)sp->objhead; + new->timeout = sp->t_req + a; + + /* Insert the new item on the list before the first item with a + * timeout at a later date (ie: sort by which entry will time out + * from the list + */ + Lck_Lock(&sp->vbc->backend->mtx); + VTAILQ_FOREACH_SAFE(tr, &sp->vbc->backend->troublelist, list, tr2) { + if (tr->timeout < new->timeout) { + VTAILQ_INSERT_BEFORE(tr, new, list); + new = NULL; + break; + } + } + + /* Insert the item at the end if the list is empty or all other + * items have a longer timeout. + */ + if (new) + VTAILQ_INSERT_TAIL(&sp->vbc->backend->troublelist, new, list); + + Lck_Unlock(&sp->vbc->backend->mtx); +} + +/*--------------------------------------------------------------------*/ + +#define VBERESP(dir, type, onm, field) \ +void \ +VRT_l_##dir##_##onm(const struct sess *sp, type a) \ +{ \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + sp->wrk->field = a; \ +} \ + \ +type \ +VRT_r_##dir##_##onm(const struct sess *sp) \ +{ \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return (sp->wrk->field); \ +} + +VBERESP(beresp, unsigned, cacheable, cacheable) + +/*--------------------------------------------------------------------*/ + +const char * +VRT_r_client_identity(struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + if (sp->client_identity != NULL) + return (sp->client_identity); + else + return (sp->addr); +} + +void +VRT_l_client_identity(struct sess *sp, const char *str, ...) +{ + va_list ap; + char *b; + + va_start(ap, str); + b = VRT_String(sp->http->ws, NULL, str, ap); + va_end(ap); + sp->client_identity = b; +} + +/*-------------------------------------------------------------------- + * XXX: Working relative to t_req is maybe not the right thing, we could + * XXX: have spent a long time talking to the backend since then. + * XXX: It might make sense to cache a timestamp as "current time" + * XXX: before vcl_recv (== t_req) and vcl_fetch. + * XXX: On the other hand, that might lead to inconsistent behaviour + * XXX: where an object expires while we are running VCL code, and + * XXX: and that may not be a good idea either. + * XXX: See also related t_req use in cache_hash.c + */ + +void +VRT_l_beresp_ttl(const struct sess *sp, double a) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", sp->xid, a, sp->t_req); + /* + * If people set obj.ttl = 0s, they don't expect it to be cacheable + * any longer, but it will still be for up to 1s - epsilon because + * of the rounding to seconds. + * We special case and make sure that rounding does not surprise. + */ + if (a <= 0) + sp->wrk->ttl = sp->t_req - 1; + else + sp->wrk->ttl = sp->t_req + a; +} + +double +VRT_r_beresp_ttl(const struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + return (sp->wrk->ttl - sp->t_req); +} + +/*--------------------------------------------------------------------*/ + +#define BEREQ_TIMEOUT(which) \ +void \ +VRT_l_bereq_##which(struct sess *sp, double num) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + sp->wrk->which = (num > 0.0 ? num : 0.0); \ +} \ + \ +double \ +VRT_r_bereq_##which(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(sp->wrk->which); \ +} + +BEREQ_TIMEOUT(connect_timeout) +BEREQ_TIMEOUT(first_byte_timeout) +BEREQ_TIMEOUT(between_bytes_timeout) + +/*--------------------------------------------------------------------*/ + +const char * +VRT_r_beresp_backend_name(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); + return(sp->vbc->backend->vcl_name); +} + +struct sockaddr * +VRT_r_beresp_backend_ip(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); + return(sp->vbc->addr); +} + +int +VRT_r_beresp_backend_port(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->vbc, VBC_MAGIC); + return (TCP_port(sp->vbc->addr)); +} + +void +VRT_l_obj_ttl(const struct sess *sp, double a) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + if (sp->obj->objcore == NULL) + return; + WSP(sp, SLT_TTL, "%u VCL %.0f %.0f", + sp->obj->xid, a, sp->t_req); + /* + * If people set obj.ttl = 0s, they don't expect it to be cacheable + * any longer, but it will still be for up to 1s - epsilon because + * of the rounding to seconds. + * We special case and make sure that rounding does not surprise. + */ + if (a <= 0) + sp->obj->ttl = sp->t_req - 1; + else + sp->obj->ttl = sp->t_req + a; + EXP_Rearm(sp->obj); +} + +double +VRT_r_obj_ttl(const struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + if (sp->obj->objcore == NULL) + return (0.0); + return (sp->obj->ttl - sp->t_req); +} + + +/*--------------------------------------------------------------------*/ + +#define VOBJ(type,onm,field) \ +void \ +VRT_l_obj_##onm(const struct sess *sp, type a) \ +{ \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \ + sp->obj->field = a; \ +} \ + \ +type \ +VRT_r_obj_##onm(const struct sess *sp) \ +{ \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \ + return (sp->obj->field); \ +} + +VOBJ(unsigned, cacheable, cacheable) + +/*--------------------------------------------------------------------*/ + +void +VRT_l_req_backend(struct sess *sp, struct director *be) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + sp->director = be; +} + +/*lint -e{818} sp could be const */ +struct director * +VRT_r_req_backend(struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + return (sp->director); +} + +/*--------------------------------------------------------------------*/ + +void +VRT_l_req_esi(struct sess *sp, unsigned process_esi) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + /* + * Only allow you to turn of esi in the main request + * else everything gets confused + */ + if(sp->esis == 0) + sp->disable_esi = !process_esi; +} + +unsigned +VRT_r_req_esi(struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + return (!sp->disable_esi); +} + +/*--------------------------------------------------------------------*/ + +int +VRT_r_req_restarts(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + return (sp->restarts); +} + +/*--------------------------------------------------------------------*/ + +#define VRT_DO_GRACE(which, fld, extra) \ +void \ +VRT_l_##which##_grace(struct sess *sp, double a) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + fld = a >= 0.0 ? a : NAN; \ + extra; \ +} \ + \ +double \ +VRT_r_##which##_grace(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + if (isnan(fld)) \ + return ((double)params->default_grace); \ + return(fld); \ +} + +VRT_DO_GRACE(req, sp->grace, ) +VRT_DO_GRACE(obj, sp->obj->grace, EXP_Rearm(sp->obj)) +VRT_DO_GRACE(beresp, sp->wrk->grace, ) + +/*-------------------------------------------------------------------- + * req.xid + */ + +/*lint -e{818} sp could be const */ +const char * +VRT_r_req_xid(struct sess *sp) +{ + char *p; + int size; + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + + size = snprintf(NULL, 0, "%u", sp->xid) + 1; + AN(p = WS_Alloc(sp->http->ws, size)); + assert(snprintf(p, size, "%u", sp->xid) < size); + return (p); +} + +/*--------------------------------------------------------------------*/ + +#define REQ_BOOL(which) \ +void \ +VRT_l_req_##which(struct sess *sp, unsigned val) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + sp->which = val ? 1 : 0; \ +} \ + \ +unsigned \ +VRT_r_req_##which(struct sess *sp) \ +{ \ + \ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \ + return(sp->which); \ +} + +REQ_BOOL(hash_ignore_busy) +REQ_BOOL(hash_always_miss) + +/*--------------------------------------------------------------------*/ + +struct sockaddr * +VRT_r_client_ip(const struct sess *sp) +{ + + return (sp->sockaddr); +} + +struct sockaddr * +VRT_r_server_ip(struct sess *sp) +{ + int i; + + if (sp->mysockaddr->sa_family == AF_UNSPEC) { + i = getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen); + assert(TCP_Check(i)); + } + + return (sp->mysockaddr); +} + +const char* +VRT_r_server_identity(struct sess *sp) +{ + (void)sp; + + if (heritage.identity[0] != '\0') + return heritage.identity; + else + return heritage.name; +} + + +const char* +VRT_r_server_hostname(struct sess *sp) +{ + (void)sp; + + if (vrt_hostname[0] == '\0') + AZ(gethostname(vrt_hostname, sizeof(vrt_hostname))); + + return (vrt_hostname); +} + +/*-------------------------------------------------------------------- + * XXX: This is pessimistically silly + */ + +int +VRT_r_server_port(struct sess *sp) +{ + + if (sp->mysockaddr->sa_family == AF_UNSPEC) + AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen)); + return (TCP_port(sp->mysockaddr)); +} + +/*--------------------------------------------------------------------*/ + +int +VRT_r_obj_hits(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + return (sp->obj->hits); +} + +double +VRT_r_obj_lastuse(const struct sess *sp) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + return (TIM_real() - sp->obj->last_use); +} + +unsigned +VRT_r_req_backend_healthy(const struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC); + return (VDI_Healthy_sp(sp, sp->director)); +} + Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-10-01 10:01:30 UTC (rev 5380) +++ trunk/varnish-cache/include/vrt.h 2010-10-01 10:02:54 UTC (rev 5381) @@ -221,4 +221,4 @@ return (1); \ } while (0) -const char *VRT_String(const struct sess *sp, const char *p, ...); +const char *VRT_WrkString(const struct sess *sp, const char *p, ...); Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-01 10:01:30 UTC (rev 5380) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-01 10:02:54 UTC (rev 5381) @@ -702,7 +702,7 @@ } if (fmt != STRING_LIST && (*e)->fmt == STRING_LIST) *e = vcc_expr_edit(STRING, - "\v+VRT_String(sp,\n\v1,\nvrt_magic_string_end)", *e, NULL); + "\v+VRT_WrkString(sp,\n\v1,\nvrt_magic_string_end)", *e, NULL); if (fmt == STRING_LIST && (*e)->fmt == STRING) (*e)->fmt = STRING_LIST; From phk at varnish-cache.org Fri Oct 1 11:10:22 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 1 Oct 2010 13:10:22 +0200 Subject: r5382 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-01 13:10:21 +0200 (Fri, 01 Oct 2010) New Revision: 5382 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c Log: Remove extra ; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-10-01 10:02:54 UTC (rev 5381) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-10-01 11:10:21 UTC (rev 5382) @@ -117,9 +117,9 @@ return(http->status); \ } -VRT_DO_STATUS(obj, sp->obj->http); -VRT_DO_STATUS(beresp, sp->wrk->beresp); -VRT_DO_STATUS(resp, sp->wrk->resp); +VRT_DO_STATUS(obj, sp->obj->http) +VRT_DO_STATUS(beresp, sp->wrk->beresp) +VRT_DO_STATUS(resp, sp->wrk->resp) /*--------------------------------------------------------------------*/ From tfheen at varnish-cache.org Fri Oct 1 13:13:56 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Fri, 1 Oct 2010 15:13:56 +0200 Subject: r5383 - branches/2.1/varnish-cache/lib/libvarnishapi Message-ID: Author: tfheen Date: 2010-10-01 15:13:55 +0200 (Fri, 01 Oct 2010) New Revision: 5383 Modified: branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c Log: More regex matching fixing This is not a merge since this is fixed by a rewrite in trunk Modified: branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c =================================================================== --- branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c 2010-10-01 11:10:21 UTC (rev 5382) +++ branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c 2010-10-01 13:13:55 UTC (rev 5383) @@ -341,7 +341,7 @@ if (vd->regincl != NULL) { i = VRE_exec(vd->regincl, (char *)p + SHMLOG_DATA, - SHMLOG_LEN(p) - SHMLOG_DATA, /* Length */ + SHMLOG_LEN(p), /* Length */ 0, 0, NULL, 0); if (i == VRE_ERROR_NOMATCH) continue; @@ -349,7 +349,7 @@ if (vd->regexcl != NULL) { i = VRE_exec(vd->regexcl, (char *)p + SHMLOG_DATA, - SHMLOG_LEN(p) - SHMLOG_DATA, /* Length */ + SHMLOG_LEN(p), /* Length */ 0, 0, NULL, 0); if (i != VRE_ERROR_NOMATCH) continue; From phk at varnish-cache.org Sat Oct 2 07:54:47 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 09:54:47 +0200 Subject: r5384 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-02 09:54:47 +0200 (Sat, 02 Oct 2010) New Revision: 5384 Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: A missing error check Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-01 13:13:55 UTC (rev 5383) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-02 07:54:47 UTC (rev 5384) @@ -353,6 +353,7 @@ { const char *p; + CHECK_OBJ_NOTNULL(*e, EXPR_MAGIC); AN(fmt == STRING || fmt == STRING_LIST); p = NULL; @@ -991,6 +992,7 @@ t1 = tl->t; vcc_expr0(tl, &e, fmt); + ERRCHK(tl); if (fmt == STRING || fmt == STRING_LIST) vcc_expr_tostring(&e, fmt); if (!tl->err && fmt != e->fmt) { From phk at varnish-cache.org Sat Oct 2 18:14:09 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 20:14:09 +0200 Subject: r5385 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-02 20:14:09 +0200 (Sat, 02 Oct 2010) New Revision: 5385 Modified: trunk/varnish-cache/lib/libvcl/generate.py Log: Don't list methods manually, we have them in a variable. Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-10-02 07:54:47 UTC (rev 5384) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-10-02 18:14:09 UTC (rev 5385) @@ -95,7 +95,6 @@ ('error', ('restart', 'deliver',)), ) - ####################################################################### # Variables available in sessions @@ -696,16 +695,12 @@ vcl_init_f *init_func; vcl_fini_f *fini_func; +""") - vcl_func_f *recv_func; - vcl_func_f *pipe_func; - vcl_func_f *pass_func; - vcl_func_f *hash_func; - vcl_func_f *miss_func; - vcl_func_f *hit_func; - vcl_func_f *fetch_func; - vcl_func_f *deliver_func; - vcl_func_f *error_func; +for i in returns: + fo.write("\tvcl_func_f\t*" + i[0] + "_func;\n") + +fo.write(""" }; """) From phk at varnish-cache.org Sat Oct 2 18:32:40 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 20:32:40 +0200 Subject: r5386 - in trunk/varnish-cache: bin/varnishd lib/libvcl Message-ID: Author: phk Date: 2010-10-02 20:32:40 +0200 (Sat, 02 Oct 2010) New Revision: 5386 Added: trunk/varnish-cache/lib/libvcl/symbol_kind.h Modified: trunk/varnish-cache/bin/varnishd/flint.lnt trunk/varnish-cache/lib/libvcl/vcc_acl.c trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_expr.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_symb.c trunk/varnish-cache/lib/libvcl/vcc_var.c trunk/varnish-cache/lib/libvcl/vcc_vmod.c trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Rework the x-ref code in VCC to use the One and Only symbol table, rather than have three different ones. Modified: trunk/varnish-cache/bin/varnishd/flint.lnt =================================================================== --- trunk/varnish-cache/bin/varnishd/flint.lnt 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/bin/varnishd/flint.lnt 2010-10-02 18:32:40 UTC (rev 5386) @@ -74,6 +74,7 @@ -efile(451, "http_headers.h") // No include guard -efile(451, "acct_fields.h") // No include guard -efile(451, "vcc_types.h") // No include guard +-efile(451, "symbol_kind.h") // No include guard -efile(451, "config.h") // No include guard ////////////// // -e458 // unprotected access Added: trunk/varnish-cache/lib/libvcl/symbol_kind.h =================================================================== --- trunk/varnish-cache/lib/libvcl/symbol_kind.h (rev 0) +++ trunk/varnish-cache/lib/libvcl/symbol_kind.h 2010-10-02 18:32:40 UTC (rev 5386) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2010 Linpro AS + * All rights reserved. + * + * Author: Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id: vcc_types.h 5163 2010-08-31 10:59:07Z phk $ + */ + +/*lint -save -e525 -e539 */ +VCC_SYMB(NONE, none, "undefined") +VCC_SYMB(VAR, var, "variable") +VCC_SYMB(FUNC, func, "function") /* VMOD function */ +VCC_SYMB(PROC, proc, "procedure") /* VMOD procedure */ +VCC_SYMB(VMOD, vmod, "vmod") +VCC_SYMB(ACL, acl, "acl") +VCC_SYMB(SUB, sub, "sub") /* VCL subroutine */ +VCC_SYMB(BACKEND, backend, "backend") +VCC_SYMB(PROBE, probe, "probe") +/*lint -restore */ Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_acl.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_acl.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -477,7 +477,7 @@ an = tl->t; vcc_NextToken(tl); - vcc_AddDef(tl, an, R_ACL); + vcc_AddDef(tl, an, SYM_ACL); bprintf(acln, "%.*s", PF(an)); SkipToken(tl, '{'); Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -53,7 +53,7 @@ vcc_NextToken(tl); ExpectErr(tl, ID); vcc_AddCall(tl, tl->t); - vcc_AddRef(tl, tl->t, R_SUB); + vcc_AddRef(tl, tl->t, SYM_SUB); Fb(tl, 1, "if (VGC_function_%.*s(sp))\n", PF(tl->t)); Fb(tl, 1, "\treturn (1);\n"); vcc_NextToken(tl); @@ -447,7 +447,7 @@ return (1); } } - sym = VCC_FindSymbol(tl, tl->t); + sym = VCC_FindSymbol(tl, tl->t, SYM_NONE); if (sym != NULL && sym->kind == SYM_PROC) { vcc_Expr_Call(tl, sym); return (1); Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -422,7 +422,7 @@ ERRCHK(tl); t_probe = tl->t; vcc_NextToken(tl); - vcc_AddDef(tl, t_probe, R_PROBE); + vcc_AddDef(tl, t_probe, SYM_PROBE); Fh(tl, 0, "\n#define vgc_probe_%.*s\tvgc_probe__%d\n", PF(t_probe), tl->nprobe); @@ -554,7 +554,7 @@ ERRCHK(tl); } else if (vcc_IdIs(t_field, "probe") && tl->t->tok == ID) { Fb(tl, 0, "\t.probe = &vgc_probe_%.*s,\n", PF(tl->t)); - vcc_AddRef(tl, tl->t, R_PROBE); + vcc_AddRef(tl, tl->t, SYM_PROBE); vcc_NextToken(tl); SkipToken(tl, ';'); } else if (vcc_IdIs(t_field, "probe")) { @@ -646,7 +646,7 @@ vcc_ErrWhere(tl, tl->t); return; } - vcc_AddRef(tl, h->name, R_BACKEND); + vcc_AddRef(tl, h->name, SYM_BACKEND); vcc_NextToken(tl); SkipToken(tl, ';'); *nm = h->vgcname; @@ -687,7 +687,7 @@ h = TlAlloc(tl, sizeof *h); h->name = tl->t_dir; - vcc_AddDef(tl, tl->t_dir, R_BACKEND); + vcc_AddDef(tl, tl->t_dir, SYM_BACKEND); sprintf(vgcname, "_%.*s", PF(h->name)); h->vgcname = TlAlloc(tl, strlen(vgcname) + 1); strcpy(h->vgcname, vgcname); @@ -735,7 +735,7 @@ tl->t_policy = t_first; vcc_ParseSimpleDirector(tl); } else { - vcc_AddDef(tl, tl->t_dir, R_BACKEND); + vcc_AddDef(tl, tl->t_dir, SYM_BACKEND); ExpectErr(tl, ID); /* ID: policy */ tl->t_policy = tl->t; vcc_NextToken(tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -477,8 +477,6 @@ VTAILQ_INIT(&tl->hosts); VTAILQ_INIT(&tl->membits); VTAILQ_INIT(&tl->tokens); - VTAILQ_INIT(&tl->refs); - VTAILQ_INIT(&tl->procs); VTAILQ_INIT(&tl->sources); tl->nsources = 0; @@ -564,7 +562,7 @@ tl->sb = sb; for (v = tl->vars; v->name != NULL; v++) { - sym = VCC_AddSymbol(tl, v->name, SYM_VAR); + sym = VCC_AddSymbolStr(tl, v->name, SYM_VAR); sym->var = v; sym->fmt = v->fmt; sym->r_methods = v->r_methods; @@ -623,7 +621,7 @@ /* Configure the default director */ Fi(tl, 0, "\tVCL_conf.director[0] = VCL_conf.director[%d];\n", tl->defaultdir); - vcc_AddRef(tl, tl->t_defaultdir, R_BACKEND); + vcc_AddRef(tl, tl->t_defaultdir, SYM_BACKEND); /* Check for orphans */ if (vcc_CheckReferences(tl)) Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-02 18:32:40 UTC (rev 5386) @@ -37,6 +37,7 @@ #define INDENT 2 struct acl_e; +struct proc; enum var_type { #define VCC_TYPE(foo) foo, @@ -69,11 +70,9 @@ }; enum symkind { - SYM_NONE, - SYM_VAR, - SYM_FUNC, - SYM_PROC, - SYM_VMOD +#define VCC_SYMB(uu, ll, dd) SYM_##uu, +#include "symbol_kind.h" +#undef VCC_SYMB }; struct symbol { @@ -84,11 +83,14 @@ char *name; unsigned nlen; unsigned wildcard; - enum symkind kind; + + unsigned nref, ndef; + const struct token *def_b, *def_e; + enum var_type fmt; - struct token *def_b, *def_e; + struct proc *proc; const char *cfunc; const char *args; @@ -132,11 +134,9 @@ * NULL otherwise */ struct vsb *fm[VCL_MET_MAX]; /* Method bodies */ - VTAILQ_HEAD(, ref) refs; struct vsb *sb; int err; int ndirector; - VTAILQ_HEAD(, proc) procs; struct proc *curproc; struct proc *mprocs[VCL_MET_MAX]; @@ -154,21 +154,6 @@ unsigned nvmodpriv; }; -enum ref_type { - R_SUB, - R_ACL, - R_BACKEND, - R_PROBE -}; - -struct ref { - enum ref_type type; - struct token *name; - unsigned defcnt; - unsigned refcnt; - VTAILQ_ENTRY(ref) list; -}; - struct var { const char *name; enum var_type fmt; @@ -260,9 +245,14 @@ void vcc_ExpectedStringval(struct vcc *tl); /* vcc_symbol */ -struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind); -const struct symbol *VCC_FindSymbol(const struct vcc *tl, - const struct token *t); +struct symbol *VCC_AddSymbolStr(struct vcc *tl, const char *name, enum symkind); +struct symbol *VCC_GetSymbolTok(struct vcc *tl, const struct token *tok, + enum symkind); +struct symbol *VCC_FindSymbol(const struct vcc *tl, + const struct token *t, enum symkind kind); +const char * VCC_SymKind(struct vcc *tl, const struct symbol *s); +typedef void symwalk_f(struct vcc *tl, const struct symbol *s); +void VCC_WalkSymbols(struct vcc *tl, symwalk_f *func, enum symkind kind); /* vcc_token.c */ void vcc_Coord(const struct vcc *tl, struct vsb *vsb, @@ -292,8 +282,8 @@ void vcc_ParseImport(struct vcc *tl); /* vcc_xref.c */ -void vcc_AddDef(struct vcc *tl, struct token *t, enum ref_type type); -void vcc_AddRef(struct vcc *tl, struct token *t, enum ref_type type); +void vcc_AddDef(struct vcc *tl, const struct token *t, enum symkind type); +void vcc_AddRef(struct vcc *tl, const struct token *t, enum symkind type); int vcc_CheckReferences(struct vcc *tl); void vcc_AddCall(struct vcc *tl, struct token *t); Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -540,13 +540,13 @@ } if (fmt == BACKEND) { vcc_ExpectCid(tl); - vcc_AddRef(tl, tl->t, R_BACKEND); + vcc_AddRef(tl, tl->t, SYM_BACKEND); vsb_printf(e1->vsb, "VGCDIR(_%.*s)", PF(tl->t)); e1->fmt = BACKEND; vcc_NextToken(tl); break; } - sym = VCC_FindSymbol(tl, tl->t); + sym = VCC_FindSymbol(tl, tl->t, SYM_NONE); if (sym == NULL) { vsb_printf(tl->sb, "Symbol not found: "); vcc_ErrToken(tl, tl->t); @@ -687,9 +687,10 @@ while (tl->t->tok == '+') { vcc_NextToken(tl); vcc_expr_mul(tl, &e2, STRING); + ERRCHK(tl); if (e2->fmt != STRING && e2->fmt != STRING_LIST) vcc_expr_tostring(&e2, f2); - ERRCHK(tl); + ERRCHK(tl); assert(e2->fmt == STRING || e2->fmt == STRING_LIST); if ((*e)->constant && e2->constant) { assert((*e)->fmt == STRING); @@ -833,7 +834,7 @@ not = tl->t->tok == '~' ? "" : "!"; vcc_NextToken(tl); ExpectErr(tl, ID); - vcc_AddRef(tl, tl->t, R_ACL); + vcc_AddRef(tl, tl->t, SYM_ACL); bprintf(buf, "%smatch_acl_named_%.*s(sp, \v1)", not, PF(tl->t)); vcc_NextToken(tl); *e = vcc_expr_edit(BOOL, buf, *e, NULL); @@ -848,7 +849,7 @@ (tl->t->tok == T_EQ || tl->t->tok == T_NEQ)) { vcc_NextToken(tl); ExpectErr(tl, ID); - vcc_AddRef(tl, tl->t, R_BACKEND); + vcc_AddRef(tl, tl->t, SYM_BACKEND); bprintf(buf, "(\v1 %.*s VGCDIR(_%.*s))", PF(tk), PF(tl->t)); vcc_NextToken(tl); *e = vcc_expr_edit(BOOL, buf, *e, NULL); @@ -867,6 +868,8 @@ PF(tl->t), vcc_Type((*e)->fmt)); vcc_ErrWhere(tl, tl->t); return; + default: + break; } if (fmt == BOOL && (*e)->fmt == STRING) { *e = vcc_expr_edit(BOOL, "(\v1 != 0)", *e, NULL); Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -207,9 +207,9 @@ assert(m < VCL_MET_MAX); tl->fb = tl->fm[m]; if (tl->mprocs[m] == NULL) { + vcc_AddDef(tl, tl->t, SYM_SUB); + vcc_AddRef(tl, tl->t, SYM_SUB); tl->mprocs[m] = vcc_AddProc(tl, tl->t); - vcc_AddDef(tl, tl->t, R_SUB); - vcc_AddRef(tl, tl->t, R_SUB); } tl->curproc = tl->mprocs[m]; Fb(tl, 1, " /* ... from "); @@ -217,8 +217,8 @@ Fb(tl, 0, " */\n"); } else { tl->fb = tl->fc; + vcc_AddDef(tl, tl->t, SYM_SUB); tl->curproc = vcc_AddProc(tl, tl->t); - vcc_AddDef(tl, tl->t, R_SUB); Fh(tl, 0, "static int VGC_function_%.*s (struct sess *sp);\n", PF(tl->t)); Fc(tl, 1, "\nstatic int\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_symb.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_symb.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_symb.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -43,35 +43,80 @@ /*--------------------------------------------------------------------*/ +const char * +VCC_SymKind(struct vcc *tl, const struct symbol *s) +{ + switch(s->kind) { +#define VCC_SYMB(uu, ll, dd) case SYM_##uu: return(dd); +#include "symbol_kind.h" +#undef VCC_SYMB + default: + ErrInternal(tl); + vsb_printf(tl->sb, "Symbol Kind 0x%x\n", s->kind); + return("INTERNALERROR"); + } +} -struct symbol * -VCC_AddSymbol(struct vcc *tl, const char *name, enum symkind kind) + +static struct symbol * +vcc_AddSymbol(struct vcc *tl, const char *nb, int l, enum symkind kind) { struct symbol *sym; VTAILQ_FOREACH(sym, &tl->symbols, list) { - if (strcmp(name, sym->name)) + if (sym->nlen != l) continue; - printf("%s <> %s\n", name, sym->name); - WRONG("name collision"); + if (memcmp(nb, sym->name, l)) + continue; + if (kind != sym->kind) + continue; + vsb_printf(tl->sb, "Name Collision: <%.*s> <%s>\n", + l, nb, VCC_SymKind(tl, sym)); + ErrInternal(tl); + return (NULL); } ALLOC_OBJ(sym, SYMBOL_MAGIC); AN(sym); - REPLACE(sym->name, name); - AN(name); - sym->nlen = strlen(name); + sym->name = malloc(l + 1); + AN(sym->name); + memcpy(sym->name, nb, l); + sym->name[l] = '\0'; + sym->nlen = l; VTAILQ_INSERT_TAIL(&tl->symbols, sym, list); sym->kind = kind; return (sym); } -const struct symbol * -VCC_FindSymbol(const struct vcc *tl, const struct token *t) +struct symbol * +VCC_AddSymbolStr(struct vcc *tl, const char *name, enum symkind kind) { + + return (vcc_AddSymbol(tl, name, strlen(name), kind)); +} + +struct symbol * +VCC_GetSymbolTok(struct vcc *tl, const struct token *tok, enum symkind kind) +{ struct symbol *sym; + sym = VCC_FindSymbol(tl, tok, kind); + if (sym == NULL) { + sym = vcc_AddSymbol(tl, tok->b, tok->e - tok->b, kind); + AN(sym); + sym->def_b = tok; + } + return (sym); +} + +struct symbol * +VCC_FindSymbol(const struct vcc *tl, const struct token *t, enum symkind kind) +{ + struct symbol *sym; + assert(t->tok == ID); VTAILQ_FOREACH(sym, &tl->symbols, list) { + if (kind != SYM_NONE && kind != sym->kind) + continue; if (!sym->wildcard) { if (vcc_IdIs(t, sym->name)) return (sym); @@ -84,3 +129,15 @@ } return (NULL); } + +void +VCC_WalkSymbols(struct vcc *tl, symwalk_f *func, enum symkind kind) +{ + struct symbol *sym; + + VTAILQ_FOREACH(sym, &tl->symbols, list) { + if (kind == SYM_NONE || kind == sym->kind) + func(tl, sym); + ERRCHK(tl); + } +} Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -94,7 +94,7 @@ const struct symbol *sym; AN(tl->vars); - sym = VCC_FindSymbol(tl, t); + sym = VCC_FindSymbol(tl, t, SYM_NONE); if (sym != NULL) { v = sym->var; AN(v); Modified: trunk/varnish-cache/lib/libvcl/vcc_vmod.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -63,7 +63,7 @@ vcc_NextToken(tl); - osym = VCC_FindSymbol(tl, mod); + osym = VCC_FindSymbol(tl, mod, SYM_NONE); if (osym != NULL && osym->kind != SYM_VMOD) { vsb_printf(tl->sb, "Module %.*s conflics with other symbol.\n", PF(mod)); @@ -80,7 +80,9 @@ } bprintf(fn, "%.*s", PF(mod)); - sym = VCC_AddSymbol(tl, fn, SYM_VMOD); + sym = VCC_AddSymbolStr(tl, fn, SYM_VMOD); + ERRCHK(tl); + AN(sym); sym->def_b = t1; sym->def_e = tl->t; @@ -150,7 +152,9 @@ p += strlen(p) + 1; Fi(tl, 0, "\t%s(&vmod_priv_%.*s, &VCL_conf);\n", p, PF(mod)); } else { - sym = VCC_AddSymbol(tl, p, SYM_FUNC); + sym = VCC_AddSymbolStr(tl, p, SYM_FUNC); + ERRCHK(tl); + AN(sym); p += strlen(p) + 1; sym->cfunc = p; p += strlen(p) + 1; Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-10-02 18:14:09 UTC (rev 5385) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-10-02 18:32:40 UTC (rev 5386) @@ -66,7 +66,6 @@ }; struct proc { - VTAILQ_ENTRY(proc) list; VTAILQ_HEAD(,proccall) calls; VTAILQ_HEAD(,procuse) uses; struct token *name; @@ -77,106 +76,53 @@ struct token *return_tok[VCL_RET_MAX]; }; -/*--------------------------------------------------------------------*/ - -static const char * -vcc_typename(struct vcc *tl, const struct ref *r) -{ - switch (r->type) { - case R_SUB: return ("subroutine"); - case R_ACL: return ("acl"); - case R_BACKEND: return ("backend"); - case R_PROBE: return ("probe"); - default: - ErrInternal(tl); - vsb_printf(tl->sb, "Ref "); - vcc_ErrToken(tl, r->name); - vsb_printf(tl->sb, " has unknown type %d\n", - r->type); - return "?"; - } -} - /*-------------------------------------------------------------------- * Keep track of definitions and references */ -static struct ref * -vcc_findref(struct vcc *tl, struct token *t, enum ref_type type) +void +vcc_AddRef(struct vcc *tl, const struct token *t, enum symkind kind) { - struct ref *r; + struct symbol *sym; - VTAILQ_FOREACH(r, &tl->refs, list) { - if (r->type != type) - continue; - if (vcc_Teq(r->name, t)) - return (r); - } - r = TlAlloc(tl, sizeof *r); - assert(r != NULL); - r->name = t; - r->type = type; - VTAILQ_INSERT_TAIL(&tl->refs, r, list); - return (r); + sym = VCC_GetSymbolTok(tl, t, kind); + AN(sym); + sym->nref++; } void -vcc_AddRef(struct vcc *tl, struct token *t, enum ref_type type) +vcc_AddDef(struct vcc *tl, const struct token *t, enum symkind kind) { + struct symbol *sym; - vcc_findref(tl, t, type)->refcnt++; + sym = VCC_GetSymbolTok(tl, t, kind); + AN(sym); + sym->ndef++; } -void -vcc_AddDef(struct vcc *tl, struct token *t, enum ref_type type) +/*--------------------------------------------------------------------*/ + +static void +vcc_checkref(struct vcc *tl, const struct symbol *sym) { - struct ref *r; - const char *tp; - r = vcc_findref(tl, t, type); - if (r->defcnt > 0) { - tp = vcc_typename(tl, r); - vsb_printf(tl->sb, "Multiple definitions of %s \"%.*s\"\n", - tp, PF(t)); - vcc_ErrWhere(tl, r->name); - vsb_printf(tl->sb, "...and\n"); - vcc_ErrWhere(tl, t); + if (sym->ndef == 0 && sym->nref != 0) { + vsb_printf(tl->sb, "Undefined %s %.*s, first reference:\n", + VCC_SymKind(tl, sym), PF(sym->def_b)); + vcc_ErrWhere(tl, sym->def_b); + } else if (sym->ndef != 0 && sym->nref == 0) { + vsb_printf(tl->sb, "Unused %s %.*s, defined:\n", + VCC_SymKind(tl, sym), PF(sym->def_b)); + vcc_ErrWhere(tl, sym->def_b); } - r->defcnt++; - r->name = t; } -/*--------------------------------------------------------------------*/ - int vcc_CheckReferences(struct vcc *tl) { - struct ref *r; - const char *type; - int nerr = 0; - const char *sep = ""; - VTAILQ_FOREACH(r, &tl->refs, list) { - if (r->defcnt != 0 && r->refcnt != 0) - continue; - nerr++; - - type = vcc_typename(tl, r); - - if (r->defcnt == 0) { - vsb_printf(tl->sb, - "%sUndefined %s %.*s, first reference:\n", - sep, type, PF(r->name)); - vcc_ErrWhere(tl, r->name); - continue; - } - - vsb_printf(tl->sb, "%sUnused %s %.*s, defined:\n", - sep, type, PF(r->name)); - vcc_ErrWhere(tl, r->name); - sep = "\n"; - } - return (nerr); + VCC_WalkSymbols(tl, vcc_checkref, SYM_NONE); + return (tl->err); } /*-------------------------------------------------------------------- @@ -186,17 +132,21 @@ static struct proc * vcc_findproc(struct vcc *tl, struct token *t) { + struct symbol *sym; struct proc *p; - VTAILQ_FOREACH(p, &tl->procs, list) - if (vcc_Teq(p->name, t)) - return (p); + + sym = VCC_GetSymbolTok(tl, t, SYM_SUB); + AN(sym); + if (sym->proc != NULL) + return (sym->proc); + p = TlAlloc(tl, sizeof *p); assert(p != NULL); VTAILQ_INIT(&p->calls); VTAILQ_INIT(&p->uses); - VTAILQ_INSERT_TAIL(&tl->procs, p, list); p->name = t; + sym->proc = p; return (p); } @@ -298,42 +248,64 @@ return (0); } -int -vcc_CheckAction(struct vcc *tl) +/*--------------------------------------------------------------------*/ + +static void +vcc_checkaction1(struct vcc *tl, const struct symbol *sym) { struct proc *p; struct method *m; int i; - VTAILQ_FOREACH(p, &tl->procs, list) { - i = IsMethod(p->name); - if (i < 0) - continue; - m = method_tab + i; - if (vcc_CheckActionRecurse(tl, p, m->ret_bitmap)) { - vsb_printf(tl->sb, - "\n...which is the \"%s\" method\n", m->name); - vsb_printf(tl->sb, "Legal returns are:"); + p = sym->proc; + AN(p); + i = IsMethod(p->name); + if (i < 0) + return; + m = method_tab + i; + if (vcc_CheckActionRecurse(tl, p, m->ret_bitmap)) { + vsb_printf(tl->sb, + "\n...which is the \"%s\" method\n", m->name); + vsb_printf(tl->sb, "Legal returns are:"); #define VCL_RET_MAC(l, U, B) \ - if (m->ret_bitmap & ((1 << VCL_RET_##U))) \ - vsb_printf(tl->sb, " \"%s\"", #l); + if (m->ret_bitmap & ((1 << VCL_RET_##U))) \ + vsb_printf(tl->sb, " \"%s\"", #l); #include "vcl_returns.h" #undef VCL_RET_MAC - vsb_printf(tl->sb, "\n"); - return (1); - } + vsb_printf(tl->sb, "\n"); + tl->err = 1; } - VTAILQ_FOREACH(p, &tl->procs, list) { - if (p->called) - continue; - vsb_printf(tl->sb, "Function unused\n"); - vcc_ErrWhere(tl, p->name); - return (1); - } - return (0); + } +static void +vcc_checkaction2(struct vcc *tl, const struct symbol *sym) +{ + struct proc *p; + + p = sym->proc; + AN(p); + + if (p->called) + return; + vsb_printf(tl->sb, "Function unused\n"); + vcc_ErrWhere(tl, p->name); +} + +int +vcc_CheckAction(struct vcc *tl) +{ + + VCC_WalkSymbols(tl, vcc_checkaction1, SYM_SUB); + if (tl->err) + return (tl->err); + VCC_WalkSymbols(tl, vcc_checkaction2, SYM_SUB); + return (tl->err); +} + +/*--------------------------------------------------------------------*/ + static struct procuse * vcc_FindIllegalUse(const struct proc *p, const struct method *m) { @@ -374,34 +346,41 @@ return (0); } -int -vcc_CheckUses(struct vcc *tl) +static void +vcc_checkuses(struct vcc *tl, const struct symbol *sym) { struct proc *p; struct method *m; struct procuse *pu; int i; - VTAILQ_FOREACH(p, &tl->procs, list) { - i = IsMethod(p->name); - if (i < 0) - continue; - m = method_tab + i; - pu = vcc_FindIllegalUse(p, m); - if (pu != NULL) { - vsb_printf(tl->sb, - "'%.*s': %s in method '%.*s'.", - PF(pu->t), pu->use, PF(p->name)); - vsb_cat(tl->sb, "\nAt: "); - vcc_ErrWhere(tl, pu->t); - return (1); - } - if (vcc_CheckUseRecurse(tl, p, m)) { - vsb_printf(tl->sb, - "\n...which is the \"%s\" method\n", m->name); - return (1); - } + p = sym->proc; + AN(p); + + i = IsMethod(p->name); + if (i < 0) + return; + m = method_tab + i; + pu = vcc_FindIllegalUse(p, m); + if (pu != NULL) { + vsb_printf(tl->sb, + "'%.*s': %s in method '%.*s'.", + PF(pu->t), pu->use, PF(p->name)); + vsb_cat(tl->sb, "\nAt: "); + vcc_ErrWhere(tl, pu->t); + return; } - return (0); + if (vcc_CheckUseRecurse(tl, p, m)) { + vsb_printf(tl->sb, + "\n...which is the \"%s\" method\n", m->name); + return; + } } +int +vcc_CheckUses(struct vcc *tl) +{ + + VCC_WalkSymbols(tl, vcc_checkuses, SYM_SUB); + return (tl->err); +} From phk at varnish-cache.org Sat Oct 2 21:20:54 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 23:20:54 +0200 Subject: r5387 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-02 23:20:54 +0200 (Sat, 02 Oct 2010) New Revision: 5387 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try to make this test-case robust with a half second delay Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-02 18:32:40 UTC (rev 5386) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-02 21:20:54 UTC (rev 5387) @@ -64,6 +64,7 @@ } } +delay .5 varnish v1 -expect vmods == 0 From phk at varnish-cache.org Sat Oct 2 21:22:03 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 23:22:03 +0200 Subject: r5388 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-02 23:22:03 +0200 (Sat, 02 Oct 2010) New Revision: 5388 Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Improve an error message now that the risk of hitting a wrong type of symbol is much larger. Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-02 21:20:54 UTC (rev 5387) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-02 21:22:03 UTC (rev 5388) @@ -546,6 +546,10 @@ vcc_NextToken(tl); break; } + /* + * XXX: what if var and func/proc had same name ? + * XXX: look for SYM_VAR first for consistency ? + */ sym = VCC_FindSymbol(tl, tl->t, SYM_NONE); if (sym == NULL) { vsb_printf(tl->sb, "Symbol not found: "); @@ -579,7 +583,9 @@ vcc_ErrWhere(tl, tl->t); return; default: - vsb_printf(tl->sb, "Symbol is not a function.\n"); + vsb_printf(tl->sb, + "Symbol type (%s) wrong in expression.\n", + VCC_SymKind(tl, sym)); vcc_ErrWhere(tl, tl->t); return; } From phk at varnish-cache.org Sat Oct 2 21:22:19 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 23:22:19 +0200 Subject: r5389 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-02 23:22:19 +0200 (Sat, 02 Oct 2010) New Revision: 5389 Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c Log: We are only interested in variables here. Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-10-02 21:22:03 UTC (rev 5388) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-10-02 21:22:19 UTC (rev 5389) @@ -94,7 +94,7 @@ const struct symbol *sym; AN(tl->vars); - sym = VCC_FindSymbol(tl, t, SYM_NONE); + sym = VCC_FindSymbol(tl, t, SYM_VAR); if (sym != NULL) { v = sym->var; AN(v); From phk at varnish-cache.org Sat Oct 2 21:22:49 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 23:22:49 +0200 Subject: r5390 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-02 23:22:48 +0200 (Sat, 02 Oct 2010) New Revision: 5390 Modified: trunk/varnish-cache/bin/varnishtest/tests/v00020.vtc Log: Test that we detect and handle symbols of a bogus kind in expressions. Modified: trunk/varnish-cache/bin/varnishtest/tests/v00020.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00020.vtc 2010-10-02 21:22:19 UTC (rev 5389) +++ trunk/varnish-cache/bin/varnishtest/tests/v00020.vtc 2010-10-02 21:22:48 UTC (rev 5390) @@ -33,3 +33,9 @@ } } + +varnish v1 -badvcl { + sub vcl_recv { + set req.http.foo = vcl_recv; + } +} From phk at varnish-cache.org Sat Oct 2 21:23:03 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 2 Oct 2010 23:23:03 +0200 Subject: r5391 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-02 23:23:03 +0200 (Sat, 02 Oct 2010) New Revision: 5391 Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: FlexeLint nits. Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend.c 2010-10-02 21:22:48 UTC (rev 5390) +++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2010-10-02 21:23:03 UTC (rev 5391) @@ -349,7 +349,7 @@ */ static struct vbc * -vbe_GetVbe(struct sess *sp, struct vdi_simple *vs) +vbe_GetVbe(const struct sess *sp, struct vdi_simple *vs) { struct vbc *vc; struct backend *bp; Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-10-02 21:22:48 UTC (rev 5390) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-10-02 21:23:03 UTC (rev 5391) @@ -56,7 +56,6 @@ #include "heritage.h" #include "vcl.h" -#include "vss.h" struct vclprog { VTAILQ_ENTRY(vclprog) list; From phk at varnish-cache.org Mon Oct 4 09:00:53 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 11:00:53 +0200 Subject: r5392 - in trunk/varnish-cache/bin: varnishhist varnishsizes Message-ID: Author: phk Date: 2010-10-04 11:00:53 +0200 (Mon, 04 Oct 2010) New Revision: 5392 Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c trunk/varnish-cache/bin/varnishsizes/varnishsizes.c Log: Explicitly throw away return values we don't care about. Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.c 2010-10-02 21:23:03 UTC (rev 5391) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.c 2010-10-04 09:00:53 UTC (rev 5392) @@ -110,9 +110,9 @@ w = COLS / HIST_RANGE; n = w * HIST_RANGE; for (i = 0; i < n; ++i) - mvaddch(LINES - 2, i, '-'); + (void)mvaddch(LINES - 2, i, '-'); for (i = 0, j = HIST_LOW; i < HIST_RANGE; ++i, ++j) { - mvaddch(LINES - 2, w * i, '+'); + (void)mvaddch(LINES - 2, w * i, '+'); mvprintw(LINES - 1, w * i, "|1e%d", j); } @@ -139,9 +139,9 @@ /* show them */ for (i = 0; i < n; ++i) { for (j = 0; j < bm[i] / scale; ++j) - mvaddch(LINES - 3 - j, i, '#'); + (void)mvaddch(LINES - 3 - j, i, '#'); for (; j < (bm[i] + bh[i]) / scale; ++j) - mvaddch(LINES - 3 - j, i, '|'); + (void)mvaddch(LINES - 3 - j, i, '|'); } refresh(); Modified: trunk/varnish-cache/bin/varnishsizes/varnishsizes.c =================================================================== --- trunk/varnish-cache/bin/varnishsizes/varnishsizes.c 2010-10-02 21:23:03 UTC (rev 5391) +++ trunk/varnish-cache/bin/varnishsizes/varnishsizes.c 2010-10-04 09:00:53 UTC (rev 5392) @@ -110,9 +110,9 @@ w = COLS / HIST_RANGE; n = w * HIST_RANGE; for (i = 0; i < n; ++i) - mvaddch(LINES - 2, i, '-'); + (void)mvaddch(LINES - 2, i, '-'); for (i = 0, j = HIST_LOW; i < HIST_RANGE; ++i, ++j) { - mvaddch(LINES - 2, w * i, '+'); + (void)mvaddch(LINES - 2, w * i, '+'); mvprintw(LINES - 1, w * i, "|1e%d", j); } @@ -139,9 +139,9 @@ /* show them */ for (i = 0; i < n; ++i) { for (j = 0; j < bm[i] / scale; ++j) - mvaddch(LINES - 3 - j, i, '#'); + (void)mvaddch(LINES - 3 - j, i, '#'); for (; j < (bm[i] + bh[i]) / scale; ++j) - mvaddch(LINES - 3 - j, i, '|'); + (void)mvaddch(LINES - 3 - j, i, '|'); } refresh(); From phk at varnish-cache.org Mon Oct 4 09:42:11 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 11:42:11 +0200 Subject: r5393 - in trunk/varnish-cache: bin/varnishd include lib/libvarnish lib/libvcl Message-ID: Author: phk Date: 2010-10-04 11:42:11 +0200 (Mon, 04 Oct 2010) New Revision: 5393 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_acceptor.c trunk/varnish-cache/bin/varnishd/cache_backend.c trunk/varnish-cache/bin/varnishd/cache_backend.h trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c trunk/varnish-cache/bin/varnishd/cache_backend_poll.c trunk/varnish-cache/bin/varnishd/cache_dir_dns.c trunk/varnish-cache/bin/varnishd/cache_session.c trunk/varnish-cache/bin/varnishd/cache_vrt_var.c trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/lib/libvarnish/tcp.c trunk/varnish-cache/lib/libvcl/generate.py Log: Switch from struct sockaddr to sockaddr_storage throughout. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache.h 2010-10-04 09:42:11 UTC (rev 5393) @@ -395,8 +395,8 @@ socklen_t sockaddrlen; socklen_t mysockaddrlen; - struct sockaddr *sockaddr; - struct sockaddr *mysockaddr; + struct sockaddr_storage *sockaddr; + struct sockaddr_storage *mysockaddr; struct listen_sock *mylsock; /* formatted ascii client address */ @@ -468,7 +468,7 @@ struct vdi_simple *vdis; int fd; - struct sockaddr *addr; + struct sockaddr_storage *addr; socklen_t addrlen; uint8_t recycled; Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -167,7 +167,7 @@ sp->addr = WS_Dup(sp->ws, addr); sp->port = WS_Dup(sp->ws, port); if (params->log_local_addr) { - AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen)); + AZ(getsockname(sp->fd, (void*)sp->mysockaddr, &sp->mysockaddrlen)); TCP_name(sp->mysockaddr, sp->mysockaddrlen, addr, sizeof addr, port, sizeof port); VSL(SLT_SessionOpen, sp->fd, "%s %s %s %s", Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -129,7 +129,7 @@ */ static int -vbe_TryConnect(const struct sess *sp, int pf, const struct sockaddr *sa, +vbe_TryConnect(const struct sess *sp, int pf, const struct sockaddr_storage *sa, socklen_t salen, const struct vdi_simple *vs) { int s, i, tmo; @@ -148,10 +148,7 @@ tmo = (int)(tmod * 1000.0); - if (tmo > 0) - i = TCP_connect(s, sa, salen, tmo); - else - i = connect(s, sa, salen); + i = TCP_connect(s, sa, salen, tmo); if (i != 0) { AZ(close(s)); Modified: trunk/varnish-cache/bin/varnishd/cache_backend.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend.h 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_backend.h 2010-10-04 09:42:11 UTC (rev 5393) @@ -122,9 +122,9 @@ char *ipv6_addr; char *port; - struct sockaddr *ipv4; + struct sockaddr_storage *ipv4; socklen_t ipv4len; - struct sockaddr *ipv6; + struct sockaddr_storage *ipv6; socklen_t ipv6len; unsigned n_conn; Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -151,11 +151,12 @@ */ static void -copy_sockaddr(struct sockaddr **sa, socklen_t *len, const unsigned char *src) +copy_sockaddr(struct sockaddr_storage **sa, socklen_t *len, + const unsigned char *src) { assert(*src > 0); - *sa = malloc(*src); + *sa = malloc(*src); /* XXX: malloc(sizeof **sa) ? */ XXXAN(*sa); memcpy(*sa, src + 1, *src); *len = *src; Modified: trunk/varnish-cache/bin/varnishd/cache_backend_poll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_poll.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_backend_poll.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -109,7 +109,7 @@ */ static int -vbp_connect(int pf, const struct sockaddr *sa, socklen_t salen, int tmo) +vbp_connect(int pf, const struct sockaddr_storage *sa, socklen_t salen, int tmo) { int s, i; Modified: trunk/varnish-cache/bin/varnishd/cache_dir_dns.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -128,17 +128,17 @@ /* Check if a backends socket is the same as addr */ static int vdi_dns_comp_addrinfo(const struct director *dir, - struct sockaddr *addr, + struct sockaddr_storage *addr, const socklen_t len) { struct backend *bp; bp = vdi_get_backend_if_simple(dir); AN(bp); - if (addr->sa_family == PF_INET && bp->ipv4) { + if (addr->ss_family == PF_INET && bp->ipv4) { return (vdi_dns_comp_addrinfo4(bp, (struct sockaddr_in *) addr, len)); - } else if (addr->sa_family == PF_INET6 && bp->ipv6) { + } else if (addr->ss_family == PF_INET6 && bp->ipv6) { return (vdi_dns_comp_addrinfo6(bp, (struct sockaddr_in6 *) addr, len)); } @@ -298,8 +298,10 @@ continue; for (i = 0; i < vs->nhosts; i++) { + struct sockaddr_storage ss_hack; + memcpy(&ss_hack, res->ai_addr, res->ai_addrlen); if (vdi_dns_comp_addrinfo(vs->hosts[i], - res->ai_addr, res->ai_addrlen)) { + &ss_hack, res->ai_addrlen)) { new->hosts[host] = vs->hosts[i]; CHECK_OBJ_NOTNULL(new->hosts[host], DIRECTOR_MAGIC); Modified: trunk/varnish-cache/bin/varnishd/cache_session.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_session.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_session.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -169,7 +169,7 @@ sp->sockaddrlen = sizeof(sm->sockaddr[0]); sp->mysockaddr = (void*)(&sm->sockaddr[1]); sp->mysockaddrlen = sizeof(sm->sockaddr[1]); - sp->sockaddr->sa_family = sp->mysockaddr->sa_family = PF_UNSPEC; + sp->sockaddr->ss_family = sp->mysockaddr->ss_family = PF_UNSPEC; sp->t_open = NAN; sp->t_req = NAN; sp->t_resp = NAN; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -291,7 +291,7 @@ return(sp->vbc->backend->vcl_name); } -struct sockaddr * +struct sockaddr_storage * VRT_r_beresp_backend_ip(const struct sess *sp) { @@ -480,20 +480,20 @@ /*--------------------------------------------------------------------*/ -struct sockaddr * +struct sockaddr_storage * VRT_r_client_ip(const struct sess *sp) { return (sp->sockaddr); } -struct sockaddr * +struct sockaddr_storage * VRT_r_server_ip(struct sess *sp) { int i; - if (sp->mysockaddr->sa_family == AF_UNSPEC) { - i = getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen); + if (sp->mysockaddr->ss_family == AF_UNSPEC) { + i = getsockname(sp->fd, (void*)sp->mysockaddr, &sp->mysockaddrlen); assert(TCP_Check(i)); } @@ -531,8 +531,8 @@ VRT_r_server_port(struct sess *sp) { - if (sp->mysockaddr->sa_family == AF_UNSPEC) - AZ(getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen)); + if (sp->mysockaddr->ss_family == AF_UNSPEC) + AZ(getsockname(sp->fd, (void*)sp->mysockaddr, &sp->mysockaddrlen)); return (TCP_port(sp->mysockaddr)); } Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/include/libvarnish.h 2010-10-04 09:42:11 UTC (rev 5393) @@ -76,10 +76,10 @@ int TCP_nonblocking(int sock); int TCP_linger(int sock, int linger); #ifdef SOL_SOCKET -int TCP_port(const struct sockaddr *addr); -void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, +int TCP_port(const struct sockaddr_storage *addr); +void TCP_name(const struct sockaddr_storage *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen); -int TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, +int TCP_connect(int s, const struct sockaddr_storage *name, socklen_t namelen, int msec); void TCP_close(int *s); void TCP_set_read_timeout(int s, double seconds); Modified: trunk/varnish-cache/lib/libvarnish/tcp.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/tcp.c 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/lib/libvarnish/tcp.c 2010-10-04 09:42:11 UTC (rev 5393) @@ -64,14 +64,14 @@ /*--------------------------------------------------------------------*/ int -TCP_port(const struct sockaddr *addr) +TCP_port(const struct sockaddr_storage *addr) { - if (addr->sa_family == AF_INET) { + if (addr->ss_family == AF_INET) { const struct sockaddr_in *ain = (const void *)addr; return ntohs((ain->sin_port)); } - if (addr->sa_family == AF_INET6) { + if (addr->ss_family == AF_INET6) { const struct sockaddr_in6 *ain = (const void *)addr; return ntohs((ain->sin6_port)); } @@ -82,12 +82,12 @@ /*--------------------------------------------------------------------*/ void -TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, - char *pbuf, unsigned plen) +TCP_name(const struct sockaddr_storage *addr, unsigned l, + char *abuf, unsigned alen, char *pbuf, unsigned plen) { int i; - i = getnameinfo(addr, l, abuf, alen, pbuf, plen, + i = getnameinfo((const void *)addr, l, abuf, alen, pbuf, plen, NI_NUMERICHOST | NI_NUMERICSERV); if (i) { /* @@ -113,12 +113,11 @@ TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen) { struct sockaddr_storage addr_s; - struct sockaddr *addr = (void*)&addr_s; socklen_t l; l = sizeof addr_s; - AZ(getsockname(sock, addr, &l)); - TCP_name(addr, l, abuf, alen, pbuf, plen); + AZ(getsockname(sock, (void *)&addr_s, &l)); + TCP_name(&addr_s, l, abuf, alen, pbuf, plen); } /*--------------------------------------------------------------------*/ @@ -126,12 +125,11 @@ TCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen) { struct sockaddr_storage addr_s; - struct sockaddr *addr = (void*)&addr_s; socklen_t l; l = sizeof addr_s; - if (!getpeername(sock, addr, &l)) - TCP_name(addr, l, abuf, alen, pbuf, plen); + if (!getpeername(sock, (void*)&addr_s, &l)) + TCP_name(&addr_s, l, abuf, alen, pbuf, plen); else { strlcpy(abuf, "", alen); strlcpy(pbuf, "", plen); @@ -209,7 +207,7 @@ */ int -TCP_connect(int s, const struct sockaddr *name, socklen_t namelen, int msec) +TCP_connect(int s, const struct sockaddr_storage *name, socklen_t namelen, int msec) { int i, k; socklen_t l; @@ -218,13 +216,15 @@ assert(s >= 0); /* Set the socket non-blocking */ - (void)TCP_nonblocking(s); + if (msec > 0) + (void)TCP_nonblocking(s); /* Attempt the connect */ - i = connect(s, name, namelen); + i = connect(s, (const void *)name, namelen); if (i == 0 || errno != EINPROGRESS) return (i); + assert(msec > 0); /* Exercise our patience, polling for write */ fds[0].fd = s; fds[0].events = POLLWRNORM; Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-10-04 09:00:53 UTC (rev 5392) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-10-04 09:42:11 UTC (rev 5393) @@ -405,7 +405,7 @@ # VCL to C type conversion vcltypes = { - 'IP': "struct sockaddr *", + 'IP': "struct sockaddr_storage *", 'STRING': "const char *", 'BOOL': "unsigned", 'BACKEND': "struct director *", From phk at varnish-cache.org Mon Oct 4 09:48:34 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 11:48:34 +0200 Subject: r5394 - in trunk/varnish-cache: bin/varnishd include Message-ID: Author: phk Date: 2010-10-04 11:48:32 +0200 (Mon, 04 Oct 2010) New Revision: 5394 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/include/vrt.h Log: One more sockaddr -> sockaddr_storage conversion Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-04 09:42:11 UTC (rev 5393) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-04 09:48:32 UTC (rev 5394) @@ -282,7 +282,7 @@ /*--------------------------------------------------------------------*/ char * -VRT_IP_string(const struct sess *sp, const struct sockaddr *sa) +VRT_IP_string(const struct sess *sp, const struct sockaddr_storage *sa) { char *p; const struct sockaddr_in *si4; @@ -290,7 +290,7 @@ const void *addr; int len; - switch (sa->sa_family) { + switch (sa->ss_family) { case AF_INET: len = INET_ADDRSTRLEN; si4 = (const void *)sa; @@ -306,7 +306,7 @@ } XXXAN(len); AN(p = WS_Alloc(sp->http->ws, len)); - AN(inet_ntop(sa->sa_family, addr, p, len)); + AN(inet_ntop(sa->ss_family, addr, p, len)); return (p); } Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-10-04 09:42:11 UTC (rev 5393) +++ trunk/varnish-cache/include/vrt.h 2010-10-04 09:48:32 UTC (rev 5394) @@ -38,7 +38,7 @@ struct cli; struct director; struct VCL_conf; -struct sockaddr; +struct sockaddr_storage; /* * A backend probe specification @@ -209,7 +209,7 @@ /* Convert things to string */ -char *VRT_IP_string(const struct sess *sp, const struct sockaddr *sa); +char *VRT_IP_string(const struct sess *sp, const struct sockaddr_storage *sa); char *VRT_int_string(const struct sess *sp, int); char *VRT_double_string(const struct sess *sp, double); char *VRT_time_string(const struct sess *sp, double); From phk at varnish-cache.org Mon Oct 4 09:49:07 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 11:49:07 +0200 Subject: r5395 - trunk/varnish-cache/lib/libvmod_std Message-ID: Author: phk Date: 2010-10-04 11:49:04 +0200 (Mon, 04 Oct 2010) New Revision: 5395 Modified: trunk/varnish-cache/lib/libvmod_std/vmod.py Log: And one more sockaddr -> sockaddr_storage conversion Modified: trunk/varnish-cache/lib/libvmod_std/vmod.py =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-04 09:48:32 UTC (rev 5394) +++ trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-04 09:49:04 UTC (rev 5395) @@ -49,7 +49,7 @@ type_tab = dict() ctypes = { - 'IP': "struct sockaddr *", + 'IP': "struct sockaddr_storage *", 'STRING': "const char *", 'STRING_LIST': "const char *, ...", 'BOOL': "unsigned", From tfheen at varnish-cache.org Mon Oct 4 13:10:19 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Mon, 4 Oct 2010 15:10:19 +0200 Subject: r5396 - branches/2.1/varnish-tools/nagios Message-ID: Author: tfheen Date: 2010-10-04 15:10:19 +0200 (Mon, 04 Oct 2010) New Revision: 5396 Modified: branches/2.1/varnish-tools/nagios/check_varnish.c Log: Remove explicit handling of uptime in nagios plugin This makes it compile against 2.1.4 again Modified: branches/2.1/varnish-tools/nagios/check_varnish.c =================================================================== --- branches/2.1/varnish-tools/nagios/check_varnish.c 2010-10-04 09:49:04 UTC (rev 5395) +++ branches/2.1/varnish-tools/nagios/check_varnish.c 2010-10-04 13:10:19 UTC (rev 5396) @@ -166,18 +166,10 @@ check_stats(struct varnish_stats *VSL_stats, char *param) { const char *info; - struct timeval tv; - double up; intmax_t value; int status; - gettimeofday(&tv, NULL); - up = tv.tv_sec - VSL_stats->start_time; - if (strcmp(param, "uptime") == 0) { - value = up; - info = "Uptime"; - } - else if (strcmp(param, "ratio") == 0) { + if (strcmp(param, "ratio") == 0) { intmax_t total = VSL_stats->cache_hit + VSL_stats->cache_miss; value = total ? (100 * VSL_stats->cache_hit / total) : 0; @@ -224,7 +216,6 @@ "identifier listed in the left column by 'varnishstat -l'. In\n" "addition, the following parameters are available:\n" "\n" - "uptime How long the cache has been running (in seconds)\n" "ratio The cache hit ratio expressed as a percentage of hits to\n" " hits + misses. Default thresholds are 95 and 90.\n" "usage Cache file usage as a percentage of the total cache space.\n" From phk at varnish-cache.org Mon Oct 4 15:03:05 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 17:03:05 +0200 Subject: r5397 - in trunk/varnish-cache: bin/varnishd lib/libvarnish Message-ID: Author: phk Date: 2010-10-04 17:03:05 +0200 (Mon, 04 Oct 2010) New Revision: 5397 Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c trunk/varnish-cache/bin/varnishd/common.h trunk/varnish-cache/lib/libvarnish/vss.c Log: More sockaddr->sockaddr_storage cleanup Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-04 13:10:19 UTC (rev 5396) +++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-04 15:03:05 UTC (rev 5397) @@ -156,7 +156,7 @@ { assert(*src > 0); - *sa = malloc(*src); /* XXX: malloc(sizeof **sa) ? */ + *sa = malloc(*src); XXXAN(*sa); memcpy(*sa, src + 1, *src); *len = *src; Modified: trunk/varnish-cache/bin/varnishd/common.h =================================================================== --- trunk/varnish-cache/bin/varnishd/common.h 2010-10-04 13:10:19 UTC (rev 5396) +++ trunk/varnish-cache/bin/varnishd/common.h 2010-10-04 15:03:05 UTC (rev 5397) @@ -30,7 +30,6 @@ */ struct cli; -struct sockaddr; extern pid_t mgt_pid; #define ASSERT_MGT() do { assert(getpid() == mgt_pid);} while (0) Modified: trunk/varnish-cache/lib/libvarnish/vss.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vss.c 2010-10-04 13:10:19 UTC (rev 5396) +++ trunk/varnish-cache/lib/libvarnish/vss.c 2010-10-04 15:03:05 UTC (rev 5397) @@ -62,10 +62,7 @@ int va_socktype; int va_protocol; socklen_t va_addrlen; - union { - struct sockaddr_storage _storage; - struct sockaddr sa; - } va_addr; + struct sockaddr_storage va_addr; }; /*lint -esym(754, _storage) not ref */ @@ -224,7 +221,7 @@ return (-1); } #endif - if (bind(sd, &va->va_addr.sa, va->va_addrlen) != 0) { + if (bind(sd, (const void*)&va->va_addr, va->va_addrlen) != 0) { perror("bind()"); (void)close(sd); return (-1); @@ -272,7 +269,7 @@ } if (nonblock) (void)TCP_nonblocking(sd); - i = connect(sd, &va->va_addr.sa, va->va_addrlen); + i = connect(sd, (const void *)&va->va_addr, va->va_addrlen); if (i == 0 || (nonblock && errno == EINPROGRESS)) return (sd); perror("connect()"); From phk at varnish-cache.org Mon Oct 4 15:06:23 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 17:06:23 +0200 Subject: r5398 - trunk/varnish-cache/include Message-ID: Author: phk Date: 2010-10-04 17:06:23 +0200 (Mon, 04 Oct 2010) New Revision: 5398 Modified: trunk/varnish-cache/include/vrt.h Log: Minor constification Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-10-04 15:03:05 UTC (rev 5397) +++ trunk/varnish-cache/include/vrt.h 2010-10-04 15:06:23 UTC (rev 5398) @@ -200,7 +200,7 @@ typedef int vmod_init_f(struct vmod_priv *, const struct VCL_conf *); static inline void -vmod_priv_fini(struct vmod_priv *p) +vmod_priv_fini(const struct vmod_priv *p) { if (p->priv != (void*)0 && p->free != (void*)0) From phk at varnish-cache.org Mon Oct 4 15:24:33 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 4 Oct 2010 17:24:33 +0200 Subject: r5399 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-04 17:24:33 +0200 (Mon, 04 Oct 2010) New Revision: 5399 Modified: trunk/varnish-cache/bin/varnishd/default.vcl Log: Handle "Vary: *" headers by sending the object to pass, there really isn't anything else we can do sensibly. Fixes: #787 Modified: trunk/varnish-cache/bin/varnishd/default.vcl =================================================================== --- trunk/varnish-cache/bin/varnishd/default.vcl 2010-10-04 15:06:23 UTC (rev 5398) +++ trunk/varnish-cache/bin/varnishd/default.vcl 2010-10-04 15:24:33 UTC (rev 5399) @@ -111,6 +111,9 @@ if (beresp.http.Set-Cookie) { return (pass); } + if (beresp.http.Vary == "*") { + return (pass); + } return (deliver); } From tfheen at varnish-cache.org Tue Oct 5 08:03:38 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 5 Oct 2010 10:03:38 +0200 Subject: r5400 - branches/2.1/varnish-cache/lib/libvarnishapi Message-ID: Author: tfheen Date: 2010-10-05 10:03:38 +0200 (Tue, 05 Oct 2010) New Revision: 5400 Modified: branches/2.1/varnish-cache/lib/libvarnishapi/Makefile.am Log: Merge bits of r4887: Add bits from libvarnish to libvarnishapi for improved stand-alone-ish-ness. Modified: branches/2.1/varnish-cache/lib/libvarnishapi/Makefile.am =================================================================== --- branches/2.1/varnish-cache/lib/libvarnishapi/Makefile.am 2010-10-04 15:24:33 UTC (rev 5399) +++ branches/2.1/varnish-cache/lib/libvarnishapi/Makefile.am 2010-10-05 08:03:38 UTC (rev 5400) @@ -1,15 +1,19 @@ # $Id$ -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_srcdir)/include @PCRE_CFLAGS@ lib_LTLIBRARIES = libvarnishapi.la libvarnishapi_la_LDFLAGS = -version-info 1:0:0 libvarnishapi_la_SOURCES = \ + ../libvarnish/assert.c \ + ../libvarnish/vre.c \ base64.c \ instance.c \ shmlog.c libvarnishapi_la_CFLAGS = \ -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' + +libvarnishapi_la_LIBADD = @PCRE_LIBS@ From phk at varnish-cache.org Tue Oct 5 09:00:23 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 11:00:23 +0200 Subject: r5401 - in trunk/varnish-cache: bin/varnishd include lib/libvarnish lib/libvcl lib/libvmod_std Message-ID: Author: phk Date: 2010-10-05 11:00:23 +0200 (Tue, 05 Oct 2010) New Revision: 5401 Modified: trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/cache_lck.c trunk/varnish-cache/bin/varnishd/cache_vrt_vmod.c trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c trunk/varnish-cache/bin/varnishd/hash_critbit.c trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvarnish/Makefile.am trunk/varnish-cache/lib/libvarnish/binary_heap.c trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_expr.c trunk/varnish-cache/lib/libvcl/vcc_token.c trunk/varnish-cache/lib/libvcl/vcc_vmod.c trunk/varnish-cache/lib/libvmod_std/vmod.py trunk/varnish-cache/lib/libvmod_std/vmod.vcc trunk/varnish-cache/lib/libvmod_std/vmod_std.c Log: Nitpicking whitespace, licenses and warnings about generated files. Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-05 09:00:23 UTC (rev 5401) @@ -104,7 +104,16 @@ # Turn the default.vcl file into a C-string we can include in the program. # default_vcl.h: default.vcl Makefile - sed -e 's/"/\\"/g' -e 's/$$/\\n"/' -e 's/^/ "/' $(srcdir)/default.vcl > $@ + echo '/*' > $@ + echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@ + echo ' *' >> $@ + echo ' * Edit default.vcl instead and run make' >> $@ + echo ' *' >> $@ + echo ' */' >> $@ + echo '' >> $@ + sed -e 's/"/\\"/g' \ + -e 's/$$/\\n"/' \ + -e 's/^/ "/' $(srcdir)/default.vcl >> $@ # Explicitly record dependency mgt_vcc.c: default_vcl.h Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -275,7 +275,7 @@ if (st->len == 0) { VTAILQ_REMOVE(&sp->obj->store, st, list); STV_free(st); - } else + } else STV_trim(st, st->len); return (1); Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_lck.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/cache_lck.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -204,8 +204,8 @@ { AZ(pthread_mutex_init(&lck_mtx, NULL)); -#define LOCK(nam) \ - lck_##nam = VSM_Alloc(sizeof(struct vsc_lck), \ +#define LOCK(nam) \ + lck_##nam = VSM_Alloc(sizeof(struct vsc_lck), \ VSC_CLASS, VSC_TYPE_LCK, #nam); #include "locks.h" #undef LOCK Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_vmod.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_vmod.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_vmod.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -54,9 +54,9 @@ int ref; - char *nm; - char *path; - void *hdl; + char *nm; + char *path; + void *hdl; const void *funcs; int funclen; }; Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -86,7 +86,7 @@ assert(sp->fd >= 0); if(ev->portev_events & POLLERR) { vca_del(sp->fd); - VTAILQ_REMOVE(&sesshead, sp, list); + VTAILQ_REMOVE(&sesshead, sp, list); vca_close_session(sp, "EOF"); SES_Delete(sp); return; @@ -99,7 +99,7 @@ return; } - /* + /* * note: the original man page for port_associate(3C) states: * * When an event for a PORT_SOURCE_FD object is retrieved, @@ -146,7 +146,7 @@ */ static struct timespec min_ts = {0L, 100L /*ms*/ * 1000L /*us*/ * 1000L /*ns*/}; static double min_t = 0.1; /* 100 ms*/ - static struct timespec max_ts = {1L, 0L}; /* 1 second */ + static struct timespec max_ts = {1L, 0L}; /* 1 second */ static double max_t = 1.0; /* 1 second */ struct timespec ts; Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -470,7 +470,7 @@ u = oh->refcnt; if (u > 0) oh->refcnt++; - else + else with_lock = 1; Lck_Unlock(&oh->mtx); if (u > 0) Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/include/vrt.h 2010-10-05 09:00:23 UTC (rev 5401) @@ -199,7 +199,7 @@ typedef int vmod_init_f(struct vmod_priv *, const struct VCL_conf *); -static inline void +static inline void vmod_priv_fini(const struct vmod_priv *p) { Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-05 09:00:23 UTC (rev 5401) @@ -42,6 +42,13 @@ [ "$$V" = "exported" ] && [ -e svn_version.c ] && exit 0 ; \ if [ "/* $$V */" != "$$H" ]; then \ ( \ + echo '/*' ;\ + echo ' * NB: This file is machine generated, DO NOT EDIT!' ;\ + echo ' *' ;\ + echo ' * Run make to regenerate' ;\ + echo ' *' ;\ + echo ' */' ;\ + echo '' ;\ echo "/* $$V */" ;\ echo "#include " ;\ echo "const char* svn_version(void)" ;\ Modified: trunk/varnish-cache/lib/libvarnish/binary_heap.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/binary_heap.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvarnish/binary_heap.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -303,7 +303,7 @@ assert(!bh->cmp(bh->priv, A(bh, u), A(bh, v))); } } -#endif +#endif void * binheap_root(const struct binheap *bh) Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -101,8 +101,8 @@ { INT, T_DECR, INT }, { INT, T_MUL, INT }, { INT, T_DIV, INT }, - { INT, '=', INT }, - { INT, 0, INT }, + { INT, '=', INT }, + { INT, 0, INT }, { TIME, T_INCR, DURATION }, { TIME, T_DECR, DURATION }, { TIME, T_MUL, REAL }, @@ -115,7 +115,7 @@ { DURATION, T_DIV, REAL }, { DURATION, '=', DURATION }, { DURATION, 0, DURATION }, - { VOID, '=', VOID } + { VOID, '=', VOID } }; static void @@ -138,7 +138,7 @@ continue; if (ap->oper != tl->t->tok) continue; - if (ap->oper != '=') + if (ap->oper != '=') Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); vcc_NextToken(tl); fmt = ap->want; Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * XXX: add VRT_count()'s + * XXX: add VRT_count()'s */ #include "config.h" @@ -257,7 +257,7 @@ e = vcc_new_expr(); while (*p != '\0') { if (*p == '\n') { - if (!nl) + if (!nl) vsb_putc(e->vsb, *p); nl = 1; p++; @@ -268,14 +268,14 @@ vsb_putc(e->vsb, *p); p++; continue; - } + } assert(*p == '\v'); p++; switch(*p) { case '+': vsb_cat(e->vsb, "\v+"); break; case '-': vsb_cat(e->vsb, "\v-"); break; - case '1': - case '2': + case '1': + case '2': if (*p == '1') vsb_cat(e->vsb, vsb_data(e1->vsb)); else { @@ -478,7 +478,7 @@ "\v+\n\v1,\nvrt_magic_string_end\v-", e1, NULL); } - if (*p != '\0') + if (*p != '\0') SkipToken(tl, ','); } *e = vcc_expr_edit((*e)->fmt, q, *e, e1); @@ -650,7 +650,7 @@ case INT: f2 = INT; break; case DURATION: f2 = REAL; break; default: - if (tl->t->tok != '*' && tl->t->tok != '/') + if (tl->t->tok != '*' && tl->t->tok != '/') return; vsb_printf(tl->sb, "Operator %.*s not possible on type %s.\n", PF(tl->t), vcc_Type(f2)); @@ -719,7 +719,7 @@ case TIME: break; case DURATION: break; default: - if (tl->t->tok != '+' && tl->t->tok != '-') + if (tl->t->tok != '+' && tl->t->tok != '-') return; vsb_printf(tl->sb, "Operator %.*s not possible on type %s.\n", PF(tl->t), vcc_Type(f2)); @@ -755,7 +755,7 @@ * SYNTAX: * ExprCmp: * ExprAdd - * ExprAdd Relation ExprAdd + * ExprAdd Relation ExprAdd * ExprAdd(STRING) '~' CString * ExprAdd(STRING) '!~' CString * ExprAdd(IP) '~' IP @@ -763,7 +763,7 @@ */ static const struct cmps { - enum var_type fmt; + enum var_type fmt; unsigned token; const char *emit; } vcc_cmps[] = { @@ -802,7 +802,7 @@ vcc_expr_add(tl, e, fmt); ERRCHK(tl); - if ((*e)->fmt == BOOL) + if ((*e)->fmt == BOOL) return; tk = tl->t; @@ -823,7 +823,7 @@ *e = vcc_expr_edit(BOOL, cp->emit, *e, e2); return; } - if ((*e)->fmt == STRING && + if ((*e)->fmt == STRING && (tl->t->tok == '~' || tl->t->tok == T_NOMATCH)) { not = tl->t->tok == '~' ? "" : "!"; vcc_NextToken(tl); @@ -835,7 +835,7 @@ *e = vcc_expr_edit(BOOL, buf, *e, NULL); return; } - if ((*e)->fmt == IP && + if ((*e)->fmt == IP && (tl->t->tok == '~' || tl->t->tok == T_NOMATCH)) { not = tl->t->tok == '~' ? "" : "!"; vcc_NextToken(tl); @@ -851,7 +851,7 @@ *e = vcc_expr_edit(BOOL, buf, *e, NULL); return; } - if ((*e)->fmt == BACKEND && + if ((*e)->fmt == BACKEND && (tl->t->tok == T_EQ || tl->t->tok == T_NEQ)) { vcc_NextToken(tl); ExpectErr(tl, ID); @@ -894,7 +894,7 @@ { struct expr *e2; struct token *tk; - + *e = NULL; if (fmt != BOOL || tl->t->tok != '!') { vcc_expr_cmp(tl, e, fmt); @@ -964,7 +964,7 @@ *e = NULL; vcc_expr_cand(tl, e, fmt); ERRCHK(tl); - if ((*e)->fmt != BOOL || tl->t->tok != T_COR) + if ((*e)->fmt != BOOL || tl->t->tok != T_COR) return; *e = vcc_expr_edit(BOOL, "(\v+\n\v1", *e, NULL); while (tl->t->tok == T_COR) { Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -171,11 +171,11 @@ x = y = 0; for (p = l; p < le && *p != '\n'; p++) { - if (p >= b && p < e) + if (p >= b && p < e) c = '#'; else c = '-'; - + if (*p == '\t') { y &= ~7; y += 8; Modified: trunk/varnish-cache/lib/libvcl/vcc_vmod.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -71,7 +71,7 @@ return; } if (osym != NULL) { - vsb_printf(tl->sb, "Module %.*s already imported.\n", + vsb_printf(tl->sb, "Module %.*s already imported.\n", PF(mod)); vcc_ErrWhere2(tl, t1, tl->t); vsb_printf(tl->sb, "Previous import was here:\n"); @@ -110,7 +110,7 @@ hdl = dlopen(fn, RTLD_NOW | RTLD_LOCAL); if (hdl == NULL) { - vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", + vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", PF(mod), fn, dlerror()); vcc_ErrWhere(tl, mod); return; @@ -118,13 +118,13 @@ modname = dlsym(hdl, "Vmod_Name"); if (modname == NULL) { - vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", + vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", PF(mod), fn, "Symbol Vmod_Name not found"); vcc_ErrWhere(tl, mod); return; } if (!vcc_IdIs(mod, modname)) { - vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n", + vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n", PF(mod), fn); vsb_printf(tl->sb, "\tModule has wrong name: <%s>\n", modname); vcc_ErrWhere(tl, mod); @@ -133,14 +133,14 @@ proto = dlsym(hdl, "Vmod_Proto"); if (proto == NULL) { - vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", + vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", PF(mod), fn, "Symbol Vmod_Proto not found"); vcc_ErrWhere(tl, mod); return; } spec = dlsym(hdl, "Vmod_Spec"); if (spec == NULL) { - vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", + vsb_printf(tl->sb, "Could not load module %.*s\n\t%s\n\t%s\n", PF(mod), fn, "Symbol Vmod_Spec not found"); vcc_ErrWhere(tl, mod); return; Modified: trunk/varnish-cache/lib/libvmod_std/vmod.py =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-05 09:00:23 UTC (rev 5401) @@ -80,7 +80,7 @@ global plist global slist global tdl - print(fname, rval, args) + #print(fname, rval, args) proto = ctypes[rval] + " vmod_" + fname + "(struct sess *" sproto = ctypes[rval] + " td_" + modname + "_" + fname + "(struct sess *" @@ -118,6 +118,9 @@ for l0 in f: # print("# " + l0) + l0=l0.strip() + if l0 == "": + continue i = l0.find("#") if i == 0: continue @@ -175,9 +178,25 @@ ####################################################################### +def file_header(fo): + fo.write("""/* + * $%s$ + * + * NB: This file is machine generated, DO NOT EDIT! + * + * Edit vmod.vcc and run vmod.py instead + */ + +""" % "Id") + +####################################################################### + fc = open("vcc_if.c", "w") fh = open("vcc_if.h", "w") +file_header(fc) +file_header(fh) + fh.write('struct sess;\n') fh.write('struct VCL_conf;\n') fh.write('struct vmod_priv;\n') @@ -204,7 +223,7 @@ fc.write("const int Vmod_Len = sizeof(Vmod_Func);\n") fc.write("\n"); -fc.write('const char Vmod_Proto[] = \n') +fc.write('const char Vmod_Proto[] =\n') dumps(tdl); fc.write('\t"\\n"\n') dumps("struct Vmod_Func_" + modname + " {\n") Modified: trunk/varnish-cache/lib/libvmod_std/vmod.vcc =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod.vcc 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvmod_std/vmod.vcc 2010-10-05 09:00:23 UTC (rev 5401) @@ -1,3 +1,30 @@ +#- +# Copyright (c) 2010 Linpro AS +# All rights reserved. +# +# Author: Poul-Henning Kamp +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + Module std Init init_function Function STRING toupper(PRIV_CALL, STRING_LIST) Modified: trunk/varnish-cache/lib/libvmod_std/vmod_std.c =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-05 08:03:38 UTC (rev 5400) +++ trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-05 09:00:23 UTC (rev 5401) @@ -1,3 +1,31 @@ +/*- + * Copyright (c) 2010 Linpro AS + * All rights reserved. + * + * Author: Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include #include #include From phk at varnish-cache.org Tue Oct 5 09:04:37 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 11:04:37 +0200 Subject: r5402 - in trunk/varnish-cache: bin/varnishd bin/varnishtest/tests lib/libvmod_std Message-ID: Author: phk Date: 2010-10-05 11:04:36 +0200 (Tue, 05 Oct 2010) New Revision: 5402 Modified: trunk/varnish-cache/bin/varnishd/locks.h trunk/varnish-cache/bin/varnishtest/tests/c00037.vtc trunk/varnish-cache/bin/varnishtest/tests/c00038.vtc trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc trunk/varnish-cache/bin/varnishtest/tests/r00763.vtc trunk/varnish-cache/bin/varnishtest/tests/r00769.vtc trunk/varnish-cache/bin/varnishtest/tests/r00776.vtc trunk/varnish-cache/bin/varnishtest/tests/r00781.vtc trunk/varnish-cache/bin/varnishtest/tests/v00029.vtc trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc trunk/varnish-cache/lib/libvmod_std/Makefile.am trunk/varnish-cache/lib/libvmod_std/vmod.py trunk/varnish-cache/lib/libvmod_std/vmod_std.c Log: Add missing svn:keywords props Property changes on: trunk/varnish-cache/bin/varnishd/locks.h ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/c00037.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/c00038.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/m00000.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/r00763.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/r00769.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/r00776.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/bin/varnishtest/tests/r00781.vtc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/varnish-cache/bin/varnishtest/tests/v00029.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00029.vtc 2010-10-05 09:00:23 UTC (rev 5401) +++ trunk/varnish-cache/bin/varnishtest/tests/v00029.vtc 2010-10-05 09:04:36 UTC (rev 5402) @@ -1,4 +1,4 @@ -# $Id: v00028.vtc 5125 2010-08-25 08:57:04Z phk $ +# $Id$ test "DNS director" Property changes on: trunk/varnish-cache/bin/varnishtest/tests/v00029.vtc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-05 09:00:23 UTC (rev 5401) +++ trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-05 09:04:36 UTC (rev 5402) @@ -1,4 +1,4 @@ -# $Id: v00028.vtc 5125 2010-08-25 08:57:04Z phk $ +# $Id$ test "DNS director bad VCL tests" Property changes on: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/lib/libvmod_std/Makefile.am ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/lib/libvmod_std/vmod.py ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/lib/libvmod_std/vmod_std.c ___________________________________________________________________ Added: svn:keywords + Id From phk at varnish-cache.org Tue Oct 5 09:09:33 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 11:09:33 +0200 Subject: r5403 - in trunk/varnish-cache/lib: libvcl libvmod_std Message-ID: Author: phk Date: 2010-10-05 11:09:33 +0200 (Tue, 05 Oct 2010) New Revision: 5403 Modified: trunk/varnish-cache/lib/libvcl/symbol_kind.h trunk/varnish-cache/lib/libvcl/vcc_vmod.c trunk/varnish-cache/lib/libvmod_std/vmod.py Log: More svn:keywords fixups Modified: trunk/varnish-cache/lib/libvcl/symbol_kind.h =================================================================== --- trunk/varnish-cache/lib/libvcl/symbol_kind.h 2010-10-05 09:04:36 UTC (rev 5402) +++ trunk/varnish-cache/lib/libvcl/symbol_kind.h 2010-10-05 09:09:33 UTC (rev 5403) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: vcc_types.h 5163 2010-08-31 10:59:07Z phk $ + * $Id$ */ /*lint -save -e525 -e539 */ Property changes on: trunk/varnish-cache/lib/libvcl/symbol_kind.h ___________________________________________________________________ Added: svn:keywords + Id Property changes on: trunk/varnish-cache/lib/libvcl/vcc_vmod.c ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/varnish-cache/lib/libvmod_std/vmod.py =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-05 09:04:36 UTC (rev 5402) +++ trunk/varnish-cache/lib/libvmod_std/vmod.py 2010-10-05 09:09:33 UTC (rev 5403) @@ -180,14 +180,13 @@ def file_header(fo): fo.write("""/* - * $%s$ * * NB: This file is machine generated, DO NOT EDIT! * * Edit vmod.vcc and run vmod.py instead */ -""" % "Id") +""") ####################################################################### From phk at varnish-cache.org Tue Oct 5 09:11:57 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 11:11:57 +0200 Subject: r5404 - in trunk/varnish-cache: include lib/libvcl Message-ID: Author: phk Date: 2010-10-05 11:11:57 +0200 (Tue, 05 Oct 2010) New Revision: 5404 Modified: trunk/varnish-cache/include/vsc_all.h trunk/varnish-cache/lib/libvcl/generate.py Log: And a little bit more svn:keywords polishing Property changes on: trunk/varnish-cache/include/vsc_all.h ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-10-05 09:09:33 UTC (rev 5403) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-10-05 09:11:57 UTC (rev 5404) @@ -568,15 +568,12 @@ ####################################################################### def file_header(fo): - fo.write(""" -/* - * $%s$ - * + fo.write("""/* * NB: This file is machine generated, DO NOT EDIT! * * Edit and run generate.py instead */ -""" % "Id") +""") ####################################################################### From phk at varnish-cache.org Tue Oct 5 10:03:18 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 12:03:18 +0200 Subject: r5405 - in trunk/varnish-cache/lib: libvcl libvmod_std Message-ID: Author: phk Date: 2010-10-05 12:03:17 +0200 (Tue, 05 Oct 2010) New Revision: 5405 Modified: trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvmod_std/Makefile.am Log: Try to make makefiles both make and gmake compliant Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-10-05 09:11:57 UTC (rev 5404) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-10-05 10:03:17 UTC (rev 5405) @@ -22,7 +22,7 @@ vcc_dir_dns.c \ vcc_expr.c \ vcc_parse.c \ - $(builddir)/vcc_fixed_token.c \ + vcc_fixed_token.c \ vcc_obj.c \ vcc_string.c \ vcc_symb.c \ @@ -34,7 +34,7 @@ EXTRA_DIST = \ generate.py -$(builddir)/vcc_obj.c $(builddir)/vcc_fixed_token.c $(builddir)/vcc_token_defs.h: $(srcdir)/generate.py $(top_srcdir)/include/vrt.h +vcc_obj.c vcc_fixed_token.c vcc_token_defs.h: $(srcdir)/generate.py $(top_srcdir)/include/vrt.h @PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir) CLEANFILES = $(builddir)/vcc_token_defs.h \ Modified: trunk/varnish-cache/lib/libvmod_std/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvmod_std/Makefile.am 2010-10-05 09:11:57 UTC (rev 5404) +++ trunk/varnish-cache/lib/libvmod_std/Makefile.am 2010-10-05 10:03:17 UTC (rev 5405) @@ -7,10 +7,10 @@ libvmod_std_la_LDFLAGS = -version-info 1:0:0 libvmod_std_la_SOURCES = \ - $(builddir)/vcc_if.c \ + vcc_if.c \ vmod_std.c -$(builddir)/vcc_if.c $(builddir)/vcc_if.h: $(top_srcdir)/lib/libvmod_std/vmod.py $(top_srcdir)/lib/libvmod_std/vmod.vcc +vcc_if.c vcc_if.h: $(top_srcdir)/lib/libvmod_std/vmod.py $(top_srcdir)/lib/libvmod_std/vmod.vcc @PYTHON@ $(top_srcdir)/lib/libvmod_std/vmod.py $(top_srcdir)/lib/libvmod_std/vmod.vcc EXTRA_DIST = vmod.py vmod.vcc From phk at varnish-cache.org Tue Oct 5 10:13:07 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 12:13:07 +0200 Subject: r5406 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 12:13:07 +0200 (Tue, 05 Oct 2010) New Revision: 5406 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: See if a longer delay makes this test more predictable Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 10:03:17 UTC (rev 5405) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 10:13:07 UTC (rev 5406) @@ -64,7 +64,7 @@ } } -delay .5 +delay 1.5 varnish v1 -expect vmods == 0 From phk at varnish-cache.org Tue Oct 5 10:32:32 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 12:32:32 +0200 Subject: r5407 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 12:32:32 +0200 (Tue, 05 Oct 2010) New Revision: 5407 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try another way to evict all worker processes. Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 10:13:07 UTC (rev 5406) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 10:32:32 UTC (rev 5407) @@ -40,7 +40,6 @@ client c1 -run - varnish v1 -cliok "debug.vmod" varnish v1 -cliok "vcl.list" @@ -64,7 +63,5 @@ } } -delay 1.5 +varnish v1 -cliok "debug.vmod" varnish v1 -expect vmods == 0 - - From phk at varnish-cache.org Tue Oct 5 11:38:04 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 13:38:04 +0200 Subject: r5408 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 13:38:04 +0200 (Tue, 05 Oct 2010) New Revision: 5408 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try another tack: have only one threadpool Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 10:32:32 UTC (rev 5407) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-05 11:38:04 UTC (rev 5408) @@ -7,7 +7,7 @@ txresp -hdr "foo: bAr" -hdr "bar: fOo" -bodylen 4 } -start -varnish v1 -vcl+backend { +varnish v1 -arg "-pthread_pools=1" -vcl+backend { import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; sub vcl_deliver { From phk at varnish-cache.org Tue Oct 5 12:48:32 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 14:48:32 +0200 Subject: r5409 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 14:48:31 +0200 (Tue, 05 Oct 2010) New Revision: 5409 Modified: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc Log: Comment out this test until Kristian can do something about ticket #790 Modified: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-05 11:38:04 UTC (rev 5408) +++ trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-05 12:48:31 UTC (rev 5409) @@ -44,10 +44,11 @@ } } } -varnish v1 -badvcl { - director directorname dns { - .list = { - "192.168.16.255"/24; - } - } -} + +#varnish v1 -badvcl { +# director directorname dns { +# .list = { +# "192.168.16.255"/24; +# } +# } +#} From phk at varnish-cache.org Tue Oct 5 19:30:11 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 21:30:11 +0200 Subject: r5410 - trunk/varnish-cache/lib/libvmod_std Message-ID: Author: phk Date: 2010-10-05 21:30:11 +0200 (Tue, 05 Oct 2010) New Revision: 5410 Modified: trunk/varnish-cache/lib/libvmod_std/vmod_std.c Log: Ignore NULL pointers in vmod.to{upper|lower}() Modified: trunk/varnish-cache/lib/libvmod_std/vmod_std.c =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-05 12:48:31 UTC (rev 5409) +++ trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-05 19:30:11 UTC (rev 5410) @@ -55,11 +55,13 @@ e += u; p = s; while (p != vrt_magic_string_end && b < e) { - for (; b < e && *p != '\0'; p++) - if (up) - *b++ = toupper(*p); - else - *b++ = tolower(*p); + if (p != NULL) { + for (; b < e && *p != '\0'; p++) + if (up) + *b++ = toupper(*p); + else + *b++ = tolower(*p); + } p = va_arg(ap, const char *); } if (b < e) From phk at varnish-cache.org Tue Oct 5 19:33:35 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 21:33:35 +0200 Subject: r5411 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-05 21:33:34 +0200 (Tue, 05 Oct 2010) New Revision: 5411 Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c Log: Log the clients end of the tcp connection so we can find it in varnishlog output. Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-05 19:30:11 UTC (rev 5410) +++ trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-05 19:33:34 UTC (rev 5411) @@ -82,6 +82,7 @@ unsigned u; struct vsb *vsb; char *p; + char mabuf[32], mpbuf[32]; CAST_OBJ_NOTNULL(c, priv, CLIENT_MAGIC); AN(*c->connect); @@ -107,7 +108,9 @@ if (fd < 0) vtc_log(c->vl, 0, "Failed to open %s", vsb_data(vsb)); assert(fd >= 0); - vtc_log(vl, 3, "connected fd %d", fd); + TCP_myname(fd, mabuf, sizeof mabuf, mpbuf, sizeof mpbuf); + vtc_log(vl, 3, "connected fd %d from %s %s to %s", + fd, mabuf, mpbuf, vsb_data(vsb)); http_process(vl, c->spec, fd, -1); vtc_log(vl, 3, "closing fd %d", fd); TCP_close(&fd); From phk at varnish-cache.org Tue Oct 5 19:34:46 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 21:34:46 +0200 Subject: r5412 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 21:34:46 +0200 (Tue, 05 Oct 2010) New Revision: 5412 Modified: trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc Log: Rewrite this test to use semaphores instead of delays to make it more robust. Modified: trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc 2010-10-05 19:33:34 UTC (rev 5411) +++ trunk/varnish-cache/bin/varnishtest/tests/s00002.vtc 2010-10-05 19:34:46 UTC (rev 5412) @@ -2,10 +2,38 @@ test "Check grace with sick backends" -server s1 -repeat 4 { +server s1 { rxreq expect req.url == "/" - txresp -body "hi" + txresp -proto HTTP/1.0 -hdr "nbr: 1" -body "hi" + + accept + + rxreq + expect req.url == "/" + txresp -proto HTTP/1.0 -hdr "nbr: 2" -body "hi" + + sema r1 sync 2 + accept + + rxreq + expect req.url == "/" + txresp -proto HTTP/1.0 -hdr "nbr: 3" -hdr "foo: bar" -body "hi" + + accept + rxreq + expect req.url == "/" + txresp -proto HTTP/1.0 -status 400 -hdr "nbr: 4" -body "hi" + accept + + accept + rxreq + expect req.url == "/" + txresp -proto HTTP/1.0 -status 400 -hdr "nbr: 5" -body "hi" + accept + + sema r1 sync 2 + } -start varnish v1 -vcl { @@ -28,18 +56,20 @@ } } -start -delay 2 client c1 { + sema r1 sync 2 txreq -url "/" rxresp + expect resp.http.foo == "bar" expect resp.status == 200 } -run -delay 3 - client c2 { + sema r1 sync 2 txreq -url "/" rxresp + expect resp.http.foo == "bar" expect resp.status == 200 + expect resp.http.x-varnish == "1002 1001" } -run From phk at varnish-cache.org Tue Oct 5 19:35:18 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 21:35:18 +0200 Subject: r5413 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 21:35:16 +0200 (Tue, 05 Oct 2010) New Revision: 5413 Modified: trunk/varnish-cache/bin/varnishtest/tests/r00667.vtc Log: Use a semphore instead of a delay Modified: trunk/varnish-cache/bin/varnishtest/tests/r00667.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00667.vtc 2010-10-05 19:34:46 UTC (rev 5412) +++ trunk/varnish-cache/bin/varnishtest/tests/r00667.vtc 2010-10-05 19:35:16 UTC (rev 5413) @@ -5,13 +5,12 @@ server s1 { rxreq sema r1 sync 2 - delay 1 + sema r1 sync 2 # There is a race in varnish between the first request releasing # the backend connection, and the second request trying to get it # which makes reuse of backend connection sometimes work and # sometimes not. Solve by never reusing the backend connection. txresp -hdr "Connection: close" -bodylen 2 - expect_close accept rxreq txresp -bodylen 5 @@ -34,6 +33,7 @@ client c2 { sema r1 sync 2 txreq + sema r1 sync 2 rxresp expect resp.bodylen == 5 } -start From phk at varnish-cache.org Tue Oct 5 19:35:44 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Tue, 5 Oct 2010 21:35:44 +0200 Subject: r5414 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-05 21:35:42 +0200 (Tue, 05 Oct 2010) New Revision: 5414 Modified: trunk/varnish-cache/bin/varnishtest/tests/c00013.vtc Log: Use semaphores instead of delays to get the timing right here. Modified: trunk/varnish-cache/bin/varnishtest/tests/c00013.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/c00013.vtc 2010-10-05 19:35:16 UTC (rev 5413) +++ trunk/varnish-cache/bin/varnishtest/tests/c00013.vtc 2010-10-05 19:35:42 UTC (rev 5414) @@ -6,24 +6,26 @@ rxreq expect req.url == "/foo" send "HTTP/1.1 200 Ok\r\nConnection: close\r\n\r\n" - delay .5 + sema r1 sync 2 send "line1\n" - delay .5 + sema r1 sync 2 send "line2\n" } -start varnish v1 -vcl+backend { } -start client c1 { - txreq -url "/foo" + txreq -url "/foo" -hdr "client: c1" rxresp expect resp.status == 200 expect resp.http.content-length == 12 expect resp.http.x-varnish == "1001" } -start -delay .2 + client c2 { - txreq -url "/foo" + sema r1 sync 2 + txreq -url "/foo" -hdr "client: c2" + sema r1 sync 2 rxresp expect resp.status == 200 expect resp.http.content-length == 12 From phk at varnish-cache.org Wed Oct 6 18:08:13 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 6 Oct 2010 20:08:13 +0200 Subject: r5415 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-06 20:08:13 +0200 (Wed, 06 Oct 2010) New Revision: 5415 Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c Log: Implicitly wait on client to complete before we do anything disruptive to it's state. Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-05 19:35:42 UTC (rev 5414) +++ trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-06 18:08:13 UTC (rev 5415) @@ -63,6 +63,7 @@ unsigned repeat; pthread_t tp; + unsigned running; }; static VTAILQ_HEAD(, client) clients = @@ -171,6 +172,7 @@ CHECK_OBJ_NOTNULL(c, CLIENT_MAGIC); vtc_log(c->vl, 2, "Starting client"); AZ(pthread_create(&c->tp, NULL, client_thread, c)); + c->running = 1; } /********************************************************************** @@ -188,6 +190,7 @@ if (res != NULL) vtc_log(c->vl, 0, "Client returned \"%s\"", (char *)res); c->tp = 0; + c->running = 0; } /********************************************************************** @@ -240,6 +243,16 @@ for (; *av != NULL; av++) { if (vtc_error) break; + + if (!strcmp(*av, "-wait")) { + client_wait(c); + continue; + } + + /* Don't muck about with a running client */ + if (c->running) + client_wait(c); + if (!strcmp(*av, "-connect")) { bprintf(c->connect, "%s", av[1]); av++; @@ -254,10 +267,6 @@ client_start(c); continue; } - if (!strcmp(*av, "-wait")) { - client_wait(c); - continue; - } if (!strcmp(*av, "-run")) { client_run(c); continue; From phk at varnish-cache.org Wed Oct 6 18:08:53 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 6 Oct 2010 20:08:53 +0200 Subject: r5416 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-06 20:08:53 +0200 (Wed, 06 Oct 2010) New Revision: 5416 Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c Log: Wait 10 seconds for varnish to call home. Log PID of child process for aid logfile trawling Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-06 18:08:13 UTC (rev 5415) +++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-06 18:08:53 UTC (rev 5416) @@ -304,6 +304,8 @@ (void)close(i); AZ(execl("/bin/sh", "/bin/sh", "-c", vsb_data(vsb), NULL)); exit(1); + } else { + vtc_log(v->vl, 3, "PID: %d", v->pid); } AZ(close(v->fds[0])); AZ(close(v->fds[3])); @@ -315,7 +317,7 @@ /* Wait for the varnish to call home */ fd.fd = v->cli_fd; fd.events = POLLIN; - i = poll(&fd, 1, 6000); + i = poll(&fd, 1, 10000); if (i != 1) { AZ(close(v->fds[1])); (void)kill(v->pid, SIGKILL); From phk at varnish-cache.org Wed Oct 6 21:50:43 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 6 Oct 2010 23:50:43 +0200 Subject: r5417 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-06 23:50:42 +0200 (Wed, 06 Oct 2010) New Revision: 5417 Modified: trunk/varnish-cache/bin/varnishtest/tests/c00002.vtc Log: Make this test more robust Modified: trunk/varnish-cache/bin/varnishtest/tests/c00002.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/c00002.vtc 2010-10-06 18:08:53 UTC (rev 5416) +++ trunk/varnish-cache/bin/varnishtest/tests/c00002.vtc 2010-10-06 21:50:42 UTC (rev 5417) @@ -9,11 +9,10 @@ txresp -hdr "Connection: close" -body "012345\n" } -start -varnish v1 -arg "-p thread_pool_min=2 -p thread_pool_max=2 -p thread_pools=4" +varnish v1 -arg "-p thread_pool_min=2 -p thread_pool_max=8 -p thread_pools=4 -p thread_pool_purge_delay=10" varnish v1 -vcl+backend {} -start -varnish v1 -expect n_wrk_create == 8 client c1 { txreq -url "/" @@ -21,3 +20,5 @@ expect resp.status == 200 } -run +varnish v1 -cliok stats +varnish v1 -expect n_wrk == 8 From kristian at varnish-cache.org Thu Oct 7 15:44:31 2010 From: kristian at varnish-cache.org (kristian at varnish-cache.org) Date: Thu, 7 Oct 2010 17:44:31 +0200 Subject: r5418 - in trunk/varnish-cache: bin/varnishtest/tests lib/libvcl Message-ID: Author: kristian Date: 2010-10-07 17:44:31 +0200 (Thu, 07 Oct 2010) New Revision: 5418 Modified: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc trunk/varnish-cache/lib/libvcl/vcc_dir_dns.c Log: DNS Director VCC improvements: Don't assert() as much on syntax errors in VCL. Also adds a small test for incorrect headers. Modified: trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-06 21:50:42 UTC (rev 5417) +++ trunk/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-07 15:44:31 UTC (rev 5418) @@ -20,6 +20,14 @@ } } +varnish v9 -badvcl { + director directorname dns { + .list = { + .host_hdr = "192.168.1.1"; + "192.168.1.2"; + } + } +} varnish v1 -badvcl { director directorname dns { .list = { @@ -45,10 +53,10 @@ } } -#varnish v1 -badvcl { -# director directorname dns { -# .list = { -# "192.168.16.255"/24; -# } -# } -#} +varnish v1 -badvcl { + director directorname dns { + .list = { + "192.168.16.255"/24; + } + } +} Modified: trunk/varnish-cache/lib/libvcl/vcc_dir_dns.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_dir_dns.c 2010-10-06 21:50:42 UTC (rev 5417) +++ trunk/varnish-cache/lib/libvcl/vcc_dir_dns.c 2010-10-07 15:44:31 UTC (rev 5418) @@ -153,12 +153,14 @@ ip4 |= a[3] ; ip4end = ip4 | ~mask; - assert (ip4 == (ip4 & mask)); + if (ip4 != (ip4 & mask)) { + vsb_printf(tl->sb, "IP and network mask not compatible: "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + ERRCHK(tl); + } -/* printf("uip4: \t0x%.8X\na: \t0x", ip4,ip4); - for (int i=0;i<4;i++) printf("%.2X",a[i]); - printf("\nmask:\t0x%.8X\nend:\t0x%.8X\n", mask, ip4end); -*/ while (ip4 <= ip4end) { uint8_t *b; b=(uint8_t *)&ip4; @@ -256,13 +258,23 @@ int ret; ERRCHK(tl); SkipToken(tl, '{'); - if (tl->t->tok != CSTR) + if (tl->t->tok != CSTR) { vcc_dir_dns_parse_backend_options(tl); + ERRCHK(tl); + } + while (tl->t->tok == CSTR) { mask = 32; ret = sscanf(tl->t->dec, "%hhu.%hhu.%hhu.%hhu", &a[0], &a[1], &a[2], &a[3]); - assert(ret == 4); + if (ret != 4) { + vsb_printf(tl->sb, "Incomplete IP supplied: "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + ERRCHK(tl); + } + vcc_NextToken(tl); if (tl->t->tok == '/') { vcc_NextToken(tl); From martin at varnish-cache.org Fri Oct 8 11:48:35 2010 From: martin at varnish-cache.org (martin at varnish-cache.org) Date: Fri, 8 Oct 2010 13:48:35 +0200 Subject: r5419 - in trunk/varnish-cache: bin/varnishncsa doc/sphinx/reference Message-ID: Author: martin Date: 2010-10-08 13:48:35 +0200 (Fri, 08 Oct 2010) New Revision: 5419 Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst Log: Add a -o option to varnishncsa to allow filtering of output to only request groups which match a regular expression on a given tag. Add errors on -i and -I options in varnishncsa, as these options does not make sense for that utility. Add documentation to varnishncsa for -o option, and remove documentation for -i and -I. Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2010-10-07 15:44:31 UTC (rev 5418) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2010-10-08 11:48:35 UTC (rev 5419) @@ -79,6 +79,7 @@ #include "libvarnish.h" #include "vsl.h" +#include "vre.h" #include "varnishapi.h" static volatile sig_atomic_t reopen; @@ -98,12 +99,31 @@ char *df_u; /* %u, Remote user */ int active; /* Is log line in an active trans */ int complete; /* Is log line complete */ + int matched; /* Did log line match */ } **ll; static size_t nll; static int prefer_x_forwarded_for = 0; +static int o_flag = 0; +static int match_tag; +static vre_t *match_tag_re; + static int +name2tag(const char *n) +{ + int i; + + for (i = 0; i < 256; i++) { + if (VSL_tags[i] == NULL) + continue; + if (!strcasecmp(n, VSL_tags[i])) + return (i); + } + return (-1); +} + +static int isprefix(const char *str, const char *prefix, const char *end, const char **next) { @@ -313,6 +333,11 @@ assert(spec & VSL_S_CLIENT); end = ptr + len; + /* Do -o matching if specified */ + if (o_flag && match_tag == tag && lp->active && + VRE_exec(match_tag_re, ptr, len, 0, 0, NULL, 0) > 0) + lp->matched = 1; + switch (tag) { case SLT_ReqStart: if(lp->active || lp->df_h != NULL) { @@ -457,6 +482,10 @@ if(!lp->complete) return (reopen); + if (o_flag && !lp->matched) + /* -o is in effect matching rule failed. Don't display */ + return (reopen); + #if 0 /* non-optional fields */ if (!lp->df_m || !lp->df_Uq || !lp->df_H || !lp->df_s) { @@ -587,7 +616,7 @@ vd = VSM_New(); VSL_Setup(vd); - while ((c = getopt(argc, argv, VSL_ARGS "aDP:Vw:f")) != -1) { + while ((c = getopt(argc, argv, VSL_ARGS "aDP:Vw:fo")) != -1) { switch (c) { case 'a': a_flag = 1; @@ -611,9 +640,20 @@ fprintf(stderr, "-b is not valid for varnishncsa\n"); exit(1); break; + case 'i': + fprintf(stderr, "-i is not valid for varnishncsa\n"); + exit(1); + break; + case 'I': + fprintf(stderr, "-I is not valid for varnishncsa\n"); + exit(1); + break; case 'c': /* XXX: Silently ignored: it's required anyway */ break; + case 'o': + o_flag = 1; + break; default: if (VSL_Arg(vd, c, optarg) > 0) break; @@ -623,6 +663,26 @@ VSL_Arg(vd, 'c', optarg); + if (o_flag) { + const char *error; + int erroroffset; + + if (argc-optind != 2) { + fprintf(stderr, "Wrong number of arguments when using -o\n"); + exit(2); + } + match_tag = name2tag(argv[optind]); + if (match_tag < 0) { + fprintf(stderr, "Tag \"%s\" unknown\n", argv[optind]); + exit(2); + } + match_tag_re = VRE_compile(argv[optind + 1], 0, &error, &erroroffset); + if (match_tag_re==NULL) { + fprintf(stderr, "Invalid regex: %s\n", error); + exit(2); + } + } + if (VSL_Open(vd, 1)) exit(1); Modified: trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-10-07 15:44:31 UTC (rev 5418) +++ trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-10-08 11:48:35 UTC (rev 5419) @@ -48,13 +48,9 @@ -f Prefer the X-Forwarded-For HTTP header over client.ip in the log output. --I regex Include log entries which match the specified regular - expression. If neither -I nor -i is specified, - all log entries are included. +-o Filter log output to request groups that match a regular + expression on a specified tag. --i tag Include log entries with the specified tag. If neither -I nor - -i is specified, all log entries are included. - -n Specifies the name of the varnishd instance to get logs from. If -n is not specified, the host name is used. @@ -77,6 +73,10 @@ -x tag Exclude log entries with the specified tag. +If the -o option was specified, a tag and a regex argument must be given. +varnishncsa will then only log for request groups which include that tag +and the regular expression matches on that tag. + SEE ALSO ======== From phk at varnish-cache.org Mon Oct 11 11:49:22 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 11 Oct 2010 13:49:22 +0200 Subject: r5420 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-11 13:49:21 +0200 (Mon, 11 Oct 2010) New Revision: 5420 Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Convert REAL to string as needed. Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-08 11:48:35 UTC (rev 5419) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-11 11:49:21 UTC (rev 5420) @@ -362,6 +362,7 @@ case INT: p = "VRT_int_string(sp, \v1)"; break; case IP: p = "VRT_IP_string(sp, \v1)"; break; case TIME: p = "VRT_time_string(sp, \v1)"; break; + case REAL: p = "VRT_double_string(sp, \v1)"; break; case DURATION: p = "VRT_double_string(sp, \v1)"; break; /* XXX: should have "s" suffix ? */ default: break; From phk at varnish-cache.org Mon Oct 11 11:56:58 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 11 Oct 2010 13:56:58 +0200 Subject: r5421 - in trunk/varnish-cache: bin/varnishtest/tests lib/libvmod_std Message-ID: Author: phk Date: 2010-10-11 13:56:58 +0200 (Mon, 11 Oct 2010) New Revision: 5421 Added: trunk/varnish-cache/bin/varnishtest/tests/m00002.vtc Modified: trunk/varnish-cache/lib/libvmod_std/vmod.vcc trunk/varnish-cache/lib/libvmod_std/vmod_std.c Log: Add REAL std.random(REAL low, REAL high) with associated testcase. Example usage: sub vcl_fetch { /* Spread TTLs -10%..+5% because CMS timestamps whole minutes */ set beresp.ttl = beresp.ttl * random(0.90, 1.05); } This usage was one of the very first VCL examples we ever wrote on a whiteboard, we just never got a round tuit until now. Fixes: #793 Added: trunk/varnish-cache/bin/varnishtest/tests/m00002.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00002.vtc (rev 0) +++ trunk/varnish-cache/bin/varnishtest/tests/m00002.vtc 2010-10-11 11:56:58 UTC (rev 5421) @@ -0,0 +1,38 @@ +# $Id$ + +test "Test std.random" + +# needs random generator +random + +server s1 { + rxreq + txresp -proto HTTP/1.0 -nolen -bodylen 9 +} -start + +varnish v1 -vcl+backend { + import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; + + sub vcl_fetch { + set beresp.http.rnd1 = std.random(0,1); + set beresp.http.rnd2 = std.random(0,10); + set beresp.http.rnd3 = std.random(8,10); + set beresp.http.rnd4 = std.random(99,100); + } +} -start + +# NB: Do not change the number 1 +# NB: Only srandom(1) is standardized as deterministic. +varnish v1 -cliok "debug.srandom 1" + +client c1 { + txreq + rxresp + expect resp.http.rnd1 == 0.420 + expect resp.http.rnd2 == 1.972 + expect resp.http.rnd3 == 8.783 + expect resp.http.rnd4 == 99.399 + expect resp.bodylen == 9 +} -run + + Modified: trunk/varnish-cache/lib/libvmod_std/vmod.vcc =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod.vcc 2010-10-11 11:49:21 UTC (rev 5420) +++ trunk/varnish-cache/lib/libvmod_std/vmod.vcc 2010-10-11 11:56:58 UTC (rev 5421) @@ -30,3 +30,4 @@ Function STRING toupper(PRIV_CALL, STRING_LIST) Function STRING tolower(PRIV_VCL, STRING_LIST) Function VOID set_ip_tos(INT) +Function REAL random(REAL, REAL) Modified: trunk/varnish-cache/lib/libvmod_std/vmod_std.c =================================================================== --- trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-11 11:49:21 UTC (rev 5420) +++ trunk/varnish-cache/lib/libvmod_std/vmod_std.c 2010-10-11 11:56:58 UTC (rev 5421) @@ -120,3 +120,16 @@ priv->free = free; return (0); } + +double +vmod_random(struct sess *sp, double lo, double hi) +{ + double a; + + (void)sp; + + a = random() / (double)(1ULL<<32); + a *= hi - lo; + a += lo; + return (a); +} From phk at varnish-cache.org Mon Oct 11 20:07:11 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 11 Oct 2010 22:07:11 +0200 Subject: r5422 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: Author: phk Date: 2010-10-11 22:07:10 +0200 (Mon, 11 Oct 2010) New Revision: 5422 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Add conversion from BOOL to STRING Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-11 11:56:58 UTC (rev 5421) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-10-11 20:07:10 UTC (rev 5422) @@ -355,6 +355,14 @@ return (d->vcl_name); } +const char * +VRT_bool_string(const struct sess *sp, unsigned val) +{ + + (void)sp; + return (val ? "true" : "false"); +} + /*--------------------------------------------------------------------*/ void Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-10-11 11:56:58 UTC (rev 5421) +++ trunk/varnish-cache/include/vrt.h 2010-10-11 20:07:10 UTC (rev 5422) @@ -213,6 +213,7 @@ char *VRT_int_string(const struct sess *sp, int); char *VRT_double_string(const struct sess *sp, double); char *VRT_time_string(const struct sess *sp, double); +const char *VRT_bool_string(const struct sess *sp, unsigned); const char *VRT_backend_string(struct sess *sp, const struct director *d); #define VRT_done(sp, hand) \ Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-11 11:56:58 UTC (rev 5421) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-11 20:07:10 UTC (rev 5422) @@ -359,12 +359,12 @@ p = NULL; switch((*e)->fmt) { case BACKEND: p = "VRT_backend_string(sp, \v1)"; break; + case BOOL: p = "VRT_bool_string(sp, \v1)"; break; + case DURATION: p = "VRT_double_string(sp, \v1)"; break; /* XXX: should have "s" suffix ? */ case INT: p = "VRT_int_string(sp, \v1)"; break; case IP: p = "VRT_IP_string(sp, \v1)"; break; + case REAL: p = "VRT_double_string(sp, \v1)"; break; case TIME: p = "VRT_time_string(sp, \v1)"; break; - case REAL: p = "VRT_double_string(sp, \v1)"; break; - case DURATION: p = "VRT_double_string(sp, \v1)"; break; - /* XXX: should have "s" suffix ? */ default: break; } if (p != NULL) From martin at varnish-cache.org Tue Oct 12 10:21:57 2010 From: martin at varnish-cache.org (martin at varnish-cache.org) Date: Tue, 12 Oct 2010 12:21:57 +0200 Subject: r5423 - branches/2.1/varnish-cache/doc/sphinx/reference Message-ID: Author: martin Date: 2010-10-12 12:21:57 +0200 (Tue, 12 Oct 2010) New Revision: 5423 Modified: branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst Log: Include documentation for hash_always_miss and hash_ignore_busy vcl variables. Modified: branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-11 20:07:10 UTC (rev 5422) +++ branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-12 10:21:57 UTC (rev 5423) @@ -520,6 +520,12 @@ req.http.header The corresponding HTTP header. +req.hash_always_miss + Force a cache miss for this request. + +req.hash_ignore_busy + Ignore any busy object during cache lookup. + The following variables are available while preparing a backend request (either for a cache miss or for pass or pipe mode): From tfheen at varnish-cache.org Tue Oct 12 10:30:08 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 12 Oct 2010 12:30:08 +0200 Subject: r5424 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-10-12 12:30:07 +0200 (Tue, 12 Oct 2010) New Revision: 5424 Added: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml branches/2.1/varnish-cache/doc/changes-2.1.4.xml Modified: branches/2.1/varnish-cache/doc/Makefile.am Log: Document changes in 2.1.4 Modified: branches/2.1/varnish-cache/doc/Makefile.am =================================================================== --- branches/2.1/varnish-cache/doc/Makefile.am 2010-10-12 10:21:57 UTC (rev 5423) +++ branches/2.1/varnish-cache/doc/Makefile.am 2010-10-12 10:30:07 UTC (rev 5424) @@ -1,6 +1,7 @@ # $Id$ CHANGELOGS = \ + changes-2.1.4.html \ changes-2.1.3.html \ changes-2.1.2.html \ changes-2.1.1.html \ @@ -18,6 +19,7 @@ changes-1.0.4.html XML = \ + changes-2.1.3-2.1.4.xml \ changes-2.1.2-2.1.3.xml \ changes-2.1.1-2.1.2.xml \ changes-2.1.0-2.1.1.xml \ Added: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml (rev 0) +++ branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-12 10:30:07 UTC (rev 5424) @@ -0,0 +1,179 @@ + + +]> + + + + varnishd + + An embarrasing typo in the new binary heap layout caused + inflated obj/objcore/objhdr counts and could cause odd problems + when the LRU expunge mechanism was invoked. This has been + fixed. + + + + We now have updated documentation in the reStructuredText + format. Manual pages and reference documentation are both built + from this.. + + + + If you restarted a request, the HTTP header + X-Forwarded-For would be updated multiple times. + This has been fixed. + + + + If a VCL contained a % sign, and the vcl.show + CLI command was used, varnishd would crash. This has been + fixed. + + + + When doing a pass operation, we would remove the + Content-Length, Age and + Proxy-Auth headers. We are no longer doing + this. + + + + now has a string representation, making it + easier to construct Expires headers in VCL. + + + + In a high traffic environment, we would sometimes reuse a + file descriptor before flushing the logs from a worker thread to + the shared log buffer. This would cause confusion in some of + the tools. This has been fixed by explicitly flushing the log + when a backend connection is closed. + + + + In a high traffic environment, we would sometimes reuse a + file descriptor before flushing the logs from a worker thread to + the shared log buffer. This would cause confusion in some of + the tools. This has been fixed by explicitly flushing the log + when a backend connection is closed. + + + + If the communication between the management and the child + process gets out of sync, we have no way to recover. + Previously, varnishd would be confused, but we now + just kill the child and restart it. + + + + If the backend closes the connection on us just as we sent + a request to it, we retry the request. This should solve some + interoperability problems with Apache and the mpm-itk multi + processing module. + + + + varnishd now only provides help output the + current CLI session is authenticated for. + + + + If the backend does not tell us which length indication it + is using, we now assume the resource ends EOF at. + + + + The client director now has a variable + client.identity which is used to choose which + backend should receive a given request. + + + + The client director now has a variable + client.identity which is used to choose which + backend should receive a given request. + + + + The Solaris port waiter has been updated, and + other portability fixes for Solaris. + + + + There was a corner case in the close-down processing of pipes, this has now been fixed. + + + + Previously, if we stopped polling a backend which was + sick, it never got marked as healthy. This has now been + changed. + + + + It is now possible to specify ports as part of the .host field in VCL. + + + + The synthetic counters were not locked properly, and so + the sms_ counters could underflow. This has now + been fixed. + + + + The value of obj.status as a string in vcl_error would not be correct in all cases. This has been fixed. + + + + Varnish would try to trim storage segments completely + filled when using the malloc stevedore and the object was + received chunked encoding. This has been fixed. + + + + If a buggy backend sends us a Vary header + with two colons, we would previously abort. We now rather fix + this up and ignore the extra colon. + + + + req.hash_always_miss and + req.hash_ignore_busy has been added, to make + preloading or periodically refreshing content work better. + + + + + varnishncsa + + varnishncsa would in some cases be confused + by ESI requests and output invalid lines. This has now been + fixed. + + + + + varnishlog + + varnishlog now allows -o and -u together. + + + + + varnishtop + + varnishtop would crash on 32 bit + architectures. This has been fixed. + + + + + libvarnishapi + + Regex inclusion and exclusion had problems with matching + particular parts of the string being matched. This has been + fixed. + + + + Added: branches/2.1/varnish-cache/doc/changes-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.4.xml (rev 0) +++ branches/2.1/varnish-cache/doc/changes-2.1.4.xml 2010-10-12 10:30:07 UTC (rev 5424) @@ -0,0 +1,12 @@ + + + +]> + + + Varnish + 2.1.4 + + + From tfheen at varnish-cache.org Wed Oct 13 07:32:43 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 13 Oct 2010 09:32:43 +0200 Subject: r5425 - in trunk/varnish-cache: . bin/varnishd doc/sphinx/reference doc/sphinx/tutorial redhat Message-ID: Author: tfheen Date: 2010-10-13 09:32:42 +0200 (Wed, 13 Oct 2010) New Revision: 5425 Modified: trunk/varnish-cache/README trunk/varnish-cache/bin/varnishd/mgt_cli.c trunk/varnish-cache/doc/sphinx/reference/varnishstat.rst trunk/varnish-cache/doc/sphinx/reference/varnishtest.rst trunk/varnish-cache/doc/sphinx/reference/vcl.rst trunk/varnish-cache/doc/sphinx/tutorial/troubleshooting.rst trunk/varnish-cache/redhat/varnish.initrc trunk/varnish-cache/redhat/varnish.spec trunk/varnish-cache/redhat/varnishlog.initrc trunk/varnish-cache/redhat/varnishncsa.initrc Log: Be consistent about naming Try to use the name "Varnish Cache" rather than "Varnish HTTP accelerator" and be consistent about this everywhere. Modified: trunk/varnish-cache/README =================================================================== --- trunk/varnish-cache/README 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/README 2010-10-13 07:32:42 UTC (rev 5425) @@ -1,4 +1,4 @@ -This is the Varnish high-performance HTTP accelerator. +This is Varnish Cache, the high-performance HTTP accelerator. Documentation and additional information about Varnish is available on http://www.varnish-cache.org/ Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2010-10-13 07:32:42 UTC (rev 5425) @@ -99,7 +99,7 @@ (void)av; (void)priv; cli_out(cli, "-----------------------------\n"); - cli_out(cli, "Varnish HTTP accelerator CLI.\n"); + cli_out(cli, "Varnish Cache CLI.\n"); cli_out(cli, "-----------------------------\n"); cli_out(cli, "%s\n", vsb_data(vident) + 1); cli_out(cli, "\n"); Modified: trunk/varnish-cache/doc/sphinx/reference/varnishstat.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishstat.rst 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/doc/sphinx/reference/varnishstat.rst 2010-10-13 07:32:42 UTC (rev 5425) @@ -3,7 +3,7 @@ =========== --------------------------- -HTTP accelerator statistics +Varnish Cache statistics --------------------------- :Author: Dag-Erling Sm?rgrav Modified: trunk/varnish-cache/doc/sphinx/reference/varnishtest.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishtest.rst 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/doc/sphinx/reference/varnishtest.rst 2010-10-13 07:32:42 UTC (rev 5425) @@ -20,7 +20,7 @@ =========== The varnishtest program is a script driven program used to test the -varnish HTTP accelerator. +Varnish Cache. The varnishtest program, when started and given one or more script files, can create a number of threads representing backends, some Modified: trunk/varnish-cache/doc/sphinx/reference/vcl.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-13 07:32:42 UTC (rev 5425) @@ -20,8 +20,8 @@ =========== The VCL language is a small domain-specific language designed to be -used to define request handling and document caching policies for the -Varnish HTTP accelerator. +used to define request handling and document caching policies for +Varnish Cache. When a new configuration is loaded, the varnishd management process translates the VCL code to C and compiles it to a shared object which Modified: trunk/varnish-cache/doc/sphinx/tutorial/troubleshooting.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/troubleshooting.rst 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/doc/sphinx/tutorial/troubleshooting.rst 2010-10-13 07:32:42 UTC (rev 5425) @@ -30,7 +30,7 @@ Platform: Linux,2.6.32-21-generic,i686,-smalloc,-hcritbit 200 193 ----------------------------- - Varnish HTTP accelerator CLI. + Varnish Cache CLI. ----------------------------- Type 'help' for command list. Type 'quit' to close CLI session. Modified: trunk/varnish-cache/redhat/varnish.initrc =================================================================== --- trunk/varnish-cache/redhat/varnish.initrc 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/redhat/varnish.initrc 2010-10-13 07:32:42 UTC (rev 5425) @@ -1,6 +1,6 @@ #! /bin/sh # -# varnish Control the varnish HTTP accelerator +# varnish Control the Varnish Cache # # chkconfig: - 90 10 # description: Varnish is a high-perfomance HTTP accelerator @@ -45,7 +45,7 @@ echo $config not found exit 6 fi - echo -n "Starting varnish HTTP accelerator: " + echo -n "Starting Varnish Cache: " # Open files (usually 1024, which is way too small for varnish) ulimit -n ${NFILES:-131072} @@ -76,7 +76,7 @@ } stop() { - echo -n "Stopping varnish HTTP accelerator: " + echo -n "Stopping Varnish Cache: " killproc -p $pidfile $prog retval=$? echo Modified: trunk/varnish-cache/redhat/varnish.spec =================================================================== --- trunk/varnish-cache/redhat/varnish.spec 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/redhat/varnish.spec 2010-10-13 07:32:42 UTC (rev 5425) @@ -28,9 +28,9 @@ Requires: gcc %description -This is the Varnish high-performance HTTP accelerator. Documentation -wiki and additional information about Varnish is available on the following -web site: http://www.varnish-cache.org/ +This is Varnish Cache, a high-performance HTTP accelerator. +Documentation wiki and additional information about Varnish is +available on the following web site: http://www.varnish-cache.org/ %package libs Summary: Libraries for %{name} @@ -40,7 +40,7 @@ %description libs Libraries for %{name}. -Varnish is a high-performance HTTP accelerator. +Varnish Cache is a high-performance HTTP accelerator. %package libs-devel Summary: Development files for %{name}-libs @@ -50,7 +50,7 @@ %description libs-devel Development files for %{name}-libs -Varnish is a high-performance HTTP accelerator +Varnish Cache is a high-performance HTTP accelerator %package docs Summary: Documentation files for %name @@ -68,7 +68,7 @@ # #%description libs-static #Files for static linking of varnish library functions -#Varnish is a high-performance HTTP accelerator +#Varnish Cache is a high-performance HTTP accelerator %prep #%setup -q @@ -245,7 +245,7 @@ getent group varnish >/dev/null || groupadd -r varnish getent passwd varnish >/dev/null || \ useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \ - -c "Varnish http accelerator user" varnish + -c "Varnish Cache" varnish exit 0 %post Modified: trunk/varnish-cache/redhat/varnishlog.initrc =================================================================== --- trunk/varnish-cache/redhat/varnishlog.initrc 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/redhat/varnishlog.initrc 2010-10-13 07:32:42 UTC (rev 5425) @@ -1,9 +1,9 @@ #! /bin/sh # -# varnishlog Control the varnish logging daemon +# varnishlog Control the Varnish logging daemon # # chkconfig: - 90 10 -# description: Varnish logging daemon +# description: Varnish Cache logging daemon # processname: varnishlog # config: # pidfile: /var/run/varnish/varnishlog.pid @@ -13,7 +13,7 @@ # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $local_fs $remote_fs # Short-Description: start and stop varnishlog -# Description: Varnish HTTP accelerator logging daemon +# Description: Varnish Cache logging daemon ### END INIT INFO # Source function library. Modified: trunk/varnish-cache/redhat/varnishncsa.initrc =================================================================== --- trunk/varnish-cache/redhat/varnishncsa.initrc 2010-10-12 10:30:07 UTC (rev 5424) +++ trunk/varnish-cache/redhat/varnishncsa.initrc 2010-10-13 07:32:42 UTC (rev 5425) @@ -1,9 +1,9 @@ #! /bin/sh # -# varnishncsa Control the varnish nsca logging daemon +# varnishncsa Control the Varnish NSCA logging daemon # # chkconfig: - 90 10 -# description: Varnish logging daemon +# description: Varnish Cache logging daemon # processname: varnishncsa # config: # pidfile: /var/run/varnish/varnishncsa.pid @@ -13,7 +13,7 @@ # Required-Start: $network $local_fs $remote_fs # Required-Stop: $network $local_fs $remote_fs # Short-Description: start and stop varnishncsa -# Description: Varnish HTTP accelerator logging daemon +# Description: Varnish Cache NSCA logging daemon ### END INIT INFO # Source function library. From tfheen at varnish-cache.org Wed Oct 13 08:22:57 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 13 Oct 2010 10:22:57 +0200 Subject: r5426 - in trunk/varnish-cache: bin/varnishd include lib/libvcl lib/libvmod_std Message-ID: Author: tfheen Date: 2010-10-13 10:22:57 +0200 (Wed, 13 Oct 2010) New Revision: 5426 Modified: trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/include/Makefile.am trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvmod_std/Makefile.am Log: Distribute header files Make sure we distribute the needed header files and ensure they're part of the Makefile dependency chain Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-13 07:32:42 UTC (rev 5425) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) @@ -77,6 +77,7 @@ default_vcl.h \ hash_slinger.h \ heritage.h \ + locks.h \ mgt.h \ mgt_cli.h \ steps.h \ Modified: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2010-10-13 07:32:42 UTC (rev 5425) +++ trunk/varnish-cache/include/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) @@ -5,6 +5,7 @@ vsl.h \ vsl_tags.h \ vsc_fields.h \ + vsc_all.h \ vsc.h \ varnishapi.h Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-10-13 07:32:42 UTC (rev 5425) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) @@ -11,6 +11,7 @@ vcc_compile.h \ vcc_token_defs.h \ vcc_types.h \ + symbol_kind.h \ \ vcc_acl.c \ vcc_action.c \ Modified: trunk/varnish-cache/lib/libvmod_std/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvmod_std/Makefile.am 2010-10-13 07:32:42 UTC (rev 5425) +++ trunk/varnish-cache/lib/libvmod_std/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) @@ -8,6 +8,7 @@ libvmod_std_la_SOURCES = \ vcc_if.c \ + vcc_if.h \ vmod_std.c vcc_if.c vcc_if.h: $(top_srcdir)/lib/libvmod_std/vmod.py $(top_srcdir)/lib/libvmod_std/vmod.vcc From tfheen at varnish-cache.org Wed Oct 13 08:24:27 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 13 Oct 2010 10:24:27 +0200 Subject: r5427 - in trunk/varnish-cache: . bin/varnishadm bin/varnishsizes doc doc/sphinx lib/libvarnish man Message-ID: Author: tfheen Date: 2010-10-13 10:24:27 +0200 (Wed, 13 Oct 2010) New Revision: 5427 Added: trunk/varnish-cache/doc/sphinx/Makefile.am Removed: trunk/varnish-cache/doc/sphinx/Makefile Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am trunk/varnish-cache/bin/varnishsizes/Makefile.am trunk/varnish-cache/configure.ac trunk/varnish-cache/doc/Makefile.am trunk/varnish-cache/lib/libvarnish/Makefile.am trunk/varnish-cache/man/Makefile.am Log: Documentation build system fixup Fix up the documentation build system, hopefully making "make distcheck" work correctly again. Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishadm -if HAVE_RST2MAN dist_man_MANS = varnishadm.1 -endif varnishadm_SOURCES = \ varnishadm.c @@ -17,7 +15,7 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ ${PTHREAD_LIBS} ${NET_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +%.1: $(top_srcdir)/doc/sphinx/reference/%.rst if HAVE_RST2MAN ${RST2MAN} $< >$@ else Modified: trunk/varnish-cache/bin/varnishsizes/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishsizes -if HAVE_RST2MAN dist_man_MANS = varnishsizes.1 -endif varnishsizes_SOURCES = varnishsizes.c @@ -16,7 +14,7 @@ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +%.1: $(top_srcdir)/doc/sphinx/reference/%.rst if HAVE_RST2MAN ${RST2MAN} $< >$@ else Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/configure.ac 2010-10-13 08:24:27 UTC (rev 5427) @@ -455,6 +455,7 @@ bin/varnishtest/Makefile bin/varnishtop/Makefile doc/Makefile + doc/sphinx/Makefile etc/Makefile include/Makefile lib/Makefile Modified: trunk/varnish-cache/doc/Makefile.am =================================================================== --- trunk/varnish-cache/doc/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/doc/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -34,8 +34,7 @@ endif EXTRA_DIST = ${CHANGELOGS} ${XML} \ - changes.css changes-html.xsl \ - getting-started.html + changes.css changes-html.xsl CLEANFILES = ${CHANGELOGS} SUFFIXES = .xml .html @@ -52,3 +51,4 @@ ${CHANGELOGS}: changes-html.xsl +SUBDIRS = sphinx Deleted: trunk/varnish-cache/doc/sphinx/Makefile =================================================================== --- trunk/varnish-cache/doc/sphinx/Makefile 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/doc/sphinx/Makefile 2010-10-13 08:24:27 UTC (rev 5427) @@ -1,89 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = =build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Varnish.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Varnish.qhc" - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." Added: trunk/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- trunk/varnish-cache/doc/sphinx/Makefile.am (rev 0) +++ trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -0,0 +1,140 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = =build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Varnish.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Varnish.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +EXTRA_DIST = \ + conf.py \ + index.rst \ + faq/configuration.rst \ + faq/general.rst \ + faq/http.rst \ + faq/index.rst \ + faq/logging.rst \ + glossary/index.rst \ + installation/bugs.rst \ + installation/help.rst \ + installation/index.rst \ + installation/install.rst \ + installation/prerequisites.rst \ + phk/autocrap.rst \ + phk/backends.rst \ + phk/barriers.rst \ + phk/index.rst \ + phk/ipv6suckage.rst \ + phk/platforms.rst \ + phk/sphinx.rst \ + phk/thoughts.rst \ + phk/vcl_expr.rst \ + reference/index.rst \ + reference/shmem.rst \ + reference/varnishadm.rst \ + reference/varnishd.rst \ + reference/varnishhist.rst \ + reference/varnishlog.rst \ + reference/varnishncsa.rst \ + reference/varnishreplay.rst \ + reference/varnishsizes.rst \ + reference/varnishstat.rst \ + reference/varnishtest.rst \ + reference/varnishtop.rst \ + reference/vcl.rst \ + reference/vmod.rst \ + tutorial/advanced_backend_servers.rst \ + tutorial/advanced_topics.rst \ + tutorial/backend_servers.rst \ + tutorial/handling_misbehaving_servers.rst \ + tutorial/increasing_your_hitrate.rst \ + tutorial/index.rst \ + tutorial/logging.rst \ + tutorial/putting_varnish_on_port_80.rst \ + tutorial/sizing_your_cache.rst \ + tutorial/starting_varnish.rst \ + tutorial/statistics.rst \ + tutorial/troubleshooting.rst \ + tutorial/vcl.rst Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -4,7 +4,8 @@ lib_LTLIBRARIES = libvarnish.la -libvarnish_la_LDFLAGS = -version-info 1:0:0 +libvarnish_la_LDFLAGS = -version-info 1:0:0 \ + ../libvarnishcompat/libvarnishcompat.la libvarnish_la_SOURCES = \ argv.c \ Modified: trunk/varnish-cache/man/Makefile.am =================================================================== --- trunk/varnish-cache/man/Makefile.am 2010-10-13 08:22:57 UTC (rev 5426) +++ trunk/varnish-cache/man/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) @@ -1,15 +1,9 @@ # $Id$ -DISTCLEANFILES = vcl.7 default.vcl - -if HAVE_RST2MAN dist_man_MANS = vcl.7 -endif -default.vcl: $(top_srcdir)/bin/varnishd/default.vcl Makefile - sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/default.vcl > $@ - -vcl.7: ../doc/sphinx/reference/vcl.rst default.vcl +vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ + $(top_srcdir)/bin/varnishd/default.vcl if HAVE_RST2MAN ${RST2MAN} $< >$@ else From tfheen at varnish-cache.org Wed Oct 13 08:26:07 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 13 Oct 2010 10:26:07 +0200 Subject: r5428 - trunk/varnish-cache/lib/libvarnish Message-ID: Author: tfheen Date: 2010-10-13 10:26:07 +0200 (Wed, 13 Oct 2010) New Revision: 5428 Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am Log: Revert accidentially commited part of 5427 libvarnish's Makefile.am accidentially included a bit that should have been committed, so revert part of previous commit. Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-13 08:24:27 UTC (rev 5427) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2010-10-13 08:26:07 UTC (rev 5428) @@ -4,8 +4,7 @@ lib_LTLIBRARIES = libvarnish.la -libvarnish_la_LDFLAGS = -version-info 1:0:0 \ - ../libvarnishcompat/libvarnishcompat.la +libvarnish_la_LDFLAGS = -version-info 1:0:0 libvarnish_la_SOURCES = \ argv.c \ From phk at varnish-cache.org Thu Oct 14 07:36:50 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 14 Oct 2010 09:36:50 +0200 Subject: r5429 - trunk/varnish-cache Message-ID: Author: phk Date: 2010-10-14 09:36:50 +0200 (Thu, 14 Oct 2010) New Revision: 5429 Modified: trunk/varnish-cache/configure.ac Log: Look also for rst2man.py (for FreeBSD) Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2010-10-13 08:26:07 UTC (rev 5428) +++ trunk/varnish-cache/configure.ac 2010-10-14 07:36:50 UTC (rev 5429) @@ -29,7 +29,7 @@ AC_MSG_WARN([xsltproc not found ? not building documentation]) fi AM_CONDITIONAL(HAVE_XSLTPROC,[test "x$XSLTPROC" != "xno"]) -AC_CHECK_PROGS(RST2MAN, [rst2man], "no") +AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], "no") if test "x$RST2MAN" = "xno"; then AC_MSG_WARN([rst2man not found ? not building man pages]) fi From tfheen at varnish-cache.org Thu Oct 14 08:11:52 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 14 Oct 2010 10:11:52 +0200 Subject: r5430 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-10-14 10:11:52 +0200 (Thu, 14 Oct 2010) New Revision: 5430 Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml Log: Remove duplicate section from changelog Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-14 07:36:50 UTC (rev 5429) +++ branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-14 08:11:52 UTC (rev 5430) @@ -90,12 +90,6 @@ - The client director now has a variable - client.identity which is used to choose which - backend should receive a given request. - - - The Solaris port waiter has been updated, and other portability fixes for Solaris. From perbu at varnish-cache.org Sat Oct 16 17:24:30 2010 From: perbu at varnish-cache.org (perbu at varnish-cache.org) Date: Sat, 16 Oct 2010 19:24:30 +0200 Subject: r5431 - trunk/varnish-cache/doc/sphinx Message-ID: Author: perbu Date: 2010-10-16 19:24:30 +0200 (Sat, 16 Oct 2010) New Revision: 5431 Modified: trunk/varnish-cache/doc/sphinx/index.rst Log: declutter the front page Modified: trunk/varnish-cache/doc/sphinx/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/index.rst 2010-10-14 08:11:52 UTC (rev 5430) +++ trunk/varnish-cache/doc/sphinx/index.rst 2010-10-16 17:24:30 UTC (rev 5431) @@ -15,7 +15,7 @@ Contents: .. toctree:: - :maxdepth: 2 + :maxdepth: 1 installation/index.rst tutorial/index.rst From phk at varnish-cache.org Mon Oct 18 15:23:38 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 18 Oct 2010 17:23:38 +0200 Subject: r5432 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-18 17:23:38 +0200 (Mon, 18 Oct 2010) New Revision: 5432 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c Log: There is a potential lock-order inversion between a worker thread and the ban-lurker and there is nothing we can do about it: They come from opposite ends of the world. Resolve this by using a TryLock in the ban-lurker and abandon the attempt if we fail to get the lock. Fixes: #796 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-10-16 17:24:30 UTC (rev 5431) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-10-18 15:23:38 UTC (rev 5432) @@ -661,7 +661,10 @@ CHECK_OBJ_NOTNULL(oc1, OBJCORE_MAGIC); oh = oc1->objhead; CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); - Lck_Lock(&oh->mtx); + if (Lck_Trylock(&oh->mtx)) { + *oc = NULL; + return; + } VTAILQ_FOREACH(oc2, &oh->objcs, list) if (oc1 == oc2) break; From tfheen at varnish-cache.org Tue Oct 19 14:12:13 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 19 Oct 2010 16:12:13 +0200 Subject: r5433 - in branches/2.1: . varnish-cache varnish-cache/bin/varnishadm varnish-cache/bin/varnishd varnish-cache/bin/varnishsizes varnish-cache/bin/varnishtest/tests varnish-cache/doc varnish-cache/doc/sphinx varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl varnish-cache/man Message-ID: Author: tfheen Date: 2010-10-19 16:12:13 +0200 (Tue, 19 Oct 2010) New Revision: 5433 Added: branches/2.1/varnish-cache/doc/sphinx/Makefile.am Removed: branches/2.1/varnish-cache/doc/sphinx/Makefile Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishadm/Makefile.am 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/varnishsizes/Makefile.am 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/configure.ac branches/2.1/varnish-cache/doc/Makefile.am branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 branches/2.1/varnish-cache/man/Makefile.am Log: Merge r5427: Documentation build system fixup Fix up the documentation build system, hopefully making "make distcheck" work correctly again. The irrelevant bits of 5427 has been elided. 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 + /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 Modified: branches/2.1/varnish-cache/bin/varnishadm/Makefile.am =================================================================== --- branches/2.1/varnish-cache/bin/varnishadm/Makefile.am 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/bin/varnishadm/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishadm -if HAVE_RST2MAN dist_man_MANS = varnishadm.1 -endif varnishadm_SOURCES = \ varnishadm.c @@ -16,7 +14,7 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ ${PTHREAD_LIBS} ${NET_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +%.1: $(top_srcdir)/doc/sphinx/reference/%.rst if HAVE_RST2MAN ${RST2MAN} $< >$@ else 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 + /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 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 + /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 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 + /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 Modified: branches/2.1/varnish-cache/bin/varnishsizes/Makefile.am =================================================================== --- branches/2.1/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishsizes -if HAVE_RST2MAN dist_man_MANS = varnishsizes.1 -endif varnishsizes_SOURCES = varnishsizes.c @@ -17,7 +15,7 @@ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +%.1: $(top_srcdir)/doc/sphinx/reference/%.rst if HAVE_RST2MAN ${RST2MAN} $< >$@ else 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 + /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 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 + /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 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 + /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 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 + /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 Modified: branches/2.1/varnish-cache/configure.ac =================================================================== --- branches/2.1/varnish-cache/configure.ac 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/configure.ac 2010-10-19 14:12:13 UTC (rev 5433) @@ -459,6 +459,7 @@ bin/varnishtest/Makefile bin/varnishtop/Makefile doc/Makefile + doc/sphinx/Makefile etc/Makefile include/Makefile lib/Makefile Modified: branches/2.1/varnish-cache/doc/Makefile.am =================================================================== --- branches/2.1/varnish-cache/doc/Makefile.am 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/doc/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) @@ -42,8 +42,7 @@ endif EXTRA_DIST = ${CHANGELOGS} ${XML} \ - changes.css changes-html.xsl \ - getting-started.html + changes.css changes-html.xsl CLEANFILES = ${CHANGELOGS} SUFFIXES = .xml .html @@ -60,3 +59,4 @@ ${CHANGELOGS}: changes-html.xsl +SUBDIRS = sphinx Deleted: branches/2.1/varnish-cache/doc/sphinx/Makefile =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/Makefile 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/doc/sphinx/Makefile 2010-10-19 14:12:13 UTC (rev 5433) @@ -1,89 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = =build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Varnish.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Varnish.qhc" - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)latex." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." Copied: branches/2.1/varnish-cache/doc/sphinx/Makefile.am (from rev 5427, trunk/varnish-cache/doc/sphinx/Makefile.am) =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/Makefile.am (rev 0) +++ branches/2.1/varnish-cache/doc/sphinx/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) @@ -0,0 +1,136 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = =build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Varnish.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Varnish.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +EXTRA_DIST = \ + conf.py \ + index.rst \ + faq/configuration.rst \ + faq/general.rst \ + faq/http.rst \ + faq/index.rst \ + faq/logging.rst \ + glossary/index.rst \ + installation/bugs.rst \ + installation/help.rst \ + installation/index.rst \ + installation/install.rst \ + installation/prerequisites.rst \ + phk/autocrap.rst \ + phk/barriers.rst \ + phk/index.rst \ + phk/ipv6suckage.rst \ + phk/platforms.rst \ + phk/sphinx.rst \ + phk/thoughts.rst \ + reference/index.rst \ + reference/varnishadm.rst \ + reference/varnishd.rst \ + reference/varnishhist.rst \ + reference/varnishlog.rst \ + reference/varnishncsa.rst \ + reference/varnishreplay.rst \ + reference/varnishsizes.rst \ + reference/varnishstat.rst \ + reference/varnishtest.rst \ + reference/varnishtop.rst \ + reference/vcl.rst \ + tutorial/advanced_backend_servers.rst \ + tutorial/advanced_topics.rst \ + tutorial/backend_servers.rst \ + tutorial/handling_misbehaving_servers.rst \ + tutorial/increasing_your_hitrate.rst \ + tutorial/index.rst \ + tutorial/logging.rst \ + tutorial/putting_varnish_on_port_80.rst \ + tutorial/sizing_your_cache.rst \ + tutorial/starting_varnish.rst \ + tutorial/statistics.rst \ + tutorial/troubleshooting.rst \ + tutorial/vcl.rst 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 + /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 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 + /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 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 + /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 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 + /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 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 + /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 Modified: branches/2.1/varnish-cache/man/Makefile.am =================================================================== --- branches/2.1/varnish-cache/man/Makefile.am 2010-10-18 15:23:38 UTC (rev 5432) +++ branches/2.1/varnish-cache/man/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) @@ -1,15 +1,9 @@ # $Id$ -DISTCLEANFILES = vcl.7 default.vcl - -if HAVE_RST2MAN dist_man_MANS = vcl.7 -endif -default.vcl: $(top_srcdir)/bin/varnishd/default.vcl Makefile - sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/default.vcl > $@ - -vcl.7: ../doc/sphinx/reference/vcl.rst default.vcl +vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ + $(top_srcdir)/bin/varnishd/default.vcl if HAVE_RST2MAN ${RST2MAN} $< >$@ else From tfheen at varnish-cache.org Tue Oct 19 15:01:04 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 19 Oct 2010 17:01:04 +0200 Subject: r5434 - in branches/2.1/varnish-cache: bin/varnishd doc/sphinx/reference include lib/libvcl Message-ID: Author: tfheen Date: 2010-10-19 17:01:04 +0200 (Tue, 19 Oct 2010) New Revision: 5434 Modified: branches/2.1/varnish-cache/bin/varnishd/Makefile.am branches/2.1/varnish-cache/bin/varnishd/cache_backend.c 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/flint.lnt branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst branches/2.1/varnish-cache/include/stat_field.h branches/2.1/varnish-cache/include/vrt.h branches/2.1/varnish-cache/lib/libvcl/Makefile.am branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c branches/2.1/varnish-cache/lib/libvcl/vcc_compile.h branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Merge DNS director The DNS director allows Varnish to pick backend based on the Host header provided by the client, and how it resolves in DNS. A suffix can be added to make it "internal" (see vcl(7)). This includes commits 5062, 5063, 5064, 5099, 5172, 5173, 5174, 5175 Modified: branches/2.1/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/bin/varnishd/Makefile.am 2010-10-19 15:01:04 UTC (rev 5434) @@ -21,6 +21,7 @@ cache_center.c \ cache_cli.c \ cache_dir_random.c \ + cache_dir_dns.c \ cache_dir_round_robin.c \ cache_esi.c \ cache_expire.c \ Modified: branches/2.1/varnish-cache/bin/varnishd/cache_backend.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_backend.c 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/bin/varnishd/cache_backend.c 2010-10-19 15:01:04 UTC (rev 5434) @@ -484,6 +484,24 @@ struct backend *backend; }; +/* Returns the backend if and only if the this is a simple director. + * XXX: Needs a better name and possibly needs a better general approach. + * XXX: This is mainly used by the DNS director to fetch the actual backend + * XXX: so it can compare DNS lookups with the actual IP. + */ +struct backend * +vdi_get_backend_if_simple(const struct director *d) +{ + CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC); + struct vdi_simple *vs, *vs2; + + vs2 = d->priv; + if (vs2->magic != VDI_SIMPLE_MAGIC) + return NULL; + CAST_OBJ_NOTNULL(vs, d->priv, VDI_SIMPLE_MAGIC); + return vs->backend; +} + static struct vbe_conn * vdi_simple_getfd(const struct director *d, struct sess *sp) { Modified: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_backend.h 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h 2010-10-19 15:01:04 UTC (rev 5434) @@ -143,6 +143,7 @@ /* cache_backend.c */ void VBE_ReleaseConn(struct vbe_conn *vc); +struct backend *vdi_get_backend_if_simple(const struct director *d); /* cache_backend_cfg.c */ extern struct lock VBE_mtx; @@ -158,6 +159,7 @@ /* Init functions for directors */ typedef void dir_init_f(struct cli *, struct director **, int , const void*); dir_init_f VRT_init_dir_simple; +dir_init_f VRT_init_dir_dns; dir_init_f VRT_init_dir_hash; dir_init_f VRT_init_dir_random; dir_init_f VRT_init_dir_round_robin; Modified: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-19 15:01:04 UTC (rev 5434) @@ -273,6 +273,8 @@ VRT_init_dir_hash(cli, dir, idx, priv); else if (!strcmp(name, "random")) VRT_init_dir_random(cli, dir, idx, priv); + else if (!strcmp(name, "dns")) + VRT_init_dir_dns(cli, dir, idx, priv); else if (!strcmp(name, "round-robin")) VRT_init_dir_round_robin(cli, dir, idx, priv); else if (!strcmp(name, "client")) Modified: branches/2.1/varnish-cache/bin/varnishd/flint.lnt =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/flint.lnt 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/bin/varnishd/flint.lnt 2010-10-19 15:01:04 UTC (rev 5434) @@ -141,6 +141,7 @@ -sem(WS_Init, custodial(2)) -sem(http_Setup, custodial(2)) +-sem(vdi_dns_cache_list_add, custodial(3)) -ffc // No automatic custody -e455 // thread lock Modified: branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/doc/sphinx/reference/vcl.rst 2010-10-19 15:01:04 UTC (rev 5434) @@ -175,6 +175,34 @@ of retries the director should take in order to find a healthy backend. +The DNS director +~~~~~~~~~~~~~~~~ + +The DNS director can use backends in three different ways. Either like the +random or round-robin director or using .list:: + + director directorname dns { + .list = { + .host_header = "www.example.com"; + .port = "80"; + .connect_timeout = 0.4; + "192.168.15.0"/24; + "192.168.16.128"/25; + } + .ttl = 5m; + .suffix = "internal.example.net"; + } + +This will specify 384 backends, all using port 80 and a connection timeout +of 0.4s. Options must come before the list of IPs in the .list statement. + +The .ttl defines the cache duration of the DNS lookups. + +The above example will append "internal.example.net" to the incoming Host +header supplied by the client, before looking it up. All settings are +optional. + + Backend probes -------------- Modified: branches/2.1/varnish-cache/include/stat_field.h =================================================================== --- branches/2.1/varnish-cache/include/stat_field.h 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/include/stat_field.h 2010-10-19 15:01:04 UTC (rev 5434) @@ -154,3 +154,8 @@ MAC_STAT(uptime, uint64_t, 0, 'a', "Client uptime") MAC_STAT(backend_retry, uint64_t, 0, 'a', "Backend conn. retry") + +MAC_STAT(dir_dns_lookups, uint64_t, 0, 'a', "DNS director lookups") +MAC_STAT(dir_dns_failed, uint64_t, 0, 'a', "DNS director failed lookups") +MAC_STAT(dir_dns_hit, uint64_t, 0, 'a', "DNS director cached lookups hit") +MAC_STAT(dir_dns_cache_full, uint64_t, 0, 'a', "DNS director full dnscache") Modified: branches/2.1/varnish-cache/include/vrt.h =================================================================== --- branches/2.1/varnish-cache/include/vrt.h 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/include/vrt.h 2010-10-19 15:01:04 UTC (rev 5434) @@ -111,7 +111,22 @@ const struct vrt_dir_round_robin_entry *members; }; +/* + * A director with dns-based selection + */ +struct vrt_dir_dns_entry { + int host; +}; + +struct vrt_dir_dns { + const char *name; + const char *suffix; + const double ttl; + unsigned nmember; + const struct vrt_dir_dns_entry *members; +}; + /* * other stuff. * XXX: document when bored Modified: branches/2.1/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/Makefile.am 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/lib/libvcl/Makefile.am 2010-10-19 15:01:04 UTC (rev 5434) @@ -18,6 +18,7 @@ vcc_compile.c \ vcc_dir_random.c \ vcc_dir_round_robin.c \ + vcc_dir_dns.c \ vcc_parse.c \ vcc_fixed_token.c \ vcc_obj.c \ Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-19 15:01:04 UTC (rev 5434) @@ -225,7 +225,7 @@ * in that context. */ -static void +void vcc_EmitBeIdent(const struct tokenlist *tl, struct vsb *v, int serial, const struct token *first, const struct token *last) { @@ -681,6 +681,7 @@ { "random", vcc_ParseRandomDirector }, { "client", vcc_ParseRandomDirector }, { "round-robin", vcc_ParseRoundRobinDirector }, + { "dns", vcc_ParseDnsDirector }, { NULL, NULL } }; Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-19 15:01:04 UTC (rev 5434) @@ -167,6 +167,10 @@ void vcc_IsField(struct tokenlist *tl, struct token **t, struct fld_spec *fs); void vcc_FieldsOk(struct tokenlist *tl, const struct fld_spec *fs); +void Emit_Sockaddr(struct tokenlist *tl, const struct token *t_host, const char *port); +void vcc_EmitBeIdent(const struct tokenlist *tl, struct vsb *v, + int serial, const struct token *first, const struct token *last); + /* vcc_compile.c */ extern struct method method_tab[]; /* @@ -191,6 +195,9 @@ /* vcc_dir_round_robin.c */ parsedirector_f vcc_ParseRoundRobinDirector; +/* vcc_dir_dns.c */ +parsedirector_f vcc_ParseDnsDirector; + /* vcc_obj.c */ extern struct var vcc_vars[]; Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-10-19 14:12:13 UTC (rev 5433) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-10-19 15:01:04 UTC (rev 5434) @@ -268,7 +268,14 @@ vsb_cat(sb, " {\n\tconst char\t\t\t\t*name;\n"); vsb_cat(sb, "\tunsigned\t\t\t\tnmember;\n\tconst struct vrt_dir_rou"); vsb_cat(sb, "nd_robin_entry\t*members;\n};\n"); - vsb_cat(sb, "\n\n/*\n * other stuff.\n * XXX: document when bored\n"); + vsb_cat(sb, "\n/*\n * A director with dns-based selection\n"); + vsb_cat(sb, " */\n\nstruct vrt_dir_dns_entry {\n"); + vsb_cat(sb, "\tint\t\t\t\t\thost;\n};\n\nstruct vrt_dir_dns {\n"); + vsb_cat(sb, "\tconst char\t\t\t\t*name;\n\tconst char\t\t\t\t*suffi"); + vsb_cat(sb, "x;\n\tconst double\t\t\t\tttl;\n"); + vsb_cat(sb, "\tunsigned\t\t\t\tnmember;\n\tconst struct vrt_dir_dns"); + vsb_cat(sb, "_entry\t\t*members;\n};\n\n/*\n"); + vsb_cat(sb, " * other stuff.\n * XXX: document when bored\n"); vsb_cat(sb, " */\n\nstruct vrt_ref {\n\tunsigned\tsource;\n"); vsb_cat(sb, "\tunsigned\toffset;\n\tunsigned\tline;\n"); vsb_cat(sb, "\tunsigned\tpos;\n\tunsigned\tcount;\n"); From tfheen at varnish-cache.org Wed Oct 20 07:15:46 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 09:15:46 +0200 Subject: r5435 - trunk/varnish-cache Message-ID: Author: tfheen Date: 2010-10-20 09:15:45 +0200 (Wed, 20 Oct 2010) New Revision: 5435 Modified: trunk/varnish-cache/Makefile.am Log: Add distcheck hook Add a distcheck hook that checks the version field of the RH spec file, ensuring that we don't accidentially release a version without at least making sure that number is correct. Modified: trunk/varnish-cache/Makefile.am =================================================================== --- trunk/varnish-cache/Makefile.am 2010-10-19 15:01:04 UTC (rev 5434) +++ trunk/varnish-cache/Makefile.am 2010-10-20 07:15:45 UTC (rev 5435) @@ -11,3 +11,11 @@ install-data-local: $(install_sh) -d -m 0755 $(DESTDIR)$(localstatedir)/varnish + +distcheck-hook: + if ! grep "^Version: @PACKAGE_VERSION@$$" $(top_distdir)/redhat/varnish.spec && \ + [ "@PACKAGE_VERSION@" != "trunk" ]; then \ + echo "redhat/varnish.spec does not have a version number matching the package" ; \ + exit 1 ; \ + fi + From tfheen at varnish-cache.org Wed Oct 20 07:30:18 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 09:30:18 +0200 Subject: r5436 - in branches/2.1: . varnish-cache varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-20 09:30:18 +0200 (Wed, 20 Oct 2010) New Revision: 5436 Modified: branches/2.1/ branches/2.1/varnish-cache/Makefile.am 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/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 r5435: Add distcheck hook Add a distcheck hook that checks the version field of the RH spec file, ensuring that we don't accidentially release a version without at least making sure that number is correct. 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 + /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,5435 Modified: branches/2.1/varnish-cache/Makefile.am =================================================================== --- branches/2.1/varnish-cache/Makefile.am 2010-10-20 07:15:45 UTC (rev 5435) +++ branches/2.1/varnish-cache/Makefile.am 2010-10-20 07:30:18 UTC (rev 5436) @@ -11,3 +11,11 @@ install-data-local: $(install_sh) -d -m 0755 $(DESTDIR)$(localstatedir)/varnish + +distcheck-hook: + if ! grep "^Version: @PACKAGE_VERSION@$$" $(top_distdir)/redhat/varnish.spec && \ + [ "@PACKAGE_VERSION@" != "trunk" ]; then \ + echo "redhat/varnish.spec does not have a version number matching the package" ; \ + exit 1 ; \ + fi + 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 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 + /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,5435 From tfheen at varnish-cache.org Wed Oct 20 07:40:58 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 09:40:58 +0200 Subject: r5437 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-10-20 09:40:58 +0200 (Wed, 20 Oct 2010) New Revision: 5437 Modified: branches/2.1/varnish-cache/doc/changes-2.1.4.xml Log: Fix typo in include path Modified: branches/2.1/varnish-cache/doc/changes-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.4.xml 2010-10-20 07:30:18 UTC (rev 5436) +++ branches/2.1/varnish-cache/doc/changes-2.1.4.xml 2010-10-20 07:40:58 UTC (rev 5437) @@ -8,5 +8,5 @@ Varnish 2.1.4 - + From tfheen at varnish-cache.org Wed Oct 20 07:43:15 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 09:43:15 +0200 Subject: r5438 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-10-20 09:43:15 +0200 (Wed, 20 Oct 2010) New Revision: 5438 Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml Log: Add DNS director to changes, fix typo Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-20 07:40:58 UTC (rev 5437) +++ branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-20 07:43:15 UTC (rev 5438) @@ -16,9 +16,15 @@ We now have updated documentation in the reStructuredText format. Manual pages and reference documentation are both built - from this.. + from this. + + We now include a DNS director which uses DNS for choosing + which backend to route requests to. Please see the + documentation for more details. + + If you restarted a request, the HTTP header X-Forwarded-For would be updated multiple times. From tfheen at varnish-cache.org Wed Oct 20 13:03:53 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 15:03:53 +0200 Subject: r5439 - trunk/varnish-cache/doc/sphinx Message-ID: Author: tfheen Date: 2010-10-20 15:03:52 +0200 (Wed, 20 Oct 2010) New Revision: 5439 Modified: trunk/varnish-cache/doc/sphinx/Makefile.am Log: Fix VPATH builds Modified: trunk/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 07:43:15 UTC (rev 5438) +++ trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:03:52 UTC (rev 5439) @@ -10,7 +10,7 @@ # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir) .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest From tfheen at varnish-cache.org Wed Oct 20 13:04:46 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 15:04:46 +0200 Subject: r5440 - trunk/varnish-cache/doc/sphinx Message-ID: Author: tfheen Date: 2010-10-20 15:04:46 +0200 (Wed, 20 Oct 2010) New Revision: 5440 Modified: trunk/varnish-cache/doc/sphinx/Makefile.am Log: Build documentation at make dist time Modified: trunk/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:03:52 UTC (rev 5439) +++ trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:04:46 UTC (rev 5440) @@ -138,3 +138,10 @@ tutorial/statistics.rst \ tutorial/troubleshooting.rst \ tutorial/vcl.rst + +dist-hook: + $(MAKE) html + cp -r $(BUILDDIR) $(distdir) + +distclean-local: + rm -r $(BUILDDIR) From tfheen at varnish-cache.org Wed Oct 20 13:30:55 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 15:30:55 +0200 Subject: r5441 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/doc/sphinx varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-20 15:30:55 +0200 (Wed, 20 Oct 2010) New Revision: 5441 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/doc/sphinx/Makefile.am branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 r5439: Fix VPATH builds 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 Modified: branches/2.1/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:04:46 UTC (rev 5440) +++ branches/2.1/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:30:55 UTC (rev 5441) @@ -10,7 +10,7 @@ # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir) .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 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,5435 + /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,5435,5439 From tfheen at varnish-cache.org Wed Oct 20 13:37:02 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 15:37:02 +0200 Subject: r5442 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/doc/sphinx varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-20 15:37:02 +0200 (Wed, 20 Oct 2010) New Revision: 5442 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/doc/sphinx/Makefile.am branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 r5440: Build documentation at make dist time 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 Modified: branches/2.1/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- branches/2.1/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:30:55 UTC (rev 5441) +++ branches/2.1/varnish-cache/doc/sphinx/Makefile.am 2010-10-20 13:37:02 UTC (rev 5442) @@ -134,3 +134,10 @@ tutorial/statistics.rst \ tutorial/troubleshooting.rst \ tutorial/vcl.rst + +dist-hook: + $(MAKE) html + cp -r $(BUILDDIR) $(distdir) + +distclean-local: + rm -r $(BUILDDIR) 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 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,5435,5439 + /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,5435,5439-5440 From tfheen at varnish-cache.org Wed Oct 20 13:44:17 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 20 Oct 2010 15:44:17 +0200 Subject: r5443 - in branches/2.1/varnish-cache: . bin/varnishd bin/varnishtest/tests lib/libvcl Message-ID: Author: tfheen Date: 2010-10-20 15:44:17 +0200 (Wed, 20 Oct 2010) New Revision: 5443 Added: branches/2.1/varnish-cache/bin/varnishd/cache_dir_dns.c branches/2.1/varnish-cache/bin/varnishtest/tests/v00029.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00030.vtc branches/2.1/varnish-cache/lib/libvcl/vcc_dir_dns.c Modified: branches/2.1/varnish-cache/configure.ac Log: Add missing files for the DNS director Added: branches/2.1/varnish-cache/bin/varnishd/cache_dir_dns.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_dir_dns.c (rev 0) +++ branches/2.1/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-10-20 13:44:17 UTC (rev 5443) @@ -0,0 +1,487 @@ +/*- + * Copyright (c) 2009 Redpill Linpro AS + * Copyright (c) 2010 Varnish Software AS + * All rights reserved. + * + * Author: Kristian Lyngstol + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include "config.h" + +#include "svnid.h" +SVNID("$Id$") + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include "shmlog.h" +#include "cache.h" +#include "cache_backend.h" +#include "vrt.h" + +/*--------------------------------------------------------------------*/ + +/* FIXME: Should eventually be a configurable variable. */ +#define VDI_DNS_MAX_CACHE 1024 +#define VDI_DNS_GROUP_MAX_BACKENDS 1024 + +/* DNS Cache entry + */ +struct vdi_dns_hostgroup { + unsigned magic; +#define VDI_DNSDIR_MAGIC 0x1bacab21 + char *hostname; + struct director *hosts[VDI_DNS_GROUP_MAX_BACKENDS]; + unsigned nhosts; + unsigned next_host; /* Next to use...*/ + double ttl; + VTAILQ_ENTRY(vdi_dns_hostgroup) list; +}; + +struct vdi_dns { + unsigned magic; +#define VDI_DNS_MAGIC 0x1337a178 + struct director dir; + struct director **hosts; + unsigned nhosts; + VTAILQ_HEAD(_cachelist,vdi_dns_hostgroup) cachelist; + unsigned ncachelist; + pthread_rwlock_t rwlock; + const char *suffix; + double ttl; +}; + + + +/* Compare an IPv4 backend to a IPv4 addr/len */ +static int +vdi_dns_comp_addrinfo4(const struct backend *bp, + const struct sockaddr_in *addr, + const socklen_t len) +{ + uint32_t u, p; + struct sockaddr_in *bps = (struct sockaddr_in *) bp->ipv4; + + if (bp->ipv4len != len || len <= 0) + return 0; + + u = addr->sin_addr.s_addr; + p = bps->sin_addr.s_addr; + + return u == p; +} + +/* Compare an IPv6 backend to a IPv6 addr/len */ +static int +vdi_dns_comp_addrinfo6(const struct backend *bp, + struct sockaddr_in6 *addr, + const socklen_t len) +{ + uint8_t *u, *p; + int i; + struct sockaddr_in6 *bps = (struct sockaddr_in6 *) bp->ipv6; + + if (bp->ipv6len != len || len <= 0) + return 0; + + u = addr->sin6_addr.s6_addr; + p = bps->sin6_addr.s6_addr; + + for (i=0; i < 16; i++) { + if (u[i] != p[i]) + return 0; + } + + return 1; +} + +/* Check if a backends socket is the same as addr */ +static int +vdi_dns_comp_addrinfo(const struct director *dir, + struct sockaddr *addr, + const socklen_t len) +{ + struct backend *bp; + + bp = vdi_get_backend_if_simple(dir); + AN(bp); + if (addr->sa_family == PF_INET && bp->ipv4) { + return (vdi_dns_comp_addrinfo4(bp, (struct sockaddr_in *) + addr, len)); + } else if (addr->sa_family == PF_INET6 && bp->ipv6) { + return (vdi_dns_comp_addrinfo6(bp, (struct sockaddr_in6 *) + addr, len)); + } + return 0; +} + +/* Pick a host from an existing hostgroup. + * Balance on round-robin if multiple backends are available and only pick + * healthy ones. + */ +static struct director * +vdi_dns_pick_host(const struct sess *sp, struct vdi_dns_hostgroup *group) { + int initial, i, nhosts, current; + if (group->nhosts == 0) + return (NULL); // In case of error. + if (group->next_host >= group->nhosts) + group->next_host = 0; + + /* Pick a healthy backend */ + initial = group->next_host; + nhosts = group->nhosts; + for (i=0; i < nhosts; i++) { + if (i + initial >= nhosts) + current = i + initial - nhosts; + else + current = i + initial; + if (VBE_Healthy_sp(sp, group->hosts[current])) { + group->next_host = current+1; + return group->hosts[current]; + } + } + + return NULL; +} + +/* Remove an item from the dns cache. + * If *group is NULL, the head is popped. + * Remember locking. + */ +static void +vdi_dns_pop_cache(struct vdi_dns *vs, + struct vdi_dns_hostgroup *group) +{ + if (group == NULL) + group = VTAILQ_LAST( &vs->cachelist, _cachelist ); + assert(group != NULL); + free(group->hostname); + VTAILQ_REMOVE(&vs->cachelist, group, list); + FREE_OBJ(group); + vs->ncachelist--; +} + +/* Dummy in case someone feels like optimizing it? meh... + */ +static inline int +vdi_dns_groupmatch(const struct vdi_dns_hostgroup *group, const char *hostname) +{ + return !strcmp(group->hostname, hostname); +} + +/* Search the cache for 'hostname' and put a backend-pointer as necessary, + * return true for cache hit. This could still be a NULL backend if we did + * a lookup earlier and didn't find a host (ie: cache failed too) + * + * if rwlock is true, the first timed out object found (if any) is popped + * and freed. + */ +static int +vdi_dns_cache_has(const struct sess *sp, + struct vdi_dns *vs, + const char *hostname, + struct director **backend, + int rwlock) +{ + struct director *ret; + struct vdi_dns_hostgroup *hostgr; + struct vdi_dns_hostgroup *hostgr2; + VTAILQ_FOREACH_SAFE(hostgr, &vs->cachelist, list, hostgr2) { + CHECK_OBJ_NOTNULL(hostgr, VDI_DNSDIR_MAGIC); + if (hostgr->ttl <= sp->t_req) { + if (rwlock) + vdi_dns_pop_cache(vs, hostgr); + return 0; + } + if (vdi_dns_groupmatch(hostgr, hostname)) { + ret = (vdi_dns_pick_host(sp, hostgr)); + *backend = ret; + if (*backend != NULL) + CHECK_OBJ_NOTNULL(*backend, DIRECTOR_MAGIC); + return 1; + } + } + return 0; +} + +/* Add a newly cached item to the dns cache list. + * (Sorry for the list_add/_add confusion...) + */ +static void +vdi_dns_cache_list_add(const struct sess *sp, + struct vdi_dns *vs, + struct vdi_dns_hostgroup *new) +{ + if (vs->ncachelist >= VDI_DNS_MAX_CACHE) { + VSL_stats->dir_dns_cache_full++; + vdi_dns_pop_cache(vs, NULL); + } + CHECK_OBJ_NOTNULL(new, VDI_DNSDIR_MAGIC); + assert(new->hostname != 0); + new->ttl = sp->t_req + vs->ttl; + VTAILQ_INSERT_HEAD(&vs->cachelist, new, list); + vs->ncachelist++; +} + +/* Add an item to the dns cache. + * XXX: Might want to factor the getaddrinfo() out of the lock and do the + * cache_has() afterwards to do multiple dns lookups in parallel... + */ +static int +vdi_dns_cache_add(const struct sess *sp, + struct vdi_dns *vs, + const char *hostname, + struct director **backend) +{ + int error, i, host = 0; + struct addrinfo *res0, *res, hint; + struct vdi_dns_hostgroup *new; + /* Due to possible race while upgrading the lock, we have to + * recheck if the result is already looked up. The overhead for + * this is insignificant unless dns isn't cached properly (all + * unique names or something equally troublesome). + */ + + if (vdi_dns_cache_has(sp, vs, hostname, backend, 1)) + return 1; + + memset(&hint, 0, sizeof hint); + hint.ai_family = PF_UNSPEC; + hint.ai_socktype = SOCK_STREAM; + + ALLOC_OBJ(new, VDI_DNSDIR_MAGIC); + XXXAN(new); + new->hostname = calloc(sizeof(char), strlen(hostname)+1); + XXXAN(new->hostname); + strcpy(new->hostname, hostname); + + error = getaddrinfo(hostname, "80", &hint, &res0); + VSL_stats->dir_dns_lookups++; + if (error) { + vdi_dns_cache_list_add(sp, vs, new); + VSL_stats->dir_dns_failed++; + return 0; + } + + for (res = res0; res; res = res->ai_next) { + if (res->ai_family != PF_INET && res->ai_family != PF_INET6) + continue; + + for (i = 0; i < vs->nhosts; i++) { + if (vdi_dns_comp_addrinfo(vs->hosts[i], + res->ai_addr, res->ai_addrlen)) { + new->hosts[host] = vs->hosts[i]; + CHECK_OBJ_NOTNULL(new->hosts[host], + DIRECTOR_MAGIC); + host++; + } + } + } + freeaddrinfo(res0); + + new->nhosts = host; + vdi_dns_cache_list_add(sp, vs, new); + *backend = vdi_dns_pick_host(sp, new); + return 1; +} + +/* Walk through the cached lookups looking for the relevant host, add one + * if it isn't already cached. + * + * Returns a backend or NULL. + */ +static struct director * +vdi_dns_walk_cache(const struct sess *sp, + struct vdi_dns *vs, + const char *hostname) +{ + struct director *backend = NULL; + int ret; + AZ(pthread_rwlock_rdlock(&vs->rwlock)); + ret = vdi_dns_cache_has(sp, vs, hostname, &backend, 0); + AZ(pthread_rwlock_unlock(&vs->rwlock)); + if (!ret) { + AZ(pthread_rwlock_wrlock(&vs->rwlock)); + ret = vdi_dns_cache_add(sp, vs, hostname, &backend); + AZ(pthread_rwlock_unlock(&vs->rwlock)); + } else + VSL_stats->dir_dns_hit++; + + /* Bank backend == cached a failure, so to speak */ + if (backend != NULL) + CHECK_OBJ_NOTNULL(backend, DIRECTOR_MAGIC); + return backend; +} + +/* Parses the Host:-header and heads out to find a backend. + */ +static struct director * +vdi_dns_find_backend(const struct sess *sp, struct vdi_dns *vs) +{ + struct director *ret; + struct http *hp; + char *p; + char hostname[NI_MAXHOST]; + int i; + + /* bereq is only present after recv et. al, otherwise use req (ie: + * use req for health checks in vcl_recv and such). + */ + if (sp->wrk->bereq) + hp = sp->wrk->bereq; + else + hp = sp->http; + + + CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC); + if (http_GetHdr(hp, H_Host, &p) == 0) + return (NULL); + + /* We need a working copy since it's going to be modified */ + strncpy(hostname, p, sizeof(hostname)); + + /* remove port-portion of the Host-header, if present. */ + for (i = 0; i < strlen(hostname); i++) { + if (hostname[i] == ':') { + hostname[i] = '\0'; + break; + } + } + + if (vs->suffix) + strncat(hostname, vs->suffix, sizeof(hostname) - strlen(hostname)); + + ret = vdi_dns_walk_cache(sp, vs, hostname); + return ret; +} + +static struct vbe_conn * +vdi_dns_getfd(const struct director *director, struct sess *sp) +{ + struct vdi_dns *vs; + struct director *dir; + struct vbe_conn *vbe; + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(director, DIRECTOR_MAGIC); + CAST_OBJ_NOTNULL(vs, director->priv, VDI_DNS_MAGIC); + + dir = vdi_dns_find_backend(sp, vs); + if (!dir || !VBE_Healthy_sp(sp, dir)) + return (NULL); + + vbe = VBE_GetFd(dir, sp); + return (vbe); +} + +static unsigned +vdi_dns_healthy(double now, const struct director *dir, uintptr_t target) +{ + /* XXX: Fooling -Werror for a bit until it's actually implemented. + */ + if (now || dir || target) + return 1; + else + return 1; + return 1; + /* + struct vdi_dns *vs; + struct director *dir; + int i; + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC); + CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_DNS_MAGIC); + + dir = vdi_dns_find_backend(sp, vs); + + if (dir) + return 1; + return 0; + */ +} + +/*lint -e{818} not const-able */ +static void +vdi_dns_fini(struct director *d) +{ + struct vdi_dns *vs; + + CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC); + CAST_OBJ_NOTNULL(vs, d->priv, VDI_DNS_MAGIC); + + free(vs->hosts); + free(vs->dir.vcl_name); + vs->dir.magic = 0; + /* FIXME: Free the cache */ + AZ(pthread_rwlock_destroy(&vs->rwlock)); + FREE_OBJ(vs); +} + +void +VRT_init_dir_dns(struct cli *cli, struct director **bp, int idx, + const void *priv) +{ + const struct vrt_dir_dns *t; + struct vdi_dns *vs; + const struct vrt_dir_dns_entry *te; + int i; + + ASSERT_CLI(); + (void)cli; + t = priv; + ALLOC_OBJ(vs, VDI_DNS_MAGIC); + XXXAN(vs); + vs->hosts = calloc(sizeof(struct director *), t->nmember); + XXXAN(vs->hosts); + + vs->dir.magic = DIRECTOR_MAGIC; + vs->dir.priv = vs; + vs->dir.name = "dns"; + REPLACE(vs->dir.vcl_name, t->name); + vs->dir.getfd = vdi_dns_getfd; + vs->dir.fini = vdi_dns_fini; + vs->dir.healthy = vdi_dns_healthy; + + vs->suffix = t->suffix; + vs->ttl = t->ttl; + + te = t->members; + for (i = 0; i < t->nmember; i++, te++) + vs->hosts[i] = bp[te->host]; + vs->nhosts = t->nmember; + vs->ttl = t->ttl; + VTAILQ_INIT(&vs->cachelist); + AZ(pthread_rwlock_init(&vs->rwlock, NULL)); + bp[idx] = &vs->dir; +} Added: branches/2.1/varnish-cache/bin/varnishtest/tests/v00029.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/v00029.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/v00029.vtc 2010-10-20 13:44:17 UTC (rev 5443) @@ -0,0 +1,45 @@ +# $Id: v00028.vtc 5125 2010-08-25 08:57:04Z phk $ + +test "DNS director" + +server s1 { + rxreq + txresp +} -start + +varnish v1 -vcl+backend { + director d1 dns { + { .backend = s1; } + } + + sub vcl_recv { + set req.backend = d1; + return (pass); + } +} -start + + +client c1 { + txreq -hdr "Host: localhost" + rxresp + expect resp.status == 200 + + txreq -hdr "Host: .......coco-x-zamzam-i-cant-bother-making-it-random" + rxresp + expect resp.status == 503 +} -run + +varnish v2 -vcl { + + director directorname dns { + .list = { + .host_header = "www.example.com"; + .port = "80"; + .connect_timeout = 0.4s; + "192.168.15.0"/24; + "192.168.16.128"/25; + } + .ttl = 5m; + .suffix = "internal.example.net"; + } +} Added: branches/2.1/varnish-cache/bin/varnishtest/tests/v00030.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/v00030.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/v00030.vtc 2010-10-20 13:44:17 UTC (rev 5443) @@ -0,0 +1,53 @@ +# $Id: v00028.vtc 5125 2010-08-25 08:57:04Z phk $ + +test "DNS director bad VCL tests" + +varnish v1 -badvcl { + director directorname dns { + .list = { + 192.168.15.0/24; + } + } +} + +varnish v1 -badvcl { + director directorname dns { + .list = { + .host_header = "www.example.com"; + .port = "80"; + .connect_timeout = 0.4s; + } + } +} + +varnish v1 -badvcl { + director directorname dns { + .list = { + .host_hdr = "www.example.com"; + "192.168.16.128"/25; + } + } +} + +varnish v1 -badvcl { + director directorname dns { + .list = { + .port = 80; + "192.168.15.0"/24; + } + } +} +varnish v1 -badvcl { + director directorname dns { + .list = { + "192.168.15.0"/33; + } + } +} +varnish v1 -badvcl { + director directorname dns { + .list = { + "192.168.16.255"/24; + } + } +} Modified: branches/2.1/varnish-cache/configure.ac =================================================================== --- branches/2.1/varnish-cache/configure.ac 2010-10-20 13:37:02 UTC (rev 5442) +++ branches/2.1/varnish-cache/configure.ac 2010-10-20 13:44:17 UTC (rev 5443) @@ -5,7 +5,7 @@ Copyright (c) 2006-2010 Redpill Linpro AS Copyright (c) 2010 Varnish Software AS]) AC_REVISION([$Id$]) -AC_INIT([Varnish], [2.1.3], [varnish-dev at varnish-cache.org]) +AC_INIT([Varnish], [2.1.4], [varnish-dev at varnish-cache.org]) AC_CONFIG_SRCDIR(include/varnishapi.h) AM_CONFIG_HEADER(config.h) Added: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_dns.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_dir_dns.c (rev 0) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_dir_dns.c 2010-10-20 13:44:17 UTC (rev 5443) @@ -0,0 +1,360 @@ +/*- + * Copyright (c) 2009 Redpill Linpro AS + * Copyright (c) 2010 Varnish Software AS + * All rights reserved. + * + * Author: Kristian Lyngstol + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "config.h" + +#include "svnid.h" +SVNID("$Id$") + +#include +#include + +#include +#include +#include +#include + +#include "vsb.h" + +#include "vcc_priv.h" +#include "vcc_compile.h" +#include "libvarnish.h" + +/*-------------------------------------------------------------------- + * Parse directors + */ + + +static struct tokenlist_dir_backend_defaults { + char *port; + char *hostheader; + double connect_timeout; + double first_byte_timeout; + double between_bytes_timeout; + unsigned max_connections; + unsigned saint; +} b_defaults; + +static void +vcc_dir_initialize_defaults(void) +{ + b_defaults.port = NULL; + b_defaults.hostheader = NULL; + b_defaults.connect_timeout = -1.0; + b_defaults.first_byte_timeout = -1.0; + b_defaults.between_bytes_timeout = -1.0; + b_defaults.max_connections = UINT_MAX; + b_defaults.saint = UINT_MAX; +} + +static const struct token *dns_first; +static void +print_backend(struct tokenlist *tl, + int serial, + const uint8_t *ip) +{ + char vgcname[BUFSIZ]; + char strip[16]; + struct token tmptok; + struct vsb *vsb; + + bprintf(strip, "%u.%u.%u.%u", ip[3], ip[2], ip[1], ip[0]); + tmptok.dec = strip; + bprintf(vgcname, "%.*s_%d", PF(tl->t_dir), serial); + vsb = vsb_newauto(); + AN(vsb); + tl->fb = vsb; + Fc(tl, 0, "\t{ .host = VGC_backend_%s },\n",vgcname); + Fh(tl, 1, "\n#define VGC_backend_%s %d\n", vgcname, serial); + + Fb(tl, 0, "\nstatic const struct vrt_backend vgc_dir_priv_%s = {\n", + vgcname); + + Fb(tl, 0, "\t.vcl_name = \"%.*s", PF(tl->t_dir)); + if (serial >= 0) + Fb(tl, 0, "[%d]", serial); + Fb(tl, 0, "\",\n"); + Emit_Sockaddr(tl, &tmptok, b_defaults.port); + vcc_EmitBeIdent(tl, tl->fb, serial, dns_first , tl->t); + + Fb(tl, 0, "\t.hosthdr = \""); + if (b_defaults.hostheader != NULL) + Fb(tl,0, b_defaults.hostheader); + else + Fb(tl,0, strip); + Fb(tl, 0, "\",\n"); + + Fb(tl, 0, "\t.saintmode_threshold = %d,\n",b_defaults.saint); +#define FB_TIMEOUT(type) do { \ + if (b_defaults.type != -1.0) \ + Fb(tl, 0, "\t.%s = %g,\n",#type,b_defaults.type); \ + } while (0) + FB_TIMEOUT(connect_timeout); + FB_TIMEOUT(first_byte_timeout); + FB_TIMEOUT(between_bytes_timeout); + + Fb(tl, 0, "};\n"); + tl->fb = NULL; + vsb_finish(vsb); + Fh(tl, 0, "%s", vsb_data(vsb)); + vsb_delete(vsb); + Fi(tl, 0, "\tVRT_init_dir(cli, VCL_conf.director, \"simple\",\n" + "\t VGC_backend_%s, &vgc_dir_priv_%s);\n", vgcname, vgcname); + Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(%s));\n", vgcname); + tl->ndirector++; +} + +/* + * Output backends for all IPs in the range supplied by + * "a[0].a[1].a[2].a[3]/inmask". + * + * XXX: + * This assumes that a uint32_t can be safely accessed as an array of 4 + * uint8_ts. + */ +static void +vcc_dir_dns_makebackend(struct tokenlist *tl, + int *serial, + const unsigned char a[], + int inmask) +{ + uint32_t ip4=0; + uint32_t ip4end; + uint32_t mask = UINT32_MAX << (32-inmask); + + ip4 |= a[0] << 24; + ip4 |= a[1] << 16; + ip4 |= a[2] << 8; + ip4 |= a[3] ; + + ip4end = ip4 | ~mask; + assert (ip4 == (ip4 & mask)); + +/* printf("uip4: \t0x%.8X\na: \t0x", ip4,ip4); + for (int i=0;i<4;i++) printf("%.2X",a[i]); + printf("\nmask:\t0x%.8X\nend:\t0x%.8X\n", mask, ip4end); +*/ + while (ip4 <= ip4end) { + uint8_t *b; + b=(uint8_t *)&ip4; + (*serial)++; + print_backend(tl, *serial, b); + ip4++; + } +} +static void +vcc_dir_dns_parse_backend_options(struct tokenlist *tl) +{ + struct fld_spec *fs; + struct token *t_field; + double t; + unsigned u; + vcc_dir_initialize_defaults(); + fs = vcc_FldSpec(tl, + "?port", + "?host_header", + "?connect_timeout", + "?first_byte_timeout", + "?between_bytes_timeout", + "?max_connections", + "?saintmode_threshold", + NULL); + while (tl->t->tok != CSTR) { + + vcc_IsField(tl, &t_field, fs); + ERRCHK(tl); + if (vcc_IdIs(t_field, "port")) { + ExpectErr(tl, CSTR); + assert(tl->t->dec != NULL); + b_defaults.port = strdup(tl->t->dec); + assert(b_defaults.port); + vcc_NextToken(tl); + SkipToken(tl, ';'); + } else if (vcc_IdIs(t_field, "host_header")) { + ExpectErr(tl, CSTR); + assert(tl->t->dec != NULL); + b_defaults.hostheader = strdup(tl->t->dec); + assert(b_defaults.hostheader); + vcc_NextToken(tl); + SkipToken(tl, ';'); + } else if (vcc_IdIs(t_field, "connect_timeout")) { + vcc_TimeVal(tl, &t); + ERRCHK(tl); + b_defaults.connect_timeout = t; + SkipToken(tl, ';'); + } else if (vcc_IdIs(t_field, "first_byte_timeout")) { + vcc_TimeVal(tl, &t); + ERRCHK(tl); + b_defaults.first_byte_timeout = t; + SkipToken(tl, ';'); + } else if (vcc_IdIs(t_field, "between_bytes_timeout")) { + vcc_TimeVal(tl, &t); + ERRCHK(tl); + b_defaults.between_bytes_timeout = t; + SkipToken(tl, ';'); + } else if (vcc_IdIs(t_field, "max_connections")) { + u = vcc_UintVal(tl); + ERRCHK(tl); + SkipToken(tl, ';'); + b_defaults.max_connections = u; + } else if (vcc_IdIs(t_field, "saintmode_threshold")) { + u = vcc_UintVal(tl); + /* UINT_MAX == magic number to mark as unset, so + * not allowed here. + */ + if (u == UINT_MAX) { + vsb_printf(tl->sb, + "Value outside allowed range: "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + } + ERRCHK(tl); + b_defaults.saint = u; + SkipToken(tl, ';'); + } else { + ErrInternal(tl); + return; + } + + } +} + +/* Parse a list of backends with optional /mask notation, then print out + * all relevant backends. + */ +static void +vcc_dir_dns_parse_list(struct tokenlist *tl, int *serial) +{ + unsigned char a[4],mask; + int ret; + ERRCHK(tl); + SkipToken(tl, '{'); + if (tl->t->tok != CSTR) + vcc_dir_dns_parse_backend_options(tl); + while (tl->t->tok == CSTR) { + mask = 32; + ret = sscanf(tl->t->dec, "%hhu.%hhu.%hhu.%hhu", + &a[0], &a[1], &a[2], &a[3]); + assert(ret == 4); + vcc_NextToken(tl); + if (tl->t->tok == '/') { + vcc_NextToken(tl); + mask = vcc_UintVal(tl); + ERRCHK(tl); + } + vcc_dir_dns_makebackend(tl,serial,a,mask); + SkipToken(tl,';'); + } + ExpectErr(tl, '}'); +} + +void +vcc_ParseDnsDirector(struct tokenlist *tl) +{ + struct token *t_field, *t_be, *t_suffix = NULL; + double ttl = 60.0; + int nelem = 0; + struct fld_spec *fs; + const char *first; + char *p; + dns_first = tl->t; + tl->fb = tl->fc; + fs = vcc_FldSpec(tl, "!backend", "?ttl", "?suffix","?list", NULL); + + Fc(tl, 0, "\nstatic const struct vrt_dir_dns_entry " + "vddnse_%.*s[] = {\n", PF(tl->t_dir)); + + for (; tl->t->tok != '}'; ) { /* List of members */ + if (tl->t->tok == '{') { + nelem++; + first = ""; + t_be = tl->t; + vcc_ResetFldSpec(fs); + + ExpectErr(tl, '{'); + vcc_NextToken(tl); + Fc(tl, 0, "\t{"); + + while (tl->t->tok != '}') { /* Member fields */ + vcc_IsField(tl, &t_field, fs); + ERRCHK(tl); + if (vcc_IdIs(t_field, "backend")) { + vcc_ParseBackendHost(tl, nelem, &p); + ERRCHK(tl); + AN(p); + Fc(tl, 0, "%s .host = VGC_backend_%s", + first, p); + } else { + ErrInternal(tl); + } + first = ", "; + } + vcc_FieldsOk(tl, fs); + if (tl->err) { + vsb_printf(tl->sb, "\nIn member host" + " specification starting at:\n"); + vcc_ErrWhere(tl, t_be); + return; + } + Fc(tl, 0, " },\n"); + } else { + vcc_IsField(tl, &t_field, fs); + ERRCHK(tl); + if (vcc_IdIs(t_field, "suffix")) { + ExpectErr(tl, CSTR); + t_suffix = tl->t; + vcc_NextToken(tl); + ExpectErr(tl, ';'); + } else if (vcc_IdIs(t_field, "ttl")) { + vcc_RTimeVal(tl, &ttl); + ExpectErr(tl, ';'); + } else if (vcc_IdIs(t_field, "list")) { + vcc_dir_dns_parse_list(tl,&nelem); + } + } + vcc_NextToken(tl); + } + Fc(tl, 0, "};\n"); + Fc(tl, 0, "\nstatic const struct vrt_dir_dns vgc_dir_priv_%.*s = {\n", + PF(tl->t_dir)); + Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(tl->t_dir)); + Fc(tl, 0, "\t.nmember = %d,\n", nelem); + Fc(tl, 0, "\t.members = vddnse_%.*s,\n", PF(tl->t_dir)); + Fc(tl, 0, "\t.suffix = "); + if (t_suffix) + Fc(tl, 0, "%.*s", PF(t_suffix)); + else + Fc(tl, 0, "\"\""); + Fc(tl, 0, ",\n"); + Fc(tl, 0, "\t.ttl = %f", ttl); + Fc(tl, 0, ",\n"); + Fc(tl, 0, "};\n"); + Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(_%.*s));\n", PF(tl->t_dir)); +} From tfheen at varnish-cache.org Thu Oct 21 08:48:31 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 21 Oct 2010 10:48:31 +0200 Subject: r5444 - trunk/varnish-cache/redhat Message-ID: Author: tfheen Date: 2010-10-21 10:48:31 +0200 (Thu, 21 Oct 2010) New Revision: 5444 Modified: trunk/varnish-cache/redhat/varnish.spec Log: Update for new world order wrt docs Modified: trunk/varnish-cache/redhat/varnish.spec =================================================================== --- trunk/varnish-cache/redhat/varnish.spec 2010-10-20 13:44:17 UTC (rev 5443) +++ trunk/varnish-cache/redhat/varnish.spec 2010-10-21 08:48:31 UTC (rev 5444) @@ -10,9 +10,7 @@ # The svn sources needs autoconf, automake and libtool to generate a suitable # configure script. Release tarballs would not need this BuildRequires: automake autoconf libtool -BuildRequires: ncurses-devel libxslt groff pcre-devel pkgconfig tex(latex) -BuildRequires: python-docutils >= 0.6 -BuildRequires: python-sphinx >= 0.6 +BuildRequires: ncurses-devel libxslt groff pcre-devel pkgconfig Requires: varnish-libs = %{version}-%{release} Requires: logrotate Requires: ncurses @@ -138,18 +136,7 @@ redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnishncsa.initrc %endif -# Build html and latex/pdf docs -# Including the sphinx sources may be a good thing for advanced users -pushd doc/sphinx -%{__make} html -%{__make} latex -pushd \=build/latex -# Something is broken in the latex version -for i in `seq 1 53`; do echo -e '\n'; done | %{__make} || true -popd; popd -mv doc/sphinx/\=build/html doc -mv doc/sphinx/\=build/latex/Varnish.pdf doc -rm -rvf doc/sphinx/\=build/* +cp -r doc/sphinx/\=build/html doc %check # rhel5 on ppc64 is just too strange @@ -202,7 +189,7 @@ %{_var}/log/varnish %{_mandir}/man1/*.1* %{_mandir}/man7/*.7* -%doc INSTALL LICENSE README redhat/README.redhat ChangeLog doc/getting-started.html +%doc INSTALL LICENSE README redhat/README.redhat ChangeLog %doc examples %dir %{_sysconfdir}/varnish/ %config(noreplace) %{_sysconfdir}/varnish/default.vcl @@ -230,7 +217,6 @@ %files docs %doc LICENSE -%doc doc/Varnish.pdf %doc doc/sphinx %doc doc/html From tfheen at varnish-cache.org Thu Oct 21 08:48:57 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 21 Oct 2010 10:48:57 +0200 Subject: r5445 - branches/2.1/varnish-cache/redhat Message-ID: Author: tfheen Date: 2010-10-21 10:48:57 +0200 (Thu, 21 Oct 2010) New Revision: 5445 Modified: branches/2.1/varnish-cache/redhat/varnish.spec Log: Merge 5444: Update for new world order wrt docs Modified: branches/2.1/varnish-cache/redhat/varnish.spec =================================================================== --- branches/2.1/varnish-cache/redhat/varnish.spec 2010-10-21 08:48:31 UTC (rev 5444) +++ branches/2.1/varnish-cache/redhat/varnish.spec 2010-10-21 08:48:57 UTC (rev 5445) @@ -10,9 +10,7 @@ # The svn sources needs autoconf, automake and libtool to generate a suitable # configure script. Release tarballs would not need this #BuildRequires: automake autoconf libtool -BuildRequires: ncurses-devel libxslt groff pcre-devel pkgconfig tex(latex) -BuildRequires: python-docutils >= 0.6 -BuildRequires: python-sphinx >= 0.6 +BuildRequires: ncurses-devel libxslt groff pcre-devel pkgconfig Requires: varnish-libs = %{version}-%{release} Requires: logrotate Requires: ncurses @@ -138,18 +136,7 @@ redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnishncsa.initrc %endif -# Build html and latex/pdf docs -# Including the sphinx sources may be a good thing for advanced users -pushd doc/sphinx -%{__make} html -%{__make} latex -pushd \=build/latex -# Something is broken in the latex version -for i in `seq 1 53`; do echo -e '\n'; done | %{__make} || true -popd; popd -mv doc/sphinx/\=build/html doc -mv doc/sphinx/\=build/latex/Varnish.pdf doc -rm -rvf doc/sphinx/\=build/* +cp -r doc/sphinx/\=build/html doc %check # rhel5 on ppc64 is just too strange @@ -202,7 +189,7 @@ %{_var}/log/varnish %{_mandir}/man1/*.1* %{_mandir}/man7/*.7* -%doc INSTALL LICENSE README redhat/README.redhat ChangeLog doc/getting-started.html +%doc INSTALL LICENSE README redhat/README.redhat ChangeLog %doc examples %dir %{_sysconfdir}/varnish/ %config(noreplace) %{_sysconfdir}/varnish/default.vcl @@ -230,7 +217,6 @@ %files docs %doc LICENSE -%doc doc/Varnish.pdf %doc doc/sphinx %doc doc/html From tfheen at varnish-cache.org Thu Oct 21 08:49:54 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 21 Oct 2010 10:49:54 +0200 Subject: r5446 - branches/2.1/varnish-cache/redhat Message-ID: Author: tfheen Date: 2010-10-21 10:49:53 +0200 (Thu, 21 Oct 2010) New Revision: 5446 Modified: branches/2.1/varnish-cache/redhat/varnish.spec Log: Prepare spec file for release Modified: branches/2.1/varnish-cache/redhat/varnish.spec =================================================================== --- branches/2.1/varnish-cache/redhat/varnish.spec 2010-10-21 08:48:57 UTC (rev 5445) +++ branches/2.1/varnish-cache/redhat/varnish.spec 2010-10-21 08:49:53 UTC (rev 5446) @@ -1,7 +1,7 @@ Summary: High-performance HTTP accelerator Name: varnish Version: 2.1.4 -Release: 0.svn20100928%{?dist} +Release: 1%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.varnish-cache.org/ From tfheen at varnish-cache.org Thu Oct 21 09:52:15 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 21 Oct 2010 11:52:15 +0200 Subject: r5447 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-10-21 11:52:14 +0200 (Thu, 21 Oct 2010) New Revision: 5447 Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml Log: Fix duplicated section Modified: branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-21 08:49:53 UTC (rev 5446) +++ branches/2.1/varnish-cache/doc/changes-2.1.3-2.1.4.xml 2010-10-21 09:52:14 UTC (rev 5447) @@ -57,14 +57,6 @@ when a backend connection is closed. - - In a high traffic environment, we would sometimes reuse a - file descriptor before flushing the logs from a worker thread to - the shared log buffer. This would cause confusion in some of - the tools. This has been fixed by explicitly flushing the log - when a backend connection is closed. - - If the communication between the management and the child process gets out of sync, we have no way to recover. From tfheen at varnish-cache.org Thu Oct 21 13:50:40 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 21 Oct 2010 15:50:40 +0200 Subject: r5448 - in tags: . varnish-2.1.4 Message-ID: Author: tfheen Date: 2010-10-21 15:50:39 +0200 (Thu, 21 Oct 2010) New Revision: 5448 Added: tags/varnish-2.1.4/ Log: Tag 2.1.4 Property changes on: tags/varnish-2.1.4 ___________________________________________________________________ Added: svn:ignore + .deps Makefile Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.status config.sub configure depcomp install-sh missing stamp-h1 varnish Added: 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,5435,5439-5440 From phk at varnish-cache.org Thu Oct 21 19:30:00 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 21 Oct 2010 21:30:00 +0200 Subject: r5449 - trunk/varnish-cache/doc/sphinx Message-ID: Author: phk Date: 2010-10-21 21:29:59 +0200 (Thu, 21 Oct 2010) New Revision: 5449 Modified: trunk/varnish-cache/doc/sphinx/Makefile.am Log: Use rm -rf to prevent silly questions from being asked Modified: trunk/varnish-cache/doc/sphinx/Makefile.am =================================================================== --- trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-21 13:50:39 UTC (rev 5448) +++ trunk/varnish-cache/doc/sphinx/Makefile.am 2010-10-21 19:29:59 UTC (rev 5449) @@ -144,4 +144,4 @@ cp -r $(BUILDDIR) $(distdir) distclean-local: - rm -r $(BUILDDIR) + rm -rf $(BUILDDIR) From phk at varnish-cache.org Thu Oct 21 19:35:25 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 21 Oct 2010 21:35:25 +0200 Subject: r5450 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-21 21:35:25 +0200 (Thu, 21 Oct 2010) New Revision: 5450 Modified: trunk/varnish-cache/bin/varnishtest/vtc_log.c Log: An assert a day keeps the bugs away Modified: trunk/varnish-cache/bin/varnishtest/vtc_log.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 19:29:59 UTC (rev 5449) +++ trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 19:35:25 UTC (rev 5450) @@ -65,6 +65,7 @@ vtc_loginit() { + AZ(vtclog_full); vtclog_full = vsb_newauto(); AN(vtclog_full); AZ(pthread_mutex_init(&vtclog_mtx, NULL)); @@ -74,6 +75,7 @@ vtc_logreset() { + AN(vtclog_full); vsb_clear(vtclog_full); } From phk at varnish-cache.org Thu Oct 21 19:40:22 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 21 Oct 2010 21:40:22 +0200 Subject: r5451 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-21 21:40:21 +0200 (Thu, 21 Oct 2010) New Revision: 5451 Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c trunk/varnish-cache/bin/varnishd/hash_critbit.c trunk/varnish-cache/bin/varnishd/storage_synth.c trunk/varnish-cache/bin/varnishd/storage_umem.c Log: Remove needless pthread.h includes, we do that in cache.h Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_lck.c 2010-10-21 19:35:25 UTC (rev 5450) +++ trunk/varnish-cache/bin/varnishd/cache_lck.c 2010-10-21 19:40:21 UTC (rev 5451) @@ -40,10 +40,6 @@ #include -#include -#ifdef HAVE_PTHREAD_NP_H -#include -#endif #include #include "cache.h" Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-10-21 19:35:25 UTC (rev 5450) +++ trunk/varnish-cache/bin/varnishd/hash_critbit.c 2010-10-21 19:40:21 UTC (rev 5451) @@ -35,7 +35,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include Modified: trunk/varnish-cache/bin/varnishd/storage_synth.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_synth.c 2010-10-21 19:35:25 UTC (rev 5450) +++ trunk/varnish-cache/bin/varnishd/storage_synth.c 2010-10-21 19:40:21 UTC (rev 5451) @@ -37,7 +37,6 @@ #include #include -#include #include "cache.h" #include "vsb.h" Modified: trunk/varnish-cache/bin/varnishd/storage_umem.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_umem.c 2010-10-21 19:35:25 UTC (rev 5450) +++ trunk/varnish-cache/bin/varnishd/storage_umem.c 2010-10-21 19:40:21 UTC (rev 5451) @@ -40,7 +40,6 @@ #include #include -#include #include From phk at varnish-cache.org Thu Oct 21 19:43:16 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 21 Oct 2010 21:43:16 +0200 Subject: r5452 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-21 21:43:16 +0200 (Thu, 21 Oct 2010) New Revision: 5452 Modified: trunk/varnish-cache/bin/varnishtest/vtc.c trunk/varnish-cache/bin/varnishtest/vtc.h trunk/varnish-cache/bin/varnishtest/vtc_client.c trunk/varnish-cache/bin/varnishtest/vtc_http.c trunk/varnish-cache/bin/varnishtest/vtc_log.c trunk/varnish-cache/bin/varnishtest/vtc_sema.c trunk/varnish-cache/bin/varnishtest/vtc_server.c trunk/varnish-cache/bin/varnishtest/vtc_varnish.c Log: Use the eminently portable but non-portable pthread_timedjoin_np() to wait for the testcase. Modified: trunk/varnish-cache/bin/varnishtest/vtc.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -65,8 +64,6 @@ pthread_t vtc_thread; char vtc_tmpdir[PATH_MAX]; static struct vtclog *vltop; -static pthread_mutex_t vtc_mtx; -static pthread_cond_t vtc_cond; /********************************************************************** * Macro facility @@ -516,9 +513,6 @@ vtc_log(vltop, 1, "RESETTING after %s", pe->fn); reset_cmds(cmds); vtc_error = old_err; - AZ(pthread_mutex_lock(&vtc_mtx)); - AZ(pthread_cond_signal(&vtc_cond)); - AZ(pthread_mutex_unlock(&vtc_mtx)); return (NULL); } @@ -532,6 +526,7 @@ void *v; int i; + vtc_logreset(); t0 = TIM_mono(); vtc_stop = 0; vtc_desc = NULL; @@ -546,37 +541,22 @@ ts.tv_sec = (long)floor(t); ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); - AZ(pthread_mutex_lock(&vtc_mtx)); AZ(pthread_create(&pt, NULL, exec_file_thread, &pe)); - i = pthread_cond_timedwait(&vtc_cond, &vtc_mtx, &ts); + i = pthread_timedjoin_np(pt, &v, &ts); memset(&vtc_thread, 0, sizeof vtc_thread); - if (i == 0) { - AZ(pthread_mutex_unlock(&vtc_mtx)); - AZ(pthread_join(pt, &v)); - } else { - AZ(pthread_mutex_unlock(&vtc_mtx)); + if (i != 0) { if (i != ETIMEDOUT) vtc_log(vltop, 1, "Weird condwait return: %d %s", i, strerror(i)); - /* - * We are all going to die anyway, so don't waste time - * trying to clean things up, it seems to trigger a - * problem in the tinderbox - * AZ(pthread_mutex_unlock(&vtc_mtx)); - * AZ(pthread_cancel(pt)); - * AZ(pthread_join(pt, &v)); - */ vtc_log(vltop, 1, "Test timed out"); vtc_error = 1; } if (vtc_error) vtc_log(vltop, 1, "TEST %s FAILED", fn); - else { + else vtc_log(vltop, 1, "TEST %s completed", fn); - vtc_logreset(); - } t0 = TIM_mono() - t0; @@ -604,10 +584,6 @@ * Main */ -/********************************************************************** - * Main - */ - int main(int argc, char * const *argv) { @@ -661,9 +637,6 @@ bprintf(topbuild, "%s/%s", cwd, TOP_BUILDDIR); macro_def(vltop, NULL, "topbuild", topbuild); - AZ(pthread_mutex_init(&vtc_mtx, NULL)); - AZ(pthread_cond_init(&vtc_cond, NULL)); - macro_def(vltop, NULL, "bad_ip", "10.255.255.255"); tmax = 0; nmax = NULL; Modified: trunk/varnish-cache/bin/varnishtest/vtc.h =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc.h 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc.h 2010-10-21 19:43:16 UTC (rev 5452) @@ -29,6 +29,9 @@ */ #include +#ifdef HAVE_PTHREAD_NP_H +#include +#endif struct vsb; struct vtclog; Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -36,7 +36,6 @@ #include #include #include -#include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_log.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include "libvarnish.h" Modified: trunk/varnish-cache/bin/varnishtest/vtc_sema.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -36,7 +36,6 @@ #include #include #include -#include #include "vtc.h" Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_server.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_server.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-21 19:40:21 UTC (rev 5451) +++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-21 19:43:16 UTC (rev 5452) @@ -41,7 +41,6 @@ #include #include #include -#include #include #include From phk at varnish-cache.org Thu Oct 21 20:02:59 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 21 Oct 2010 22:02:59 +0200 Subject: r5453 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: phk Date: 2010-10-21 22:02:58 +0200 (Thu, 21 Oct 2010) New Revision: 5453 Modified: trunk/varnish-cache/bin/varnishtest/flint.sh trunk/varnish-cache/bin/varnishtest/vtc_client.c trunk/varnish-cache/bin/varnishtest/vtc_http.c trunk/varnish-cache/bin/varnishtest/vtc_log.c trunk/varnish-cache/bin/varnishtest/vtc_sema.c trunk/varnish-cache/bin/varnishtest/vtc_server.c trunk/varnish-cache/bin/varnishtest/vtc_varnish.c Log: Remove unused #includes Modified: trunk/varnish-cache/bin/varnishtest/flint.sh =================================================================== --- trunk/varnish-cache/bin/varnishtest/flint.sh 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/flint.sh 2010-10-21 20:02:58 UTC (rev 5453) @@ -1,6 +1,7 @@ #!/bin/sh flexelint \ + -DTOP_BUILDDIR='"foo"' \ -I/usr/include \ -I. \ -I../../include \ Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_client.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -31,7 +31,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -31,7 +31,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_log.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_log.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -31,7 +31,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_sema.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_sema.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -31,7 +31,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_server.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_server.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -31,7 +31,6 @@ #include "svnid.h" SVNID("$Id$") -#include #include #include #include Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-21 19:43:16 UTC (rev 5452) +++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2010-10-21 20:02:58 UTC (rev 5453) @@ -33,7 +33,6 @@ #include -#include #include #include #include From tfheen at varnish-cache.org Fri Oct 22 06:43:32 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Fri, 22 Oct 2010 08:43:32 +0200 Subject: r5454 - trunk/varnish-cache/bin/varnishtest Message-ID: Author: tfheen Date: 2010-10-22 08:43:31 +0200 (Fri, 22 Oct 2010) New Revision: 5454 Modified: trunk/varnish-cache/bin/varnishtest/vtc.h Log: Add missing #include Modified: trunk/varnish-cache/bin/varnishtest/vtc.h =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc.h 2010-10-21 20:02:58 UTC (rev 5453) +++ trunk/varnish-cache/bin/varnishtest/vtc.h 2010-10-22 06:43:31 UTC (rev 5454) @@ -28,6 +28,7 @@ * $Id$ */ +#include #include #ifdef HAVE_PTHREAD_NP_H #include From tfheen at varnish-cache.org Fri Oct 22 07:31:37 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Fri, 22 Oct 2010 09:31:37 +0200 Subject: r5455 - in branches/2.1: . varnish-cache varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-22 09:31:37 +0200 (Fri, 22 Oct 2010) New Revision: 5455 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/configure.ac branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 r5429: Look also for rst2man.py (for FreeBSD) Fixes #798 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 Modified: branches/2.1/varnish-cache/configure.ac =================================================================== --- branches/2.1/varnish-cache/configure.ac 2010-10-22 06:43:31 UTC (rev 5454) +++ branches/2.1/varnish-cache/configure.ac 2010-10-22 07:31:37 UTC (rev 5455) @@ -30,7 +30,7 @@ AC_MSG_WARN([xsltproc not found ? not building documentation]) fi AM_CONDITIONAL(HAVE_XSLTPROC,[test "x$XSLTPROC" != "xno"]) -AC_CHECK_PROGS(RST2MAN, [rst2man], "no") +AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], "no") if test "x$RST2MAN" = "xno"; then AC_MSG_WARN([rst2man not found ? not building man pages]) fi 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 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,5435,5439-5440 + /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,5435,5439-5440 From phk at varnish-cache.org Fri Oct 22 10:00:55 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 22 Oct 2010 12:00:55 +0200 Subject: r5456 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-22 12:00:55 +0200 (Fri, 22 Oct 2010) New Revision: 5456 Modified: trunk/varnish-cache/bin/varnishd/stevedore.c Log: Add a clarifying assert Modified: trunk/varnish-cache/bin/varnishd/stevedore.c =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.c 2010-10-22 07:31:37 UTC (rev 5455) +++ trunk/varnish-cache/bin/varnishd/stevedore.c 2010-10-22 10:00:55 UTC (rev 5456) @@ -266,6 +266,7 @@ int ac, l; static unsigned seq = 0; + ASSERT_MGT(); p = strchr(spec, '='); q = strchr(spec, ','); if (p != NULL && (q == NULL || q > p)) { From phk at varnish-cache.org Fri Oct 22 10:29:17 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 22 Oct 2010 12:29:17 +0200 Subject: r5457 - in trunk/varnish-cache: bin/varnishd bin/varnishtest/tests include lib/libvcl Message-ID: Author: phk Date: 2010-10-22 12:29:17 +0200 (Fri, 22 Oct 2010) New Revision: 5457 Added: trunk/varnish-cache/bin/varnishtest/tests/v00031.vtc Modified: trunk/varnish-cache/bin/varnishd/mgt.h trunk/varnish-cache/bin/varnishd/mgt_param.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/include/libvcl.h trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Add a parameter "vcc_err_unref" which controls if unreferenced VCL objects (ACL, backend, subroutine etc) are errors or warnings. Modified: trunk/varnish-cache/bin/varnishd/mgt.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt.h 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/bin/varnishd/mgt.h 2010-10-22 10:29:17 UTC (rev 5457) @@ -83,8 +83,8 @@ extern char *mgt_cc_cmd; extern char *mgt_vcl_dir; extern char *mgt_vmod_dir; +extern unsigned mgt_vcc_err_unref; - #define REPORT0(pri, fmt) \ do { \ fprintf(stderr, fmt "\n"); \ Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-10-22 10:29:17 UTC (rev 5457) @@ -832,6 +832,10 @@ ".", #endif NULL }, + { "vcc_err_unref", tweak_bool, &mgt_vcc_err_unref, 0, 0, + "Unreferenced VCL objects result in error.\n", + 0, + "on", "bool" }, { NULL, NULL, NULL } }; Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-10-22 10:29:17 UTC (rev 5457) @@ -69,6 +69,7 @@ char *mgt_cc_cmd; char *mgt_vcl_dir; char *mgt_vmod_dir; +unsigned mgt_vcc_err_unref; static struct vcc *vcc; @@ -146,6 +147,7 @@ XXXAN(sb); VCC_VCL_dir(vcc, mgt_vcl_dir); VCC_VMOD_dir(vcc, mgt_vmod_dir); + VCC_Err_Unref(vcc, mgt_vcc_err_unref); csrc = VCC_Compile(vcc, sb, vp->vcl); vsb_finish(sb); AZ(vsb_overflowed(sb)); Added: trunk/varnish-cache/bin/varnishtest/tests/v00031.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00031.vtc (rev 0) +++ trunk/varnish-cache/bin/varnishtest/tests/v00031.vtc 2010-10-22 10:29:17 UTC (rev 5457) @@ -0,0 +1,23 @@ +# $Id$ + +test "param vcc_err_unref" + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + backend c { .host = "127.0.0.1"; } +} + +varnish v1 -cliok "param.set vcc_err_unref false" + +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + backend c { .host = "127.0.0.1"; } +} + +varnish v1 -cliok "param.set vcc_err_unref true" + +varnish v1 -badvcl { + backend b { .host = "127.0.0.1"; } + backend c { .host = "127.0.0.1"; } +} + Modified: trunk/varnish-cache/include/libvcl.h =================================================================== --- trunk/varnish-cache/include/libvcl.h 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/include/libvcl.h 2010-10-22 10:29:17 UTC (rev 5457) @@ -35,6 +35,7 @@ void VCC_Default_VCL(struct vcc *, const char *str); void VCC_VCL_dir(struct vcc *, const char *str); void VCC_VMOD_dir(struct vcc *, const char *str); +void VCC_Err_Unref(struct vcc *tl, unsigned u); char *VCC_Compile(const struct vcc *, struct vsb *sb, const char *b); const char *VCC_Return_Name(unsigned action); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-22 10:29:17 UTC (rev 5457) @@ -472,6 +472,9 @@ REPLACE(tl->default_vcl, tl0->default_vcl); REPLACE(tl->vcl_dir, tl0->vcl_dir); tl->vars = tl0->vars; + tl->err_unref = tl0->err_unref; + } else { + tl->err_unref = 1; } VTAILQ_INIT(&tl->symbols); VTAILQ_INIT(&tl->hosts); @@ -753,3 +756,16 @@ CHECK_OBJ_NOTNULL(tl, VCC_MAGIC); REPLACE(tl->vmod_dir, str); } + +/*-------------------------------------------------------------------- + * Configure default + */ + +void +VCC_Err_Unref(struct vcc *tl, unsigned u) +{ + + CHECK_OBJ_NOTNULL(tl, VCC_MAGIC); + printf("EU= %u\n", u); + tl->err_unref = u; +} Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-22 10:29:17 UTC (rev 5457) @@ -152,6 +152,8 @@ unsigned recnt; unsigned nsockaddr; unsigned nvmodpriv; + + unsigned err_unref; }; struct var { Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-10-22 10:00:55 UTC (rev 5456) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-10-22 10:29:17 UTC (rev 5457) @@ -114,6 +114,10 @@ vsb_printf(tl->sb, "Unused %s %.*s, defined:\n", VCC_SymKind(tl, sym), PF(sym->def_b)); vcc_ErrWhere(tl, sym->def_b); + if (!tl->err_unref) { + vsb_printf(tl->sb, "(That was just a warning)\n"); + tl->err = 0; + } } } From phk at varnish-cache.org Fri Oct 22 18:53:02 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Fri, 22 Oct 2010 20:53:02 +0200 Subject: r5458 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-22 20:53:02 +0200 (Fri, 22 Oct 2010) New Revision: 5458 Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Don't assert the format until we have done the error check. The ticket (#799) probably triggers this by using std.random() without a "import std" statement. Fixes: #799 Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-22 10:29:17 UTC (rev 5457) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-22 18:53:02 UTC (rev 5458) @@ -663,8 +663,8 @@ tk = tl->t; vcc_NextToken(tl); vcc_expr4(tl, &e2, f2); + ERRCHK(tl); assert(e2->fmt == f2); - ERRCHK(tl); if (tk->tok == '*') *e = vcc_expr_edit(f3, "(\v1*\v2)", *e, e2); else From tfheen at varnish-cache.org Mon Oct 25 07:53:08 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Mon, 25 Oct 2010 09:53:08 +0200 Subject: r5459 - trunk/varnish-cache Message-ID: Author: tfheen Date: 2010-10-25 09:53:08 +0200 (Mon, 25 Oct 2010) New Revision: 5459 Modified: trunk/varnish-cache/ Log: Remove svn:externals for Debian packaging The Debian packaging isn't maintained in SVN any longer, so remove the svn:externals referencing the increasingly outdated packaging. Property changes on: trunk/varnish-cache ___________________________________________________________________ Deleted: svn:externals - debian svn://svn.debian.org:/svn/pkg-varnish/packages/varnish/trunk/debian From phk at varnish-cache.org Mon Oct 25 07:54:06 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 25 Oct 2010 09:54:06 +0200 Subject: r5460 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-25 09:54:06 +0200 (Mon, 25 Oct 2010) New Revision: 5460 Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c Log: Remove spurious debug printf Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-25 07:53:08 UTC (rev 5459) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-25 07:54:06 UTC (rev 5460) @@ -766,6 +766,5 @@ { CHECK_OBJ_NOTNULL(tl, VCC_MAGIC); - printf("EU= %u\n", u); tl->err_unref = u; } From phk at varnish-cache.org Mon Oct 25 08:37:54 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 25 Oct 2010 10:37:54 +0200 Subject: r5461 - in trunk/varnish-cache/bin: varnishd varnishtest/tests Message-ID: Author: phk Date: 2010-10-25 10:37:54 +0200 (Mon, 25 Oct 2010) New Revision: 5461 Added: trunk/varnish-cache/bin/varnishtest/tests/r00801.vtc Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c Log: On pass (from vcl_recv) we did not remove the backends Content-Length header before adding our own. We can not do this with the fetch filtering, because pass might send HEAD requests to the backend. XXX: It's arguable that the filtering stuff might be better done inline than with a table. Fixes: #801 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-25 07:54:06 UTC (rev 5460) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-25 08:37:54 UTC (rev 5461) @@ -552,9 +552,11 @@ assert(uu == sp->obj->len); } - if (mklen > 0) + if (mklen > 0) { + http_Unset(sp->obj->http, H_Content_Length); http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http, "Content-Length: %u", sp->obj->len); + } if (http_HdrIs(hp, H_Connection, "close")) cls = 1; Added: trunk/varnish-cache/bin/varnishtest/tests/r00801.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00801.vtc (rev 0) +++ trunk/varnish-cache/bin/varnishtest/tests/r00801.vtc 2010-10-25 08:37:54 UTC (rev 5461) @@ -0,0 +1,24 @@ +# $Id$ + +test "Regression test for duplicate content-length in pass" + +server s1 { + rxreq + txresp \ + -hdr "Date: Mon, 25 Oct 2010 06:34:06 GMT" \ + -hdr "Content-length: 10xx" \ + -nolen -bodylen 10 +} -start + + +varnish v1 -vcl+backend { + sub vcl_recv { return (pass); } +} -start + +client c1 { + txreq + rxresp + expect resp.http.content-length == "10" +} -run + + From tfheen at varnish-cache.org Mon Oct 25 08:44:59 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Mon, 25 Oct 2010 10:44:59 +0200 Subject: r5462 - in trunk/varnish-cache/bin: varnishd varnishhist varnishlog varnishncsa varnishreplay varnishstat varnishtest varnishtop Message-ID: Author: tfheen Date: 2010-10-25 10:44:59 +0200 (Mon, 25 Oct 2010) New Revision: 5462 Modified: trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishhist/Makefile.am trunk/varnish-cache/bin/varnishlog/Makefile.am trunk/varnish-cache/bin/varnishncsa/Makefile.am trunk/varnish-cache/bin/varnishreplay/Makefile.am trunk/varnish-cache/bin/varnishstat/Makefile.am trunk/varnish-cache/bin/varnishtest/Makefile.am trunk/varnish-cache/bin/varnishtop/Makefile.am Log: Get rid of extra HAVE_RST2MAN checks There were too many checks for whether we had rst2man in the Makefile.am files, leading us to not install files properly if rst2man was not available. Fix this. Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ sbin_PROGRAMS = varnishd -if HAVE_RST2MAN dist_man_MANS = varnishd.1 -endif varnishd_SOURCES = \ cache_acceptor.c \ Modified: trunk/varnish-cache/bin/varnishhist/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishhist -if HAVE_RST2MAN dist_man_MANS = varnishhist.1 -endif varnishhist_SOURCES = varnishhist.c Modified: trunk/varnish-cache/bin/varnishlog/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishlog -if HAVE_RST2MAN dist_man_MANS = varnishlog.1 -endif varnishlog_SOURCES = varnishlog.c Modified: trunk/varnish-cache/bin/varnishncsa/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishncsa -if HAVE_RST2MAN dist_man_MANS = varnishncsa.1 -endif varnishncsa_SOURCES = varnishncsa.c Modified: trunk/varnish-cache/bin/varnishreplay/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishreplay -if HAVE_RST2MAN dist_man_MANS = varnishreplay.1 -endif varnishreplay_SOURCES = \ varnishreplay.c Modified: trunk/varnish-cache/bin/varnishstat/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishstat -if HAVE_RST2MAN dist_man_MANS = varnishstat.1 -endif varnishstat_SOURCES = \ varnishstat.h \ Modified: trunk/varnish-cache/bin/varnishtest/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -9,9 +9,7 @@ bin_PROGRAMS = varnishtest -if HAVE_RST2MAN dist_man_MANS = varnishtest.1 -endif varnishtest_SOURCES = \ vtc.c \ Modified: trunk/varnish-cache/bin/varnishtop/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-10-25 08:37:54 UTC (rev 5461) +++ trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-10-25 08:44:59 UTC (rev 5462) @@ -4,9 +4,7 @@ bin_PROGRAMS = varnishtop -if HAVE_RST2MAN dist_man_MANS = varnishtop.1 -endif varnishtop_SOURCES = varnishtop.c From phk at varnish-cache.org Mon Oct 25 10:28:49 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 25 Oct 2010 12:28:49 +0200 Subject: r5463 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-25 12:28:49 +0200 (Mon, 25 Oct 2010) New Revision: 5463 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Add delay 2 in a desparate attempt to make this test fail less Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-25 08:44:59 UTC (rev 5462) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-25 10:28:49 UTC (rev 5463) @@ -63,5 +63,7 @@ } } +delay 2 + varnish v1 -cliok "debug.vmod" varnish v1 -expect vmods == 0 From tfheen at varnish-cache.org Mon Oct 25 13:07:31 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Mon, 25 Oct 2010 15:07:31 +0200 Subject: r5464 - in trunk/varnish-cache: . bin/varnishtest/tests m4 Message-ID: Author: tfheen Date: 2010-10-25 15:07:31 +0200 (Mon, 25 Oct 2010) New Revision: 5464 Added: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc trunk/varnish-cache/m4/ trunk/varnish-cache/m4/ax_pthread.m4 Modified: trunk/varnish-cache/Makefile.am trunk/varnish-cache/autogen.sh trunk/varnish-cache/configure.ac Log: Auto-detect pthread support and VCC_CC Thanks to Nils Goroll for the patch. Fixes #663 Modified: trunk/varnish-cache/Makefile.am =================================================================== --- trunk/varnish-cache/Makefile.am 2010-10-25 10:28:49 UTC (rev 5463) +++ trunk/varnish-cache/Makefile.am 2010-10-25 13:07:31 UTC (rev 5464) @@ -1,5 +1,7 @@ # $Id$ +ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = include lib bin man etc doc SUBDIRS += redhat Modified: trunk/varnish-cache/autogen.sh =================================================================== --- trunk/varnish-cache/autogen.sh 2010-10-25 10:28:49 UTC (rev 5463) +++ trunk/varnish-cache/autogen.sh 2010-10-25 13:07:31 UTC (rev 5464) @@ -40,7 +40,7 @@ set -ex -aclocal +aclocal -I m4 $LIBTOOLIZE --copy --force autoheader automake --add-missing --copy --foreign Added: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc (rev 0) +++ trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc 2010-10-25 13:07:31 UTC (rev 5464) @@ -0,0 +1,85 @@ +# for emacs, -*- perl -*- comes closest to VTC syntax +# $Id$ + +test "Test that errno is thread-local" + +server s1 { + rxreq + txresp + rxreq + txresp +} -start + +varnish v1 -vcl+backend { + C{ +#include +#include +#include +#include +#include +#include + }C + + # create a race between two requests to see if errno behaves + # thread-local: The first client triggers an error and then + # sleeps. the second client should win the race and clear its + # errno + + sub vcl_deliver { + if (req.http.client == "one") { + C{ + char buf[16]; + int fd; + + fd = open("/foobar/dont/tell/me/this/path/really/exists/" + "on/your/system/by/purpose", O_RDONLY); + + sleep(2); + + sprintf(buf, "%d", errno); + + VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end); + + if (fd) + close(fd); + }C + } elsif (req.http.client == "two") { + C{ + char buf[16]; + int fd; + + /* make sure "one" has done its open */ + sleep(1); + + fd = open("/dev/null", O_RDONLY); + + sprintf(buf, "%d", errno); + + VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end); + + if (fd) + close(fd); + }C + } else { + error 505 "invalid client header"; + } + } +} -start + +client c1 { + txreq -url "/one" -hdr "Client: one" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "1001" + expect resp.http.errno != "0" +} -start + +client c2 { + txreq -url "/two" -hdr "Client: two" + rxresp + expect resp.status == 200 + expect resp.http.X-Varnish == "1002" + expect resp.http.errno == "0" +} -run + +client c1 -wait Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2010-10-25 10:28:49 UTC (rev 5463) +++ trunk/varnish-cache/configure.ac 2010-10-25 13:07:31 UTC (rev 5464) @@ -8,6 +8,9 @@ AC_CONFIG_SRCDIR(include/varnishapi.h) AM_CONFIG_HEADER(config.h) +# save command line CFLAGS for use in VCC_CC (to pass through things like -m64) +OCFLAGS="$CFLAGS" + AC_CANONICAL_SYSTEM AC_LANG(C) @@ -21,6 +24,13 @@ AC_MSG_ERROR([Could not find a C99 compatible compiler]) fi AC_PROG_CPP + +AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])]) + +LIBS="$PTHREAD_LIBS $LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +CC="$PTHREAD_CC" + AC_PROG_INSTALL AC_PROG_LIBTOOL AC_PROG_MAKE_SET @@ -406,16 +416,25 @@ else case $target in *-*-solaris*) - VCC_CC="cc -Kpic -G -o %o %s" + case $PTHREAD_CC in + *gcc*) + VCC_CC="$PTHREAD_CC $OCFLAGS $PTHREAD_CFLAGS -fpic -shared -o %o %s" + break + ;; + *cc) + VCC_CC="$PTHREAD_CC $OCFLAGS $PTHREAD_CFLAGS -Kpic -G -o %o %s" + ;; + esac ;; *-*-darwin*) - VCC_CC="exec cc -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s" + VCC_CC="exec cc $OCFLAGS -dynamiclib -Wl,-undefined,dynamic_lookup -o %o %s" ;; *) - VCC_CC="exec cc -fpic -shared -Wl,-x -o %o %s" + VCC_CC="exec $PTHREAD_CC $OCFLAGS $PTHREAD_CFLAGS -fpic -shared -Wl,-x -o %o %s" ;; esac fi + AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code]) # Use jemalloc on Linux Added: trunk/varnish-cache/m4/ax_pthread.m4 =================================================================== --- trunk/varnish-cache/m4/ax_pthread.m4 (rev 0) +++ trunk/varnish-cache/m4/ax_pthread.m4 2010-10-25 13:07:31 UTC (rev 5464) @@ -0,0 +1,283 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 7 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + *-darwin*) + acx_pthread_flags="-pthread $acx_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include + static void routine(void* a) {a=0;} + static void* start_routine(void* a) {return a;}], + [pthread_t th; pthread_attr_t attr; + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_create(&th,0,start_routine,0); + pthread_cleanup_pop(0); ], + [ax_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl AX_PTHREAD From phk at varnish-cache.org Mon Oct 25 21:43:08 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 25 Oct 2010 23:43:08 +0200 Subject: r5465 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-25 23:43:08 +0200 (Mon, 25 Oct 2010) New Revision: 5465 Modified: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc Log: Make this testcase a bit more predictable. I am not convinced this test-case is really necessary, since a similar and much cheaper check is already in place in the wrk_herdtimer_thread() function. Modified: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc 2010-10-25 13:07:31 UTC (rev 5464) +++ trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc 2010-10-25 21:43:08 UTC (rev 5465) @@ -5,9 +5,10 @@ server s1 { rxreq - txresp + txresp -bodylen 1 + sema r1 sync 2 rxreq - txresp + txresp -bodylen 2 } -start varnish v1 -vcl+backend { @@ -48,9 +49,6 @@ char buf[16]; int fd; - /* make sure "one" has done its open */ - sleep(1); - fd = open("/dev/null", O_RDONLY); sprintf(buf, "%d", errno); @@ -75,6 +73,7 @@ } -start client c2 { + sema r1 sync 2 txreq -url "/two" -hdr "Client: two" rxresp expect resp.status == 200 From tfheen at varnish-cache.org Tue Oct 26 07:42:47 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 26 Oct 2010 09:42:47 +0200 Subject: r5466 - in trunk/varnish-cache: bin/varnishsizes doc/sphinx lib/libvmod_std Message-ID: Author: tfheen Date: 2010-10-26 09:42:47 +0200 (Tue, 26 Oct 2010) New Revision: 5466 Modified: trunk/varnish-cache/bin/varnishsizes/ trunk/varnish-cache/doc/sphinx/ trunk/varnish-cache/lib/libvmod_std/ Log: Add svn:ignore properties for generated files Property changes on: trunk/varnish-cache/bin/varnishsizes ___________________________________________________________________ Added: svn:ignore + Makefile Makefile.in Property changes on: trunk/varnish-cache/doc/sphinx ___________________________________________________________________ Added: svn:ignore + Makefile Makefile.in Property changes on: trunk/varnish-cache/lib/libvmod_std ___________________________________________________________________ Added: svn:ignore + Makefile Makefile.in From tfheen at varnish-cache.org Tue Oct 26 07:47:03 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 26 Oct 2010 09:47:03 +0200 Subject: r5467 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-10-26 09:47:00 +0200 (Tue, 26 Oct 2010) New Revision: 5467 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/r00801.vtc 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/cache_fetch.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/include/vct.h branches/2.1/varnish-cache/include/vev.h 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 r5461: Remove Content-Length on pass from vcl_recv On pass (from vcl_recv) we did not remove the backends Content-Length header before adding our own. We can not do this with the fetch filtering, because pass might send HEAD requests to the backend. XXX: It's arguable that the filtering stuff might be better done inline than with a table. Fixes: #801 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-26 07:42:47 UTC (rev 5466) +++ branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-26 07:47:00 UTC (rev 5467) @@ -554,9 +554,11 @@ assert(uu == sp->obj->len); } - if (mklen > 0) + if (mklen > 0) { + http_Unset(sp->obj->http, H_Content_Length); http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http, "Content-Length: %u", sp->obj->len); + } if (http_HdrIs(hp, H_Connection, "close")) cls = 1; 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/r00801.vtc (from rev 5461, trunk/varnish-cache/bin/varnishtest/tests/r00801.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/r00801.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/r00801.vtc 2010-10-26 07:47:00 UTC (rev 5467) @@ -0,0 +1,24 @@ +# $Id$ + +test "Regression test for duplicate content-length in pass" + +server s1 { + rxreq + txresp \ + -hdr "Date: Mon, 25 Oct 2010 06:34:06 GMT" \ + -hdr "Content-length: 10xx" \ + -nolen -bodylen 10 +} -start + + +varnish v1 -vcl+backend { + sub vcl_recv { return (pass); } +} -start + +client c1 { + txreq + rxresp + expect resp.http.content-length == "10" +} -run + + 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 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,5435,5439-5440 + /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,5435,5439-5440,5461 From tfheen at varnish-cache.org Tue Oct 26 12:50:02 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 26 Oct 2010 14:50:02 +0200 Subject: r5468 - trunk/varnish-cache/doc/sphinx/phk Message-ID: Author: tfheen Date: 2010-10-26 14:50:01 +0200 (Tue, 26 Oct 2010) New Revision: 5468 Modified: trunk/varnish-cache/doc/sphinx/phk/barriers.rst Log: Typo Modified: trunk/varnish-cache/doc/sphinx/phk/barriers.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/phk/barriers.rst 2010-10-26 07:47:00 UTC (rev 5467) +++ trunk/varnish-cache/doc/sphinx/phk/barriers.rst 2010-10-26 12:50:01 UTC (rev 5468) @@ -104,7 +104,7 @@ can decide under which circumstances that authority will be shared. Needless to say, if the system on which Varnish runs is not properly -secured, the Administator's monopoly of control will be compromised. +secured, the Administrator's monopoly of control will be compromised. All the other barriers ====================== From phk at varnish-cache.org Wed Oct 27 08:20:04 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 10:20:04 +0200 Subject: r5469 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-27 10:20:04 +0200 (Wed, 27 Oct 2010) New Revision: 5469 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try another way to stabilize this test Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-26 12:50:01 UTC (rev 5468) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-27 08:20:04 UTC (rev 5469) @@ -49,6 +49,8 @@ varnish v1 -cliok "vcl.list" varnish v1 -cliok "debug.vmod" +client c1 -run + varnish v1 -badvcl { import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; @@ -63,7 +65,5 @@ } } -delay 2 - varnish v1 -cliok "debug.vmod" varnish v1 -expect vmods == 0 From phk at varnish-cache.org Wed Oct 27 08:46:21 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 10:46:21 +0200 Subject: r5470 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-27 10:46:20 +0200 (Wed, 27 Oct 2010) New Revision: 5470 Modified: trunk/varnish-cache/bin/varnishtest/tests/v00010.vtc Log: Improve testing coverage Modified: trunk/varnish-cache/bin/varnishtest/tests/v00010.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00010.vtc 2010-10-27 08:20:04 UTC (rev 5469) +++ trunk/varnish-cache/bin/varnishtest/tests/v00010.vtc 2010-10-27 08:46:20 UTC (rev 5470) @@ -15,9 +15,9 @@ varnish v1 -storage "-smalloc,1m" -vcl+backend { - sub vcl_fetch { - if (beresp.http.panic) { - panic "Had Panic header: " + beresp.http.panic; + sub vcl_deliver { + if (resp.http.panic) { + panic "Had Panic header: " + resp.http.panic; } } } -start From phk at varnish-cache.org Wed Oct 27 09:27:03 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 11:27:03 +0200 Subject: r5471 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: phk Date: 2010-10-27 11:27:03 +0200 (Wed, 27 Oct 2010) New Revision: 5471 Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Try again... Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-27 08:46:20 UTC (rev 5470) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-27 09:27:03 UTC (rev 5471) @@ -66,4 +66,5 @@ } varnish v1 -cliok "debug.vmod" +varnish v1 -cliok "vcl.list" varnish v1 -expect vmods == 0 From phk at varnish-cache.org Wed Oct 27 10:04:15 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 12:04:15 +0200 Subject: r5472 - in trunk/varnish-cache/bin: varnishd varnishtest/tests Message-ID: Author: phk Date: 2010-10-27 12:04:15 +0200 (Wed, 27 Oct 2010) New Revision: 5472 Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c trunk/varnish-cache/bin/varnishd/mgt_param.c trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc Log: Add a diag_bitmap that causes worker threads to release their VCL after each request, so we do not have to contort testcases around the exact scheduling of worker threads. Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2010-10-27 09:27:03 UTC (rev 5471) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2010-10-27 10:04:15 UTC (rev 5472) @@ -190,6 +190,8 @@ AZ(w->wfd); assert(w->wlp == w->wlb); w->wrq = NULL; + if (params->diag_bitmap & 0x00040000) + VCL_Rel(&w->vcl); if (!Lck_Trylock(&wstat_mtx)) { wrk_sumstat(w); Lck_Unlock(&wstat_mtx); Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-10-27 09:27:03 UTC (rev 5471) +++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-10-27 10:04:15 UTC (rev 5472) @@ -771,6 +771,7 @@ #endif " 0x00010000 - synchronize shmlog.\n" " 0x00020000 - synchronous start of persistence.\n" + " 0x00040000 - release VCL early.\n" " 0x80000000 - do edge-detection on digest.\n" "Use 0x notation and do the bitor in your head :-)\n", 0, Modified: trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-27 09:27:03 UTC (rev 5471) +++ trunk/varnish-cache/bin/varnishtest/tests/m00001.vtc 2010-10-27 10:04:15 UTC (rev 5472) @@ -17,6 +17,8 @@ } } -start +varnish v1 -cliok "param.set diag_bitmap 0x40000" + client c1 { txreq -url "/bar" rxresp @@ -38,8 +40,6 @@ expect resp.http.bar == "fOo" } -run -client c1 -run - varnish v1 -cliok "debug.vmod" varnish v1 -cliok "vcl.list" @@ -49,8 +49,6 @@ varnish v1 -cliok "vcl.list" varnish v1 -cliok "debug.vmod" -client c1 -run - varnish v1 -badvcl { import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so.1" ; From tfheen at varnish-cache.org Wed Oct 27 10:24:11 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 27 Oct 2010 12:24:11 +0200 Subject: r5473 - trunk/varnish-cache/bin/varnishtest/tests Message-ID: Author: tfheen Date: 2010-10-27 12:24:11 +0200 (Wed, 27 Oct 2010) New Revision: 5473 Removed: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc Log: Remove r00663, this test is flaky and should be unneeded. Deleted: trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc 2010-10-27 10:04:15 UTC (rev 5472) +++ trunk/varnish-cache/bin/varnishtest/tests/r00663.vtc 2010-10-27 10:24:11 UTC (rev 5473) @@ -1,84 +0,0 @@ -# for emacs, -*- perl -*- comes closest to VTC syntax -# $Id$ - -test "Test that errno is thread-local" - -server s1 { - rxreq - txresp -bodylen 1 - sema r1 sync 2 - rxreq - txresp -bodylen 2 -} -start - -varnish v1 -vcl+backend { - C{ -#include -#include -#include -#include -#include -#include - }C - - # create a race between two requests to see if errno behaves - # thread-local: The first client triggers an error and then - # sleeps. the second client should win the race and clear its - # errno - - sub vcl_deliver { - if (req.http.client == "one") { - C{ - char buf[16]; - int fd; - - fd = open("/foobar/dont/tell/me/this/path/really/exists/" - "on/your/system/by/purpose", O_RDONLY); - - sleep(2); - - sprintf(buf, "%d", errno); - - VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end); - - if (fd) - close(fd); - }C - } elsif (req.http.client == "two") { - C{ - char buf[16]; - int fd; - - fd = open("/dev/null", O_RDONLY); - - sprintf(buf, "%d", errno); - - VRT_SetHdr(sp, HDR_RESP, "\006errno:", buf, vrt_magic_string_end); - - if (fd) - close(fd); - }C - } else { - error 505 "invalid client header"; - } - } -} -start - -client c1 { - txreq -url "/one" -hdr "Client: one" - rxresp - expect resp.status == 200 - expect resp.http.X-Varnish == "1001" - expect resp.http.errno != "0" -} -start - -client c2 { - sema r1 sync 2 - txreq -url "/two" -hdr "Client: two" - rxresp - expect resp.status == 200 - expect resp.http.X-Varnish == "1002" - expect resp.http.errno == "0" -} -run - -client c1 -wait From phk at varnish-cache.org Wed Oct 27 11:25:55 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 13:25:55 +0200 Subject: r5474 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-27 13:25:55 +0200 (Wed, 27 Oct 2010) New Revision: 5474 Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c Log: Allocate an entire sockaddr_storage for backend address entries, in order to guarantee type safety. Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-27 10:24:11 UTC (rev 5473) +++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c 2010-10-27 11:25:55 UTC (rev 5474) @@ -156,7 +156,7 @@ { assert(*src > 0); - *sa = malloc(*src); + *sa = calloc(sizeof **sa, 1); XXXAN(*sa); memcpy(*sa, src + 1, *src); *len = *src; From phk at varnish-cache.org Wed Oct 27 11:54:02 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 13:54:02 +0200 Subject: r5475 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-27 13:54:02 +0200 (Wed, 27 Oct 2010) New Revision: 5475 Modified: trunk/varnish-cache/bin/varnishd/cache_dir_dns.c Log: Stylistic and some minor simplifications to shut up Flexelint. Modified: trunk/varnish-cache/bin/varnishd/cache_dir_dns.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-10-27 11:25:55 UTC (rev 5474) +++ trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-10-27 11:54:02 UTC (rev 5475) @@ -81,54 +81,48 @@ double ttl; }; - - /* Compare an IPv4 backend to a IPv4 addr/len */ static int vdi_dns_comp_addrinfo4(const struct backend *bp, - const struct sockaddr_in *addr, + const struct sockaddr_storage *addr, const socklen_t len) { uint32_t u, p; - struct sockaddr_in *bps = (struct sockaddr_in *) bp->ipv4; + const struct sockaddr_in *bps = (const void *)bp->ipv4; + const struct sockaddr_in *bpd = (const void *)addr; if (bp->ipv4len != len || len <= 0) - return 0; + return (0); - u = addr->sin_addr.s_addr; + u = bpd->sin_addr.s_addr; p = bps->sin_addr.s_addr; - return u == p; + return (u == p); } /* Compare an IPv6 backend to a IPv6 addr/len */ static int vdi_dns_comp_addrinfo6(const struct backend *bp, - struct sockaddr_in6 *addr, + const struct sockaddr_storage *addr, const socklen_t len) { - uint8_t *u, *p; - int i; - struct sockaddr_in6 *bps = (struct sockaddr_in6 *) bp->ipv6; + const uint8_t *u, *p; + const struct sockaddr_in6 *bps = (const void *)bp->ipv6; + const struct sockaddr_in6 *bpd = (const void *)addr; if (bp->ipv6len != len || len <= 0) - return 0; + return (0); - u = addr->sin6_addr.s6_addr; + u = bpd->sin6_addr.s6_addr; p = bps->sin6_addr.s6_addr; - for (i=0; i < 16; i++) { - if (u[i] != p[i]) - return 0; - } - - return 1; + return (!memcmp(u, p, 16)); } /* Check if a backends socket is the same as addr */ static int vdi_dns_comp_addrinfo(const struct director *dir, - struct sockaddr_storage *addr, + const struct sockaddr_storage *addr, const socklen_t len) { struct backend *bp; @@ -136,13 +130,11 @@ bp = vdi_get_backend_if_simple(dir); AN(bp); if (addr->ss_family == PF_INET && bp->ipv4) { - return (vdi_dns_comp_addrinfo4(bp, (struct sockaddr_in *) - addr, len)); + return (vdi_dns_comp_addrinfo4(bp, addr, len)); } else if (addr->ss_family == PF_INET6 && bp->ipv6) { - return (vdi_dns_comp_addrinfo6(bp, (struct sockaddr_in6 *) - addr, len)); + return (vdi_dns_comp_addrinfo6(bp, addr, len)); } - return 0; + return (0); } /* Pick a host from an existing hostgroup. @@ -167,11 +159,11 @@ current = i + initial; if (VDI_Healthy_sp(sp, group->hosts[current])) { group->next_host = current+1; - return group->hosts[current]; + return (group->hosts[current]); } } - return NULL; + return (NULL); } /* Remove an item from the dns cache. @@ -196,7 +188,7 @@ static inline int vdi_dns_groupmatch(const struct vdi_dns_hostgroup *group, const char *hostname) { - return !strcmp(group->hostname, hostname); + return (!strcmp(group->hostname, hostname)); } /* Search the cache for 'hostname' and put a backend-pointer as necessary, @@ -221,17 +213,17 @@ if (hostgr->ttl <= sp->t_req) { if (rwlock) vdi_dns_pop_cache(vs, hostgr); - return 0; + return (0); } if (vdi_dns_groupmatch(hostgr, hostname)) { ret = (vdi_dns_pick_host(sp, hostgr)); *backend = ret; if (*backend != NULL) CHECK_OBJ_NOTNULL(*backend, DIRECTOR_MAGIC); - return 1; + return (1); } } - return 0; + return (0); } /* Add a newly cached item to the dns cache list. @@ -266,6 +258,7 @@ int error, i, host = 0; struct addrinfo *res0, *res, hint; struct vdi_dns_hostgroup *new; + /* Due to possible race while upgrading the lock, we have to * recheck if the result is already looked up. The overhead for * this is insignificant unless dns isn't cached properly (all @@ -273,7 +266,7 @@ */ if (vdi_dns_cache_has(sp, vs, hostname, backend, 1)) - return 1; + return (1); memset(&hint, 0, sizeof hint); hint.ai_family = PF_UNSPEC; @@ -281,16 +274,15 @@ ALLOC_OBJ(new, VDI_DNSDIR_MAGIC); XXXAN(new); - new->hostname = calloc(sizeof(char), strlen(hostname)+1); - XXXAN(new->hostname); - strcpy(new->hostname, hostname); + REPLACE(new->hostname, hostname); + error = getaddrinfo(hostname, "80", &hint, &res0); VSC_main->dir_dns_lookups++; if (error) { vdi_dns_cache_list_add(sp, vs, new); VSC_main->dir_dns_failed++; - return 0; + return (0); } for (res = res0; res; res = res->ai_next) { @@ -314,7 +306,7 @@ new->nhosts = host; vdi_dns_cache_list_add(sp, vs, new); *backend = vdi_dns_pick_host(sp, new); - return 1; + return (1); } /* Walk through the cached lookups looking for the relevant host, add one @@ -329,10 +321,16 @@ { struct director *backend = NULL; int ret; + AZ(pthread_rwlock_rdlock(&vs->rwlock)); ret = vdi_dns_cache_has(sp, vs, hostname, &backend, 0); AZ(pthread_rwlock_unlock(&vs->rwlock)); if (!ret) { + /* + * XXX: Isn't there a race here where another thread + * XXX: could grab the lock and add it before we do ? + * XXX: Should 'ret' be checked for that ? + */ AZ(pthread_rwlock_wrlock(&vs->rwlock)); ret = vdi_dns_cache_add(sp, vs, hostname, &backend); AZ(pthread_rwlock_unlock(&vs->rwlock)); @@ -342,7 +340,7 @@ /* Bank backend == cached a failure, so to speak */ if (backend != NULL) CHECK_OBJ_NOTNULL(backend, DIRECTOR_MAGIC); - return backend; + return (backend); } /* Parses the Host:-header and heads out to find a backend. @@ -352,9 +350,8 @@ { struct director *ret; struct http *hp; - char *p; + char *p, *q; char hostname[NI_MAXHOST]; - int i; /* bereq is only present after recv et. al, otherwise use req (ie: * use req for health checks in vcl_recv and such). @@ -369,22 +366,16 @@ if (http_GetHdr(hp, H_Host, &p) == 0) return (NULL); - /* We need a working copy since it's going to be modified */ - strncpy(hostname, p, sizeof(hostname)); + q = strchr(p, ':'); + if (q == NULL) + q = strchr(p, '\0'); + AN(q); - /* remove port-portion of the Host-header, if present. */ - for (i = 0; i < strlen(hostname); i++) { - if (hostname[i] == ':') { - hostname[i] = '\0'; - break; - } - } + bprintf(hostname, "%.*s%s", (int)(q - p), p, + vs->suffix ? vs->suffix : ""); - if (vs->suffix) - strncat(hostname, vs->suffix, sizeof(hostname) - strlen(hostname)); - ret = vdi_dns_walk_cache(sp, vs, hostname); - return ret; + return (ret); } static struct vbc * @@ -412,10 +403,10 @@ /* XXX: Fooling -Werror for a bit until it's actually implemented. */ if (now || dir || target) - return 1; + return (1); else - return 1; - return 1; + return (1); + return (1); /* struct vdi_dns *vs; struct director *dir; @@ -428,8 +419,8 @@ dir = vdi_dns_find_backend(sp, vs); if (dir) - return 1; - return 0; + return (1); + return (0); */ } From martin at varnish-cache.org Wed Oct 27 12:30:21 2010 From: martin at varnish-cache.org (martin at varnish-cache.org) Date: Wed, 27 Oct 2010 14:30:21 +0200 Subject: r5476 - in trunk/varnish-cache/bin: varnishd varnishtest varnishtest/tests Message-ID: Author: martin Date: 2010-10-27 14:30:21 +0200 (Wed, 27 Oct 2010) New Revision: 5476 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc trunk/varnish-cache/bin/varnishtest/tests/r00387.vtc trunk/varnish-cache/bin/varnishtest/vtc_http.c Log: Read expected final CRLF after chunked encoding data from backend. Make "chunkedlen" test server command output final CRLF after chunked data. Update a couple of test cases to output the final CRLF. Fixes: #780 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 11:54:02 UTC (rev 5475) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 12:30:21 UTC (rev 5476) @@ -207,6 +207,15 @@ q = bp = buf + v; } + /* Expect a CRLF to trail the chunks */ + i = HTC_Read(htc, buf, 1); + if (i == 1 && buf[0] == '\r') + i = HTC_Read(htc, buf, 1); + if (i != 1 || buf[0] != '\n') { + WSP(sp, SLT_FetchError, "chunked missing trailing crlf"); + return (1); /* Accept fetch, but do not reuse connection */ + } + if (st != NULL && st->len == 0) { VTAILQ_REMOVE(&sp->obj->store, st, list); STV_free(st); Modified: trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc 2010-10-27 11:54:02 UTC (rev 5475) +++ trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc 2010-10-27 12:30:21 UTC (rev 5476) @@ -10,6 +10,7 @@ send "\r\n" send "00000004\r\n1234\r\n" send "00000000\r\n" + send "\r\n" rxreq expect req.url == "/foo" Modified: trunk/varnish-cache/bin/varnishtest/tests/r00387.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00387.vtc 2010-10-27 11:54:02 UTC (rev 5475) +++ trunk/varnish-cache/bin/varnishtest/tests/r00387.vtc 2010-10-27 12:30:21 UTC (rev 5476) @@ -10,6 +10,7 @@ send "004\r\n1234\r\n" send "000000000000000000001\r\n@\r\n" send "00000000\r\n" + send "\r\n" } -start varnish v1 -vcl+backend {} -start Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c =================================================================== --- trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-27 11:54:02 UTC (rev 5475) +++ trunk/varnish-cache/bin/varnishtest/vtc_http.c 2010-10-27 12:30:21 UTC (rev 5476) @@ -778,7 +778,7 @@ vsb_printf(hp->vsb, "%x%s", v, nl); vsb_printf(hp->vsb, "%*.*s%s", v, v, buf, nl); } - vsb_printf(hp->vsb, "%x%s", 0, nl); + vsb_printf(hp->vsb, "%x%s%s", 0, nl, nl); http_write(hp, 4, "chunked"); } From phk at varnish-cache.org Wed Oct 27 18:07:51 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 20:07:51 +0200 Subject: r5477 - in trunk/varnish-cache: bin/varnishd include Message-ID: Author: phk Date: 2010-10-27 20:07:51 +0200 (Wed, 27 Oct 2010) New Revision: 5477 Added: trunk/varnish-cache/include/vtypes.h Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/rfc2616.c Log: Move the determination of the existence of and how we will fetch a body in the beresp up before the vcl_fetch{} call and prepare to make it possible to modify the value from VCL. Move the actual code to rfc2616.c along with the default TTL determination. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2010-10-27 12:30:21 UTC (rev 5476) +++ trunk/varnish-cache/bin/varnishd/cache.h 2010-10-27 18:07:51 UTC (rev 5477) @@ -65,6 +65,7 @@ #include "vsc.h" #include "vsl.h" +#include "vtypes.h" /* * NB: HDR_STATUS is only used in cache_http.c, everybody else uses the @@ -250,6 +251,7 @@ struct http *beresp; struct http *resp; + enum body_status body_status; unsigned cacheable; double age; double entered; @@ -737,6 +739,7 @@ /* rfc2616.c */ double RFC2616_Ttl(const struct sess *sp); +enum body_status RFC2616_Body(const struct sess *sp); /* storage_synth.c */ struct vsb *SMS_Makesynth(struct object *obj); Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-27 12:30:21 UTC (rev 5476) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2010-10-27 18:07:51 UTC (rev 5477) @@ -506,6 +506,8 @@ sp->wrk->do_esi = 0; sp->wrk->grace = NAN; + sp->wrk->body_status = RFC2616_Body(sp); + VCL_fetch_method(sp); /* Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 12:30:21 UTC (rev 5476) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 18:07:51 UTC (rev 5477) @@ -55,6 +55,7 @@ unsigned cl, sl; struct storage *st; + assert(sp->wrk->body_status == BS_LENGTH); cll = strtoumax(b, NULL, 0); if (cll == 0) return (0); @@ -100,6 +101,7 @@ char buf[20]; /* XXX: arbitrary */ char *bp, *be; + assert(sp->wrk->body_status == BS_CHUNKED); be = buf + sizeof buf - 1; bp = buf; st = NULL; @@ -245,6 +247,7 @@ struct storage *st; unsigned v; + assert(sp->wrk->body_status == BS_EOF); if (fetchfrag > 0) WSL(sp->wrk, SLT_Debug, sp->fd, "Fetch %d byte segments:", fetchfrag); @@ -452,12 +455,11 @@ int FetchBody(struct sess *sp) { - struct vbc *vc; char *b; int cls; struct http *hp; struct storage *st; - int mklen, is_head; + int mklen; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); @@ -470,63 +472,37 @@ if (sp->obj->objcore != NULL) /* pass has no objcore */ AN(ObjIsBusy(sp->obj)); - vc = sp->vbc; - - is_head = (strcasecmp(http_GetReq(sp->wrk->bereq), "head") == 0); - /* * Determine if we have a body or not * XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses */ cls = 0; mklen = 0; - if (is_head) { - sp->wrk->stats.fetch_head++; - } else if (http_GetHdr(hp, H_Content_Length, &b)) { - sp->wrk->stats.fetch_length++; + + switch (sp->wrk->body_status) { + case BS_NONE: + break; + case BS_ZERO: + mklen = 1; + break; + case BS_LENGTH: + AN(http_GetHdr(hp, H_Content_Length, &b)); cls = fetch_straight(sp, sp->wrk->htc, b); mklen = 1; - } else if (http_HdrIs(hp, H_Transfer_Encoding, "chunked")) { - sp->wrk->stats.fetch_chunked++; + break; + case BS_CHUNKED: cls = fetch_chunked(sp, sp->wrk->htc); mklen = 1; - } else if (http_GetHdr(hp, H_Transfer_Encoding, &b)) { - sp->wrk->stats.fetch_bad++; - /* XXX: AUGH! */ - WSL(sp->wrk, SLT_Debug, vc->fd, "Invalid Transfer-Encoding"); - VDI_CloseFd(sp); - return (__LINE__); - } else if (http_HdrIs(hp, H_Connection, "keep-alive")) { - sp->wrk->stats.fetch_zero++; - /* - * If we have Connection: keep-alive, it cannot possibly be - * EOF encoded, and since it is neither length nor chunked - * it must be zero length. - */ - mklen = 1; - } else if (http_HdrIs(hp, H_Connection, "close")) { - sp->wrk->stats.fetch_close++; - /* - * If we have connection closed, it is safe to read what - * comes in any case. - */ + break; + case BS_EOF: cls = fetch_eof(sp, sp->wrk->htc); mklen = 1; - } else if (hp->protover < 1.1) { - sp->wrk->stats.fetch_oldhttp++; - /* - * With no Connection header, assume EOF - */ - cls = fetch_eof(sp, sp->wrk->htc); - mklen = 1; - } else { - sp->wrk->stats.fetch_eof++; - /* - * This is what happens when HTTP/1.0 backends claim - * to be HTTP/1.1, assume EOF - */ - cls = fetch_eof(sp, sp->wrk->htc); - mklen = 1; + break; + case BS_ERROR: + VDI_CloseFd(sp); + return (__LINE__); + default: + INCOMPL(); } if (cls == 0 && http_HdrIs(hp, H_Connection, "close")) Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c =================================================================== --- trunk/varnish-cache/bin/varnishd/rfc2616.c 2010-10-27 12:30:21 UTC (rev 5476) +++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2010-10-27 18:07:51 UTC (rev 5477) @@ -40,8 +40,8 @@ #include #include "cache.h" +#include "vrt.h" - /*-------------------------------------------------------------------- * TTL and Age calculation in Varnish * @@ -163,3 +163,74 @@ return (ttd); } + +/*-------------------------------------------------------------------- + * Body existence and fetch method + * XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses + */ + +enum body_status +RFC2616_Body(const struct sess *sp) +{ + struct http *hp; + char *b; + + hp = sp->wrk->beresp1; + + if (!strcasecmp(http_GetReq(sp->wrk->bereq), "head")) { + /* + * A HEAD request can never have a body in the reply, + * no matter what the headers might say. + */ + sp->wrk->stats.fetch_head++; + return (BS_NONE); + } + + /* If the headers tells us what to do, obey. */ + + if (http_GetHdr(hp, H_Content_Length, &b)) { + sp->wrk->stats.fetch_length++; + return (BS_LENGTH); + } + + if (http_HdrIs(hp, H_Transfer_Encoding, "chunked")) { + sp->wrk->stats.fetch_chunked++; + return (BS_CHUNKED); + } + + if (http_GetHdr(hp, H_Transfer_Encoding, &b)) { + sp->wrk->stats.fetch_bad++; + return (BS_ERROR); + } + + if (http_HdrIs(hp, H_Connection, "keep-alive")) { + /* + * Keep alive with neither TE=Chunked or C-Len is impossible. + * We assume a zero length body. + */ + sp->wrk->stats.fetch_zero++; + return (BS_ZERO); + } + + if (http_HdrIs(hp, H_Connection, "close")) { + /* + * In this case, it is safe to just read what comes. + */ + sp->wrk->stats.fetch_close++; + return (BS_EOF); + } + + if (hp->protover < 1.1) { + /* + * With no Connection header, assume EOF. + */ + sp->wrk->stats.fetch_oldhttp++; + return (BS_EOF); + } + + /* + * XXX: Here it should depends on the status code + */ + sp->wrk->stats.fetch_eof++; + return (BS_EOF); +} Copied: trunk/varnish-cache/include/vtypes.h (from rev 5476, trunk/varnish-cache/include/vrt.h) =================================================================== --- trunk/varnish-cache/include/vtypes.h (rev 0) +++ trunk/varnish-cache/include/vtypes.h 2010-10-27 18:07:51 UTC (rev 5477) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2010 Linpro AS + * All rights reserved. + * + * Author: Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * + * Very special types, widely used, in their own #include to keep + * #include-infection minimal. + */ + +enum body_status { + BS_NONE, + BS_ZERO, + BS_ERROR, + BS_CHUNKED, + BS_LENGTH, + BS_EOF +}; From phk at varnish-cache.org Wed Oct 27 18:48:40 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 20:48:40 +0200 Subject: r5478 - in trunk/varnish-cache: bin/varnishd include Message-ID: Author: phk Date: 2010-10-27 20:48:40 +0200 (Wed, 27 Oct 2010) New Revision: 5478 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/rfc2616.c trunk/varnish-cache/include/vsc_fields.h trunk/varnish-cache/include/vsl_tags.h Log: Special case beresp status 1xx, 204 and 304, they have no body. (r5477 is a requirement for this fix) Fixes: #803 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 18:07:51 UTC (rev 5477) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2010-10-27 18:48:40 UTC (rev 5478) @@ -476,13 +476,14 @@ * Determine if we have a body or not * XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses */ - cls = 0; - mklen = 0; switch (sp->wrk->body_status) { case BS_NONE: + cls = 0; + mklen = 0; break; case BS_ZERO: + cls = 0; mklen = 1; break; case BS_LENGTH: @@ -499,12 +500,23 @@ mklen = 1; break; case BS_ERROR: - VDI_CloseFd(sp); - return (__LINE__); + cls = 1; + mklen = 0; + break; default: + cls = 0; + mklen = 0; INCOMPL(); } + WSL(sp->wrk, SLT_Fetch_Body, sp->vbc->fd, "%u %u %u", + sp->wrk->body_status, cls, mklen); + + if (sp->wrk->body_status == BS_ERROR) { + VDI_CloseFd(sp); + return (__LINE__); + } + if (cls == 0 && http_HdrIs(hp, H_Connection, "close")) cls = 1; Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c =================================================================== --- trunk/varnish-cache/bin/varnishd/rfc2616.c 2010-10-27 18:07:51 UTC (rev 5477) +++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2010-10-27 18:48:40 UTC (rev 5478) @@ -166,7 +166,6 @@ /*-------------------------------------------------------------------- * Body existence and fetch method - * XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses */ enum body_status @@ -181,6 +180,7 @@ /* * A HEAD request can never have a body in the reply, * no matter what the headers might say. + * [RFC2516 4.3 p33] */ sp->wrk->stats.fetch_head++; return (BS_NONE); @@ -203,6 +203,33 @@ return (BS_ERROR); } + if (hp->status <= 199) { + /* + * 1xx responses never have a body. + * [RFC2616 4.3 p33] + */ + sp->wrk->stats.fetch_1xx++; + return (BS_NONE); + } + + if (hp->status == 204) { + /* + * 204 is "No Content", obviously don't expect a body. + * [RFC2616 10.2.5 p60] + */ + sp->wrk->stats.fetch_204++; + return (BS_NONE); + } + + if (hp->status == 304) { + /* + * 304 is "Not Modified" it has no body. + * [RFC2616 10.3.5 p63] + */ + sp->wrk->stats.fetch_304++; + return (BS_NONE); + } + if (http_HdrIs(hp, H_Connection, "keep-alive")) { /* * Keep alive with neither TE=Chunked or C-Len is impossible. @@ -229,7 +256,7 @@ } /* - * XXX: Here it should depends on the status code + * Fall back to EOF transfer. */ sp->wrk->stats.fetch_eof++; return (BS_EOF); Modified: trunk/varnish-cache/include/vsc_fields.h =================================================================== --- trunk/varnish-cache/include/vsc_fields.h 2010-10-27 18:07:51 UTC (rev 5477) +++ trunk/varnish-cache/include/vsc_fields.h 2010-10-27 18:48:40 UTC (rev 5478) @@ -56,14 +56,17 @@ VSC_F(backend_retry, uint64_t, 0, 'a', "Backend conn. retry") VSC_F(fetch_head, uint64_t, 1, 'a', "Fetch head") -VSC_F(fetch_length, uint64_t, 1, 'a', "Fetch with Length") -VSC_F(fetch_chunked, uint64_t, 1, 'a', "Fetch chunked") +VSC_F(fetch_length, uint64_t, 1, 'a', "Fetch with Length") +VSC_F(fetch_chunked, uint64_t, 1, 'a', "Fetch chunked") VSC_F(fetch_eof, uint64_t, 1, 'a', "Fetch EOF") VSC_F(fetch_bad, uint64_t, 1, 'a', "Fetch had bad headers") VSC_F(fetch_close, uint64_t, 1, 'a', "Fetch wanted close") -VSC_F(fetch_oldhttp, uint64_t, 1, 'a', "Fetch pre HTTP/1.1 closed") +VSC_F(fetch_oldhttp, uint64_t, 1, 'a', "Fetch pre HTTP/1.1 closed") VSC_F(fetch_zero, uint64_t, 1, 'a', "Fetch zero len") -VSC_F(fetch_failed, uint64_t, 1, 'a', "Fetch failed") +VSC_F(fetch_failed, uint64_t, 1, 'a', "Fetch failed") +VSC_F(fetch_1xx, uint64_t, 1, 'a', "Fetch no body (1xx)") +VSC_F(fetch_204, uint64_t, 1, 'a', "Fetch no body (204)") +VSC_F(fetch_304, uint64_t, 1, 'a', "Fetch no body (304)") VSC_F(n_sess_mem, uint64_t, 0, 'i', "N struct sess_mem") Modified: trunk/varnish-cache/include/vsl_tags.h =================================================================== --- trunk/varnish-cache/include/vsl_tags.h 2010-10-27 18:07:51 UTC (rev 5477) +++ trunk/varnish-cache/include/vsl_tags.h 2010-10-27 18:48:40 UTC (rev 5478) @@ -79,6 +79,7 @@ SLTM(LostHeader) SLTM(TTL) +SLTM(Fetch_Body) SLTM(VCL_acl) SLTM(VCL_call) SLTM(VCL_trace) From phk at varnish-cache.org Wed Oct 27 19:40:08 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 21:40:08 +0200 Subject: r5479 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-27 21:40:08 +0200 (Wed, 27 Oct 2010) New Revision: 5479 Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_expr.c trunk/varnish-cache/lib/libvcl/vcc_vmod.c Log: Start to make symbols carry their own evaluation function around Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 18:48:40 UTC (rev 5478) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 19:40:08 UTC (rev 5479) @@ -38,6 +38,9 @@ struct acl_e; struct proc; +struct expr; +struct vcc; +struct symbol; enum var_type { #define VCC_TYPE(foo) foo, @@ -75,6 +78,9 @@ #undef VCC_SYMB }; +typedef void sym_expr_t(struct vcc *tl, struct expr **e, + const struct symbol *sym); + struct symbol { unsigned magic; #define SYMBOL_MAGIC 0x3368c9fb @@ -92,6 +98,8 @@ struct proc *proc; + sym_expr_t *eval; + const char *cfunc; const char *args; const struct var *var; @@ -231,6 +239,7 @@ double vcc_DoubleVal(struct vcc *tl); void vcc_Expr(struct vcc *tl, enum var_type typ); void vcc_Expr_Call(struct vcc *tl, const struct symbol *sym); +sym_expr_t vcc_Expr_Func; /* vcc_dir_dns.c */ parsedirector_f vcc_ParseDnsDirector; @@ -246,7 +255,7 @@ int vcc_StringVal(struct vcc *tl); void vcc_ExpectedStringval(struct vcc *tl); -/* vcc_symbol */ +/* vcc_symb.c */ struct symbol *VCC_AddSymbolStr(struct vcc *tl, const char *name, enum symkind); struct symbol *VCC_GetSymbolTok(struct vcc *tl, const struct token *tok, enum symkind); Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 18:48:40 UTC (rev 5478) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 19:40:08 UTC (rev 5479) @@ -402,11 +402,6 @@ /*-------------------------------------------------------------------- */ -#if 0 -#define VCC_TYPE(a) case a: return(#a); -#include "vcc_types.h" -#undef VCC_TYPE -#endif static enum var_type vcc_arg_type(const char **p) @@ -421,8 +416,8 @@ /*-------------------------------------------------------------------- */ -static void -vcc_expr_call(struct vcc *tl, struct expr **e, const struct symbol *sym) +void +vcc_Expr_Func(struct vcc *tl, struct expr **e, const struct symbol *sym) { const char *p, *q, *r; struct expr *e1; @@ -561,6 +556,12 @@ return; } AN(sym); + if (sym->eval != NULL) { + sym->eval(tl, &e1, sym); + ERRCHK(tl); + *e = e1; + return; + } switch(sym->kind) { case SYM_VAR: @@ -573,9 +574,7 @@ vcc_NextToken(tl); break; case SYM_FUNC: - vcc_expr_call(tl, &e1, sym); - ERRCHK(tl); - *e = e1; + ErrInternal(tl); return; case SYM_PROC: vsb_printf(tl->sb, @@ -1036,7 +1035,7 @@ t1 = tl->t; e = vcc_new_expr(); - vcc_expr_call(tl, &e, sym); + vcc_Expr_Func(tl, &e, sym); if (!tl->err) { vcc_expr_fmt(tl->fb, tl->indent, e); vsb_cat(tl->fb, ";\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_vmod.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-27 18:48:40 UTC (rev 5478) +++ trunk/varnish-cache/lib/libvcl/vcc_vmod.c 2010-10-27 19:40:08 UTC (rev 5479) @@ -155,6 +155,7 @@ sym = VCC_AddSymbolStr(tl, p, SYM_FUNC); ERRCHK(tl); AN(sym); + sym->eval = vcc_Expr_Func; p += strlen(p) + 1; sym->cfunc = p; p += strlen(p) + 1; From phk at varnish-cache.org Wed Oct 27 20:07:28 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 22:07:28 +0200 Subject: r5480 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-27 22:07:28 +0200 (Wed, 27 Oct 2010) New Revision: 5480 Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Also let variable symbols carry their eval function Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-27 19:40:08 UTC (rev 5479) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-10-27 20:07:28 UTC (rev 5480) @@ -568,6 +568,7 @@ sym = VCC_AddSymbolStr(tl, v->name, SYM_VAR); sym->var = v; sym->fmt = v->fmt; + sym->eval = vcc_Expr_Var; sym->r_methods = v->r_methods; if (v->fmt == HEADER) sym->wildcard = 1; Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 19:40:08 UTC (rev 5479) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 20:07:28 UTC (rev 5480) @@ -239,6 +239,7 @@ double vcc_DoubleVal(struct vcc *tl); void vcc_Expr(struct vcc *tl, enum var_type typ); void vcc_Expr_Call(struct vcc *tl, const struct symbol *sym); +sym_expr_t vcc_Expr_Var; sym_expr_t vcc_Expr_Func; /* vcc_dir_dns.c */ Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 19:40:08 UTC (rev 5479) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 20:07:28 UTC (rev 5480) @@ -417,6 +417,26 @@ */ void +vcc_Expr_Var(struct vcc *tl, struct expr **e, const struct symbol *sym) +{ + const struct var *vp; + + assert(sym->kind == SYM_VAR); + vcc_AddUses(tl, tl->t, sym->r_methods, "Not available"); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); + ERRCHK(tl); + assert(vp != NULL); + vsb_printf((*e)->vsb, "%s", vp->rname); + (*e)->fmt = vp->fmt; + vcc_NextToken(tl); + vsb_finish((*e)->vsb); + AZ(vsb_overflowed((*e)->vsb)); +} + +/*-------------------------------------------------------------------- + */ + +void vcc_Expr_Func(struct vcc *tl, struct expr **e, const struct symbol *sym) { const char *p, *q, *r; @@ -424,8 +444,7 @@ enum var_type fmt; char buf[32]; - (void)tl; - (void)e; + assert(sym->kind == SYM_FUNC || sym->kind == SYM_PROC); AN(sym->cfunc); AN(sym->args); SkipToken(tl, ID); @@ -565,14 +584,8 @@ switch(sym->kind) { case SYM_VAR: - vcc_AddUses(tl, tl->t, sym->r_methods, "Not available"); - vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); - ERRCHK(tl); - assert(vp != NULL); - vsb_printf(e1->vsb, "%s", vp->rname); - e1->fmt = vp->fmt; - vcc_NextToken(tl); - break; + ErrInternal(tl); + return; case SYM_FUNC: ErrInternal(tl); return; From phk at varnish-cache.org Wed Oct 27 20:51:27 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 22:51:27 +0200 Subject: r5481 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-10-27 22:51:27 +0200 (Wed, 27 Oct 2010) New Revision: 5481 Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c trunk/varnish-cache/bin/varnishd/cache_vcl.c Log: Only release VCL if we have one Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2010-10-27 20:07:28 UTC (rev 5480) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2010-10-27 20:51:27 UTC (rev 5481) @@ -190,8 +190,10 @@ AZ(w->wfd); assert(w->wlp == w->wlb); w->wrq = NULL; - if (params->diag_bitmap & 0x00040000) - VCL_Rel(&w->vcl); + if (params->diag_bitmap & 0x00040000) { + if (w->vcl != NULL) + VCL_Rel(&w->vcl); + } if (!Lck_Trylock(&wstat_mtx)) { wrk_sumstat(w); Lck_Unlock(&wstat_mtx); Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vcl.c 2010-10-27 20:07:28 UTC (rev 5480) +++ trunk/varnish-cache/bin/varnishd/cache_vcl.c 2010-10-27 20:51:27 UTC (rev 5481) @@ -104,6 +104,7 @@ { struct VCL_conf *vc; + AN(*vcc); vc = *vcc; *vcc = NULL; From phk at varnish-cache.org Wed Oct 27 21:03:12 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 23:03:12 +0200 Subject: r5482 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-27 23:03:12 +0200 (Wed, 27 Oct 2010) New Revision: 5482 Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_expr.c Log: Turn backends into self evaluating symbols Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-27 20:51:27 UTC (rev 5481) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2010-10-27 21:03:12 UTC (rev 5482) @@ -676,6 +676,22 @@ } /*-------------------------------------------------------------------- + * Tell rest of compiler about a backend + */ + +static void +vcc_DefBackend(struct vcc *tl, const struct token *nm) +{ + struct symbol *sym; + + sym = VCC_GetSymbolTok(tl, nm, SYM_BACKEND); + AN(sym); + sym->fmt = BACKEND; + sym->eval = vcc_Expr_Backend; + sym->ndef++; +} + +/*-------------------------------------------------------------------- * Parse a plain backend aka a simple director */ @@ -687,7 +703,7 @@ h = TlAlloc(tl, sizeof *h); h->name = tl->t_dir; - vcc_AddDef(tl, tl->t_dir, SYM_BACKEND); + vcc_DefBackend(tl, tl->t_dir); sprintf(vgcname, "_%.*s", PF(h->name)); h->vgcname = TlAlloc(tl, strlen(vgcname) + 1); strcpy(h->vgcname, vgcname); @@ -735,7 +751,7 @@ tl->t_policy = t_first; vcc_ParseSimpleDirector(tl); } else { - vcc_AddDef(tl, tl->t_dir, SYM_BACKEND); + vcc_DefBackend(tl, tl->t_dir); ExpectErr(tl, ID); /* ID: policy */ tl->t_policy = tl->t; vcc_NextToken(tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 20:51:27 UTC (rev 5481) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 21:03:12 UTC (rev 5482) @@ -78,7 +78,7 @@ #undef VCC_SYMB }; -typedef void sym_expr_t(struct vcc *tl, struct expr **e, +typedef void sym_expr_t(struct vcc *tl, struct expr * const *e, const struct symbol *sym); struct symbol { @@ -241,6 +241,7 @@ void vcc_Expr_Call(struct vcc *tl, const struct symbol *sym); sym_expr_t vcc_Expr_Var; sym_expr_t vcc_Expr_Func; +sym_expr_t vcc_Expr_Backend; /* vcc_dir_dns.c */ parsedirector_f vcc_ParseDnsDirector; Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 20:51:27 UTC (rev 5481) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-10-27 21:03:12 UTC (rev 5482) @@ -417,8 +417,23 @@ */ void -vcc_Expr_Var(struct vcc *tl, struct expr **e, const struct symbol *sym) +vcc_Expr_Backend(struct vcc *tl, struct expr * const *e, const struct symbol *sym) { + + assert(sym->kind == SYM_BACKEND); + + vcc_ExpectCid(tl); + vcc_AddRef(tl, tl->t, SYM_BACKEND); + vsb_printf((*e)->vsb, "VGCDIR(_%.*s)", PF(tl->t)); + (*e)->fmt = BACKEND; + vcc_NextToken(tl); +} + +/*-------------------------------------------------------------------- + */ +void +vcc_Expr_Var(struct vcc *tl, struct expr * const *e, const struct symbol *sym) +{ const struct var *vp; assert(sym->kind == SYM_VAR); @@ -429,18 +444,16 @@ vsb_printf((*e)->vsb, "%s", vp->rname); (*e)->fmt = vp->fmt; vcc_NextToken(tl); - vsb_finish((*e)->vsb); - AZ(vsb_overflowed((*e)->vsb)); } /*-------------------------------------------------------------------- */ void -vcc_Expr_Func(struct vcc *tl, struct expr **e, const struct symbol *sym) +vcc_Expr_Func(struct vcc *tl, struct expr * const *e, const struct symbol *sym) { const char *p, *q, *r; - struct expr *e1; + struct expr *e1, *e2; enum var_type fmt; char buf[32]; @@ -450,10 +463,11 @@ SkipToken(tl, ID); SkipToken(tl, '('); p = sym->args; - (*e)->fmt = vcc_arg_type(&p); - vsb_printf((*e)->vsb, "%s(sp, \v+", sym->cfunc); - vsb_finish((*e)->vsb); - AZ(vsb_overflowed((*e)->vsb)); + e2 = vcc_new_expr(); + e2->fmt = vcc_arg_type(&p); + vsb_printf(e2->vsb, "%s(sp, \v+", sym->cfunc); + vsb_finish(e2->vsb); + AZ(vsb_overflowed(e2->vsb)); q = "\v1\n\v2"; while (*p != '\0') { e1 = NULL; @@ -496,11 +510,13 @@ if (*p != '\0') SkipToken(tl, ','); } - *e = vcc_expr_edit((*e)->fmt, q, *e, e1); + e2 = vcc_expr_edit(e2->fmt, q, e2, e1); q = "\v1,\n\v2"; } SkipToken(tl, ')'); - *e = vcc_expr_edit((*e)->fmt, "\v1\n)\v-", *e, NULL); + e2 = vcc_expr_edit(e2->fmt, "\v1\n)\v-", e2, NULL); + (*e)->fmt = e2->fmt; + vsb_cat((*e)->vsb, vsb_data(e2->vsb)); } /*-------------------------------------------------------------------- @@ -516,7 +532,6 @@ { struct expr *e1, *e2; const struct symbol *sym; - const struct var *vp; double d; *e = NULL; @@ -553,14 +568,6 @@ e1->fmt = BOOL; break; } - if (fmt == BACKEND) { - vcc_ExpectCid(tl); - vcc_AddRef(tl, tl->t, SYM_BACKEND); - vsb_printf(e1->vsb, "VGCDIR(_%.*s)", PF(tl->t)); - e1->fmt = BACKEND; - vcc_NextToken(tl); - break; - } /* * XXX: what if var and func/proc had same name ? * XXX: look for SYM_VAR first for consistency ? @@ -578,8 +585,7 @@ if (sym->eval != NULL) { sym->eval(tl, &e1, sym); ERRCHK(tl); - *e = e1; - return; + break; } switch(sym->kind) { @@ -1049,6 +1055,8 @@ t1 = tl->t; e = vcc_new_expr(); vcc_Expr_Func(tl, &e, sym); + vsb_finish(e->vsb); + AZ(vsb_overflowed(e->vsb)); if (!tl->err) { vcc_expr_fmt(tl->fb, tl->indent, e); vsb_cat(tl->fb, ";\n"); From phk at varnish-cache.org Wed Oct 27 21:19:03 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 27 Oct 2010 23:19:03 +0200 Subject: r5483 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-10-27 23:19:03 +0200 (Wed, 27 Oct 2010) New Revision: 5483 Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h Log: Minor cleanup Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 21:03:12 UTC (rev 5482) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-10-27 21:19:03 UTC (rev 5483) @@ -91,17 +91,21 @@ unsigned wildcard; enum symkind kind; - unsigned nref, ndef; const struct token *def_b, *def_e; enum var_type fmt; + sym_expr_t *eval; + + /* xref.c */ struct proc *proc; + unsigned nref, ndef; - sym_expr_t *eval; - + /* SYM_PROC, SYM_FUNC */ const char *cfunc; const char *args; + + /* SYM_VAR */ const struct var *var; unsigned r_methods; }; From phk at varnish-cache.org Thu Oct 28 08:53:22 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 28 Oct 2010 10:53:22 +0200 Subject: r5484 - trunk/varnish-cache/include Message-ID: Author: phk Date: 2010-10-28 10:53:22 +0200 (Thu, 28 Oct 2010) New Revision: 5484 Modified: trunk/varnish-cache/include/Makefile.am Log: add vtypes.h to the auto* magic Modified: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2010-10-27 21:19:03 UTC (rev 5483) +++ trunk/varnish-cache/include/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) @@ -49,7 +49,8 @@ vre.h \ vrt.h \ vrt_obj.h \ - vss.h + vss.h \ + vtypes.h vcl_returns.h vcl.h vrt_obj.h: $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vrt.h @PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir) From tfheen at varnish-cache.org Thu Oct 28 12:18:39 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 28 Oct 2010 14:18:39 +0200 Subject: r5485 - in trunk/varnish-cache/bin: varnishadm varnishd varnishhist varnishlog varnishncsa varnishreplay varnishsizes varnishstat varnishtest varnishtop Message-ID: Author: tfheen Date: 2010-10-28 14:18:39 +0200 (Thu, 28 Oct 2010) New Revision: 5485 Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishhist/Makefile.am trunk/varnish-cache/bin/varnishlog/Makefile.am trunk/varnish-cache/bin/varnishncsa/Makefile.am trunk/varnish-cache/bin/varnishreplay/Makefile.am trunk/varnish-cache/bin/varnishsizes/Makefile.am trunk/varnish-cache/bin/varnishstat/Makefile.am trunk/varnish-cache/bin/varnishtest/Makefile.am trunk/varnish-cache/bin/varnishtop/Makefile.am Log: Get rid of gmakeism in manual page generation %-rules are a gmakeism, and similarly, it appears that GNU and BSD make treat $< differently for target rules. This commit should hopefully make BSD make happier when it comes to make dist. Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -15,9 +15,9 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ ${PTHREAD_LIBS} ${NET_LIBS} -%.1: $(top_srcdir)/doc/sphinx/reference/%.rst +varnishadm.1: $(top_srcdir)/doc/sphinx/reference/varnishadm.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -117,9 +117,9 @@ # Explicitly record dependency mgt_vcc.c: default_vcl.h -%.1: ../../doc/sphinx/reference/%.rst +varnishd.1: $(top_srcdir)/doc/sphinx/reference/varnishd.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? @ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishhist/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -14,9 +14,9 @@ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishhist.1: $(top_srcdir)/doc/sphinx/reference/varnishhist.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishlog/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -14,9 +14,9 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishlog.1: $(top_srcdir)/doc/sphinx/reference/varnishlog.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishncsa/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -14,9 +14,9 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishncsa.1: $(top_srcdir)/doc/sphinx/reference/varnishncsa.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishreplay/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -15,9 +15,9 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} ${NET_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishreplay.1: $(top_srcdir)/doc/sphinx/reference/varnishreplay.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishsizes/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -14,9 +14,9 @@ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} -%.1: $(top_srcdir)/doc/sphinx/reference/%.rst +varnishsizes.1: $(top_srcdir)/doc/sphinx/reference/varnishsizes.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishstat/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -17,9 +17,9 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${CURSES_LIBS} ${RT_LIBS} ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishstat.1: $(top_srcdir)/doc/sphinx/reference/varnishstat.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishtest/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -33,9 +33,9 @@ EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \ $(top_srcdir)/bin/varnishtest/tests/README -%.1: ../../doc/sphinx/reference/%.rst +varnishtest.1: $(top_srcdir)/doc/sphinx/reference/varnishtest.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" Modified: trunk/varnish-cache/bin/varnishtop/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-10-28 08:53:22 UTC (rev 5484) +++ trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) @@ -13,9 +13,9 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${CURSES_LIBS} ${PTHREAD_LIBS} -%.1: ../../doc/sphinx/reference/%.rst +varnishtop.1: $(top_srcdir)/doc/sphinx/reference/varnishtop.rst if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" From tfheen at varnish-cache.org Thu Oct 28 12:26:27 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 28 Oct 2010 14:26:27 +0200 Subject: r5486 - trunk/varnish-cache/bin/varnishd Message-ID: Author: tfheen Date: 2010-10-28 14:26:27 +0200 (Thu, 28 Oct 2010) New Revision: 5486 Modified: trunk/varnish-cache/bin/varnishd/Makefile.am Log: Fix typo Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-28 12:18:39 UTC (rev 5485) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-10-28 12:26:27 UTC (rev 5486) @@ -119,7 +119,7 @@ varnishd.1: $(top_srcdir)/doc/sphinx/reference/varnishd.rst if HAVE_RST2MAN - ${RST2MAN} $? @ + ${RST2MAN} $? $@ else @echo "========================================" @echo "You need rst2man installed to make dist" From tfheen at varnish-cache.org Thu Oct 28 12:27:11 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Thu, 28 Oct 2010 14:27:11 +0200 Subject: r5487 - trunk/varnish-cache/man Message-ID: Author: tfheen Date: 2010-10-28 14:27:10 +0200 (Thu, 28 Oct 2010) New Revision: 5487 Modified: trunk/varnish-cache/man/Makefile.am Log: Fix up building of vcl.7 man page Make the vcl.7 man page hopefully build with BSD make. Modified: trunk/varnish-cache/man/Makefile.am =================================================================== --- trunk/varnish-cache/man/Makefile.am 2010-10-28 12:26:27 UTC (rev 5486) +++ trunk/varnish-cache/man/Makefile.am 2010-10-28 12:27:10 UTC (rev 5487) @@ -5,7 +5,7 @@ vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ $(top_srcdir)/bin/varnishd/default.vcl if HAVE_RST2MAN - ${RST2MAN} $< >$@ + ${RST2MAN} $(top_srcdir)/doc/sphinx/reference/vcl.rst $@ else @echo "========================================" @echo "You need rst2man installed to make dist"