From 550925808561eddcc4c34d61e03ad235c05f56eb Mon Sep 17 00:00:00 2001 From: des Date: Sun, 16 Mar 2008 14:11:26 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.5