From a64cce225f7a08d29b99ce0a2facf8fd301712a5 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 10 Jul 2006 08:10:30 +0000 Subject: [PATCH] Put three memory allocation hints into heritage: mem_http_1_line (512) Maximum length of the reqeust/response line of a HTTP message There is no point in filling the entire buffer with junk if we get a preposterously long first line. mem_http_header (4096) Maximum length of entire HTTP header. If we overflow this we return 400. mem_workspace (currently 0) In the future this will be the space we use for constructing headers to send and edits done from VCL. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@392 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/heritage.h | 5 +++++ varnish-cache/bin/varnishd/varnishd.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/varnish-cache/bin/varnishd/heritage.h b/varnish-cache/bin/varnishd/heritage.h index a1c52d63..ae8bf099 100644 --- a/varnish-cache/bin/varnishd/heritage.h +++ b/varnish-cache/bin/varnishd/heritage.h @@ -38,6 +38,11 @@ struct heritage { /* Worker threads */ unsigned wthread_min, wthread_max; + + /* Memory allocation hints */ + unsigned mem_http_1_line; + unsigned mem_http_header; + unsigned mem_workspace; }; extern struct heritage heritage; diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index 72438827..b04e89b3 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -457,6 +457,9 @@ main(int argc, char *argv[]) heritage.default_ttl = 120; heritage.wthread_min = 5; heritage.wthread_max = 5; + heritage.mem_http_1_line= 512; + heritage.mem_http_header= 4096; + heritage.mem_workspace = 0; while ((o = getopt(argc, argv, "b:df:h:p:s:t:w:")) != -1) switch (o) { -- 2.39.5