[master] 5c00b0e Split fetch processor stuff (VFP) from the state machine and be more consistent about VFP_ names.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jun 17 12:17:45 CEST 2013


commit 5c00b0edc5b7eeb5b6d7bee3dea77cef55eac07f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jun 17 10:17:02 2013 +0000

    Split fetch processor stuff (VFP) from the state machine and be
    more consistent about VFP_ names.

diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 0c9fa5d..b1f54ed 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -24,6 +24,7 @@ varnishd_SOURCES = \
 	cache/cache_esi_parse.c \
 	cache/cache_expire.c \
 	cache/cache_fetch.c \
+	cache/cache_fetch_proc.c \
 	cache/cache_gzip.c \
 	cache/cache_hash.c \
 	cache/cache_http.c \
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 644d15c..c0de28c 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -826,10 +826,13 @@ void EXP_NukeLRU(struct worker *wrk, struct vsl_log *vsl, struct lru *lru);
 
 /* cache_fetch.c */
 void VBF_Fetch(struct worker *wrk, struct req *req);
-struct storage *VBF_GetStorage(struct busyobj *, ssize_t sz);
-int VBF_Error(struct busyobj *, const char *error);
-int VBF_Error2(struct busyobj *, const char *error, const char *more);
-void VBF_Init(void);
+
+/* cache_fetch_proc.c */
+struct storage *VFP_GetStorage(struct busyobj *, ssize_t sz);
+int VFP_Error2(struct busyobj *, const char *error, const char *more);
+int VFP_Error(struct busyobj *, const char *error);
+void VFP_Init(void);
+extern struct vfp VFP_nop;
 
 /* cache_gzip.c */
 struct vgz;
diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c
index 95439b0..7da3608 100644
--- a/bin/varnishd/cache/cache_esi_fetch.c
+++ b/bin/varnishd/cache/cache_esi_fetch.c
@@ -93,7 +93,7 @@ vfp_esi_bytes_uu(struct busyobj *bo, const struct vef_priv *vef,
 	CHECK_OBJ_NOTNULL(vef, VEF_MAGIC);
 
 	while (bytes > 0) {
-		st = VBF_GetStorage(bo, 0);
+		st = VFP_GetStorage(bo, 0);
 		if (st == NULL)
 			return (-1);
 		wl = vef_read(htc,
@@ -380,7 +380,7 @@ vfp_esi_end(void *priv)
 		retval = -1;
 
 	if (bo->vgz_rx != NULL && VGZ_Destroy(&bo->vgz_rx) != VGZ_END)
-		retval = VBF_Error(bo, "Gunzip+ESI Failed at the very end");
+		retval = VFP_Error(bo, "Gunzip+ESI Failed at the very end");
 
 	vsb = VEP_Finish(bo);
 
@@ -395,7 +395,7 @@ vfp_esi_end(void *priv)
 				    VSB_data(vsb), l);
 				bo->fetch_obj->esidata->len = l;
 			} else {
-				retval = VBF_Error(bo,
+				retval = VFP_Error(bo,
 				    "Could not allocate storage for esidata");
 			}
 		}
@@ -408,7 +408,7 @@ vfp_esi_end(void *priv)
 	if (vef->vgz != NULL) {
 		VGZ_UpdateObj(vef->vgz, bo->fetch_obj);
 		if (VGZ_Destroy(&vef->vgz) != VGZ_END)
-			retval = VBF_Error(bo,
+			retval = VFP_Error(bo,
 			    "ESI+Gzip Failed at the very end");
 	}
 	if (vef->ibuf != NULL)
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 431406e..875ddb6 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -43,171 +43,6 @@
 #include "vcl.h"
 #include "vtim.h"
 
-static unsigned fetchfrag;
-
-/*--------------------------------------------------------------------
- * We want to issue the first error we encounter on fetching and
- * supress the rest.  This function does that.
- *
- * Other code is allowed to look at busyobj->fetch_failed to bail out
- *
- * For convenience, always return -1
- */
-
-int
-VBF_Error2(struct busyobj *bo, const char *error, const char *more)
-{
-
-	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
-	if (bo->state == BOS_FETCHING) {
-		if (more == NULL)
-			VSLb(bo->vsl, SLT_FetchError, "%s", error);
-		else
-			VSLb(bo->vsl, SLT_FetchError, "%s: %s", error, more);
-	}
-	bo->state = BOS_FAILED;
-	return (-1);
-}
-
-int
-VBF_Error(struct busyobj *bo, const char *error)
-{
-	return(VBF_Error2(bo, error, NULL));
-}
-
-/*--------------------------------------------------------------------
- * VFP_NOP
- *
- * This fetch-processor does nothing but store the object.
- * It also documents the API
- */
-
-/*--------------------------------------------------------------------
- * VFP_BEGIN
- *
- * Called to set up stuff.
- *
- * 'estimate' is the estimate of the number of bytes we expect to receive,
- * as seen on the socket, or zero if unknown.
- */
-static void __match_proto__(vfp_begin_f)
-vfp_nop_begin(void *priv, size_t estimate)
-{
-	struct busyobj *bo;
-
-	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
-
-	if (estimate > 0)
-		(void)VBF_GetStorage(bo, estimate);
-}
-
-/*--------------------------------------------------------------------
- * VFP_BYTES
- *
- * Process (up to) 'bytes' from the socket.
- *
- * Return -1 on error, issue VBF_Error()
- *	will not be called again, once error happens.
- * Return 0 on EOF on socket even if bytes not reached.
- * Return 1 when 'bytes' have been processed.
- */
-
-static int __match_proto__(vfp_bytes_f)
-vfp_nop_bytes(void *priv, struct http_conn *htc, ssize_t bytes)
-{
-	ssize_t l, wl;
-	struct storage *st;
-	struct busyobj *bo;
-
-	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
-
-	while (bytes > 0) {
-		st = VBF_GetStorage(bo, 0);
-		if (st == NULL)
-			return(-1);
-		l = st->space - st->len;
-		if (l > bytes)
-			l = bytes;
-		wl = HTTP1_Read(htc, st->ptr + st->len, l);
-		if (wl <= 0)
-			return (wl);
-		st->len += wl;
-		VBO_extend(bo, wl);
-		bytes -= wl;
-	}
-	return (1);
-}
-
-/*--------------------------------------------------------------------
- * VFP_END
- *
- * Finish & cleanup
- *
- * Return -1 for error
- * Return 0 for OK
- */
-
-static int __match_proto__(vfp_end_f)
-vfp_nop_end(void *priv)
-{
-	struct storage *st;
-	struct busyobj *bo;
-
-	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
-	st = VTAILQ_LAST(&bo->fetch_obj->store, storagehead);
-	if (st == NULL)
-		return (0);
-
-	if (st->len == 0) {
-		VTAILQ_REMOVE(&bo->fetch_obj->store, st, list);
-		STV_free(st);
-		return (0);
-	}
-	if (st->len < st->space)
-		STV_trim(st, st->len, 1);
-	return (0);
-}
-
-static struct vfp vfp_nop = {
-	.begin	=	vfp_nop_begin,
-	.bytes	=	vfp_nop_bytes,
-	.end	=	vfp_nop_end,
-};
-
-/*--------------------------------------------------------------------
- * Fetch Storage to put object into.
- *
- */
-
-struct storage *
-VBF_GetStorage(struct busyobj *bo, ssize_t sz)
-{
-	ssize_t l;
-	struct storage *st;
-	struct object *obj;
-
-	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
-	obj = bo->fetch_obj;
-	CHECK_OBJ_NOTNULL(obj, OBJECT_MAGIC);
-	st = VTAILQ_LAST(&obj->store, storagehead);
-	if (st != NULL && st->len < st->space)
-		return (st);
-
-	l = fetchfrag;
-	if (l == 0)
-		l = sz;
-	if (l == 0)
-		l = cache_param->fetch_chunksize;
-	st = STV_alloc(bo, l);
-	if (st == NULL) {
-		(void)VBF_Error(bo, "Could not get storage");
-		return (NULL);
-	}
-	AZ(st->len);
-	VTAILQ_INSERT_TAIL(&obj->store, st, list);
-	return (st);
-}
-
 /*--------------------------------------------------------------------
  * Copy req->bereq and run it by VCL::vcl_backend_fetch{}
  */
@@ -558,7 +393,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	}
 
 	if (bo->vfp == NULL)
-		bo->vfp = &vfp_nop;
+		bo->vfp = &VFP_nop;
 
 	V1F_fetch_body(wrk, bo);
 
@@ -684,33 +519,3 @@ VBF_Fetch(struct worker *wrk, struct req *req)
 		(void)usleep(100000);
 	}
 }
