r2606 - trunk/varnish-cache/bin/varnishd
des at projects.linpro.no
des at projects.linpro.no
Sun Mar 16 15:11:26 CET 2008
Author: des
Date: 2008-03-16 15:11:26 +0100 (Sun, 16 Mar 2008)
New Revision: 2606
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
Log:
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 <jyri at virkki.com>
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2008-03-13 12:49:36 UTC (rev 2605)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2008-03-16 14:11:26 UTC (rev 2606)
@@ -38,6 +38,7 @@
#include <pthread_np.h>
#endif
#include <stdint.h>
+#include <limits.h>
#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 @@
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;
More information about the varnish-commit
mailing list