From: des Date: Sun, 16 Mar 2008 14:11:26 +0000 (+0000) Subject: The value of HTTP_HDR_MAX is not visible to the preprocessor, so X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=550925808561eddcc4c34d61e03ad235c05f56eb;p=varnish The value of HTTP_HDR_MAX is not visible to the preprocessor, so (IOV_MAX < (HTTP_HDR_MAX * 2)) is equivalent to (IOV_MAX < (0 * 2)), which obviously is never true. Fixes #222. Submitted by: Jyri J. Virkki git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2606 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 3b27d78d..3aaabb2e 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -38,6 +38,7 @@ #include #endif #include +#include #include "vqueue.h" @@ -50,6 +51,8 @@ #include "heritage.h" #include "miniobj.h" +#define HTTP_HDR_MAX_VAL 32 + enum { /* Fields from the first line of HTTP proto */ HTTP_HDR_REQ, @@ -59,14 +62,14 @@ enum { HTTP_HDR_RESPONSE, /* HTTP header lines */ HTTP_HDR_FIRST, - HTTP_HDR_MAX = 32 /* XXX: should be #defined */ + HTTP_HDR_MAX = HTTP_HDR_MAX_VAL }; /* Note: intentionally not IOV_MAX unless it has to be */ -#if (IOV_MAX < (HTTP_HDR_MAX * 2)) +#if (IOV_MAX < (HTTP_HDR_MAX_VAL * 2)) # define MAX_IOVS IOV_MAX #else -# define MAX_IOVS (HTTP_HDR_MAX * 2) +# define MAX_IOVS (HTTP_HDR_MAX_VAL * 2) #endif struct cli;