-
-/*--------------------------------------------------------------------
- * Debugging aids
- */
-
-static void
-debug_fragfetch(struct cli *cli, const char * const *av, void *priv)
-{
-	(void)priv;
-	(void)cli;
-	fetchfrag = strtoul(av[2], NULL, 0);
-}
-
-static struct cli_proto debug_cmds[] = {
-	{ "debug.fragfetch", "debug.fragfetch",
-		"\tEnable fetch fragmentation\n", 1, 1, "d", debug_fragfetch },
-	{ NULL }
-};
-
-
-/*--------------------------------------------------------------------
- *
- */
-
-void
-VBF_Init(void)
-{
-
-	CLI_AddFuncs(debug_cmds);
-}
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
new file mode 100644
index 0000000..8fd37f9
--- /dev/null
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -0,0 +1,236 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2011 Varnish Software AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * 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 <inttypes.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cache.h"
+
+#include "hash/hash_slinger.h"
+
+#include "cache_backend.h"
+#include "vcli_priv.h"
+
+static unsigned fetchfrag;
+
+/*--------------------------------------------------------------------
+ * We want to issue the first error we encounter on fetching and
+ * supress the rest.  This function does that.
+ *
+ * Other code is allowed to look at busyobj->fetch_failed to bail out
+ *
+ * For convenience, always return -1
+ */
+
+int
+VFP_Error2(struct busyobj *bo, const char *error, const char *more)
+{
+
+	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
+	if (bo->state == BOS_FETCHING) {
+		if (more == NULL)
+			VSLb(bo->vsl, SLT_FetchError, "%s", error);
+		else
+			VSLb(bo->vsl, SLT_FetchError, "%s: %s", error, more);
+	}
+	bo->state = BOS_FAILED;
+	return (-1);
+}
+
+int
+VFP_Error(struct busyobj *bo, const char *error)
+{
+	return(VFP_Error2(bo, error, NULL));
+}
+
+/*--------------------------------------------------------------------
+ * VFP_NOP
+ *
+ * This fetch-processor does nothing but store the object.
+ * It also documents the API
+ */
+
+/*--------------------------------------------------------------------
+ * VFP_BEGIN
+ *
+ * Called to set up stuff.
+ *
+ * 'estimate' is the estimate of the number of bytes we expect to receive,
+ * as seen on the socket, or zero if unknown.
+ */
+static void __match_proto__(vfp_begin_f)
+vfp_nop_begin(void *priv, size_t estimate)
+{
+	struct busyobj *bo;
+
+	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
+
+	if (estimate > 0)
+		(void)VFP_GetStorage(bo, estimate);
+}
+
+/*--------------------------------------------------------------------
+ * VFP_BYTES
+ *
+ * Process (up to) 'bytes' from the socket.
+ *
+ * Return -1 on error, issue VFP_Error()
+ *	will not be called again, once error happens.
+ * Return 0 on EOF on socket even if bytes not reached.
+ * Return 1 when 'bytes' have been processed.
+ */
+
+static int __match_proto__(vfp_bytes_f)
+vfp_nop_bytes(void *priv, struct http_conn *htc, ssize_t bytes)
+{
+	ssize_t l, wl;
+	struct storage *st;
+	struct busyobj *bo;
+
+	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
+
+	while (bytes > 0) {
+		st = VFP_GetStorage(bo, 0);
+		if (st == NULL)
+			return(-1);
+		l = st->space - st->len;
+		if (l > bytes)
+			l = bytes;
+		wl = HTTP1_Read(htc, st->ptr + st->len, l);
+		if (wl <= 0)
+			return (wl);
+		st->len += wl;
+		VBO_extend(bo, wl);
+		bytes -= wl;
+	}
+	return (1);
+}
+
+/*--------------------------------------------------------------------
+ * VFP_END
+ *
+ * Finish & cleanup
+ *
+ * Return -1 for error
+ * Return 0 for OK
+ */
+
+static int __match_proto__(vfp_end_f)
+vfp_nop_end(void *priv)
+{
+	struct storage *st;
+	struct busyobj *bo;
+
+	CAST_OBJ_NOTNULL(bo, priv, BUSYOBJ_MAGIC);
+	st = VTAILQ_LAST(&bo->fetch_obj->store, storagehead);
+	if (st == NULL)
+		return (0);
+
+	if (st->len == 0) {
+		VTAILQ_REMOVE(&bo->fetch_obj->store, st, list);
+		STV_free(st);
+		return (0);
+	}
+	if (st->len < st->space)
+		STV_trim(st, st->len, 1);
+	return (0);
+}
+
+struct vfp VFP_nop = {
+	.begin	=	vfp_nop_begin,
+	.bytes	=	vfp_nop_bytes,
+	.end	=	vfp_nop_end,
+};
+
+/*--------------------------------------------------------------------
+ * Fetch Storage to put object into.
+ *
+ */
+
+struct storage *
+VFP_GetStorage(struct busyobj *bo, ssize_t sz)
+{
+	ssize_t l;
+	struct storage *st;
+	struct object *obj;
+
+	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
+	obj = bo->fetch_obj;
+	CHECK_OBJ_NOTNULL(obj, OBJECT_MAGIC);
+	st = VTAILQ_LAST(&obj->store, storagehead);
+	if (st != NULL && st->len < st->space)
+		return (st);
+
+	l = fetchfrag;
+	if (l == 0)
+		l = sz;
+	if (l == 0)
+		l = cache_param->fetch_chunksize;
+	st = STV_alloc(bo, l);
+	if (st == NULL) {
+		(void)VFP_Error(bo, "Could not get storage");
+		return (NULL);
+	}
+	AZ(st->len);
+	VTAILQ_INSERT_TAIL(&obj->store, st, list);
+	return (st);
+}
+
+/*--------------------------------------------------------------------
+ * Debugging aids
+ */
+
+static void
+debug_fragfetch(struct cli *cli, const char * const *av, void *priv)
+{
+	(void)priv;
+	(void)cli;
+	fetchfrag = strtoul(av[2], NULL, 0);
+}
+
+static struct cli_proto debug_cmds[] = {
+	{ "debug.fragfetch", "debug.fragfetch",
+		"\tEnable fetch fragmentation\n", 1, 1, "d", debug_fragfetch },
+	{ NULL }
+};
+
+/*--------------------------------------------------------------------
+ *
+ */
+
+void
+VFP_Init(void)
+{
+
+	CLI_AddFuncs(debug_cmds);
+}
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 3dceda2..f0374a7 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -206,7 +206,7 @@ VGZ_ObufStorage(struct busyobj *bo, struct vgz *vg)
 {
 	struct storage *st;
 
-	st = VBF_GetStorage(bo, 0);
+	st = VFP_GetStorage(bo, 0);
 	if (st == NULL)
 		return (-1);
 
@@ -482,7 +482,7 @@ vfp_gunzip_bytes(void *priv, struct http_conn *htc, ssize_t bytes)
 			return(-1);
 		i = VGZ_Gunzip(vg, &dp, &dl);
 		if (i != VGZ_OK && i != VGZ_END)
-			return(VBF_Error(bo, "Gunzip data error"));
+			return(VFP_Error(bo, "Gunzip data error"));
 		VBO_extend(bo, dl);
 	}
 	assert(i == Z_OK || i == Z_STREAM_END);
@@ -504,7 +504,7 @@ vfp_gunzip_end(void *priv)
 		return(0);
 	}
 	if (VGZ_Destroy(&vg) != VGZ_END)
-		return(VBF_Error(bo, "Gunzip error at the very end"));
+		return(VFP_Error(bo, "Gunzip error at the very end"));
 	return (0);
 }
 
@@ -592,7 +592,7 @@ vfp_gzip_end(void *priv)
 	} while (i != Z_STREAM_END);
 	VGZ_UpdateObj(vg, bo->fetch_obj);
 	if (VGZ_Destroy(&vg) != VGZ_END)
-		return(VBF_Error(bo, "Gzip error at the very end"));
+		return(VFP_Error(bo, "Gzip error at the very end"));
 	return (0);
 }
 
@@ -637,7 +637,7 @@ vfp_testgzip_bytes(void *priv, struct http_conn *htc, ssize_t bytes)
 	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
 	AZ(vg->vz.avail_in);
 	while (bytes > 0) {
-		st = VBF_GetStorage(bo, 0);
+		st = VFP_GetStorage(bo, 0);
 		if (st == NULL)
 			return(-1);
 		l = st->space - st->len;
@@ -655,9 +655,9 @@ vfp_testgzip_bytes(void *priv, struct http_conn *htc, ssize_t bytes)
 			VGZ_Obuf(vg, vg->m_buf, vg->m_sz);
 			i = VGZ_Gunzip(vg, &dp, &dl);
 			if (i == VGZ_END && !VGZ_IbufEmpty(vg))
-				return(VBF_Error(bo, "Junk after gzip data"));
+				return(VFP_Error(bo, "Junk after gzip data"));
 			if (i != VGZ_OK && i != VGZ_END)
-				return(VBF_Error2(bo,
+				return(VFP_Error2(bo,
 				    "Invalid Gzip data", vg->vz.msg));
 		}
 	}
@@ -681,7 +681,7 @@ vfp_testgzip_end(void *priv)
 	}
 	VGZ_UpdateObj(vg, bo->fetch_obj);
 	if (VGZ_Destroy(&vg) != VGZ_END)
-		return(VBF_Error(bo, "TestGunzip error at the very end"));
+		return(VFP_Error(bo, "TestGunzip error at the very end"));
 	return (0);
 }
 
diff --git a/bin/varnishd/cache/cache_http1_fetch.c b/bin/varnishd/cache/cache_http1_fetch.c
index ed82094..0e808b3 100644
--- a/bin/varnishd/cache/cache_http1_fetch.c
+++ b/bin/varnishd/cache/cache_http1_fetch.c
@@ -76,13 +76,13 @@ vbf_fetch_straight(struct busyobj *bo, struct http_conn *htc, ssize_t cl)
 	assert(htc->body_status == BS_LENGTH);
 
 	if (cl < 0) {
-		return (VBF_Error(bo, "straight length field bogus"));
+		return (VFP_Error(bo, "straight length field bogus"));
 	} else if (cl == 0)
 		return (0);
 
 	i = bo->vfp->bytes(bo, htc, cl);
 	if (i <= 0)
-		return (VBF_Error(bo, "straight insufficient bytes"));
+		return (VFP_Error(bo, "straight insufficient bytes"));
 	return (0);
 }
 
@@ -105,17 +105,17 @@ vbf_fetch_chunked(struct busyobj *bo, struct http_conn *htc)
 		/* Skip leading whitespace */
 		do {
 			if (HTTP1_Read(htc, buf, 1) <= 0)
-				return (VBF_Error(bo, "chunked read err"));
+				return (VFP_Error(bo, "chunked read err"));
 		} while (vct_islws(buf[0]));
 
 		if (!vct_ishex(buf[0]))
-			return (VBF_Error(bo, "chunked header non-hex"));
+			return (VFP_Error(bo, "chunked header non-hex"));
 
 		/* Collect hex digits, skipping leading zeros */
 		for (u = 1; u < sizeof buf; u++) {
 			do {
 				if (HTTP1_Read(htc, buf + u, 1) <= 0)
-					return (VBF_Error(bo,
+					return (VFP_Error(bo,
 					    "chunked read err"));
 			} while (u == 1 && buf[0] == '0' && buf[u] == '0');
 			if (!vct_ishex(buf[u]))
@@ -123,31 +123,31 @@ vbf_fetch_chunked(struct busyobj *bo, struct http_conn *htc)
 		}
 
 		if (u >= sizeof buf)
-			return (VBF_Error(bo,"chunked header too long"));
+			return (VFP_Error(bo,"chunked header too long"));
 
 		/* Skip trailing white space */
 		while(vct_islws(buf[u]) && buf[u] != '\n')
 			if (HTTP1_Read(htc, buf + u, 1) <= 0)
-				return (VBF_Error(bo, "chunked read err"));
+				return (VFP_Error(bo, "chunked read err"));
 
 		if (buf[u] != '\n')
-			return (VBF_Error(bo,"chunked header no NL"));
+			return (VFP_Error(bo,"chunked header no NL"));
 
 		buf[u] = '\0';
 		cl = vbf_fetch_number(buf, 16);
 		if (cl < 0)
-			return (VBF_Error(bo,"chunked header number syntax"));
+			return (VFP_Error(bo,"chunked header number syntax"));
 
 		if (cl > 0 && bo->vfp->bytes(bo, htc, cl) <= 0)
-			return (VBF_Error(bo, "chunked read err"));
+			return (VFP_Error(bo, "chunked read err"));
 
 		i = HTTP1_Read(htc, buf, 1);
 		if (i <= 0)
-			return (VBF_Error(bo, "chunked read err"));
+			return (VFP_Error(bo, "chunked read err"));
 		if (buf[0] == '\r' && HTTP1_Read( htc, buf, 1) <= 0)
-			return (VBF_Error(bo, "chunked read err"));
+			return (VFP_Error(bo, "chunked read err"));
 		if (buf[0] != '\n')
-			return (VBF_Error(bo,"chunked tail no NL"));
+			return (VFP_Error(bo,"chunked tail no NL"));
 	} while (cl > 0);
 	return (0);
 }
@@ -160,7 +160,7 @@ vbf_fetch_eof(struct busyobj *bo, struct http_conn *htc)
 
 	assert(htc->body_status == BS_EOF);
 	if (bo->vfp->bytes(bo, htc, SSIZE_MAX) < 0)
-		(void)VBF_Error(bo,"eof socket fail");
+		(void)VFP_Error(bo,"eof socket fail");
 }
 
 /*--------------------------------------------------------------------
@@ -377,7 +377,7 @@ V1F_fetch_body(struct worker *wrk, struct busyobj *bo)
 			assert(bo->state == BOS_FAILED);
 		break;
 	case BS_ERROR:
-		cls |= VBF_Error(bo, "error incompatible Transfer-Encoding");
+		cls |= VFP_Error(bo, "error incompatible Transfer-Encoding");
 		mklen = 0;
 		break;
 	default:
diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c
index bb17c0b..2749338 100644
--- a/bin/varnishd/cache/cache_main.c
+++ b/bin/varnishd/cache/cache_main.c
@@ -209,7 +209,7 @@ child_main(void)
 	WAIT_Init();
 	PAN_Init();
 	CLI_Init();
-	VBF_Init();
+	VFP_Init();
 
 	VCL_Init();
 



More information about the varnish-commit mailing list