[master] c70284d Minor polish

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 20 08:37:08 UTC 2017


commit c70284dfea1a0b3a7a08c19b58f846745fb1525b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 20 07:13:12 2017 +0000

    Minor polish

diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index 9a2af88..8a30f59 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -43,7 +43,7 @@ static unsigned fetchfrag;
  *
  * Other code is allowed to look at busyobj->fetch_failed to bail out
  *
- * For convenience, always return -1
+ * For convenience, always return VFP_ERROR
  */
 
 enum vfp_status
@@ -176,14 +176,13 @@ VFP_Suck(struct vfp_ctx *vc, void *p, ssize_t *lp)
 		vp = VFP_Suck(vc, p, lp);
 	} else if (vfe->closed == VFP_OK) {
 		vp = vfe->vfp->pull(vc, vfe, p, lp);
-		if (vp != VFP_OK && vp != VFP_END && vp != VFP_ERROR) {
-			(void)VFP_Error(vc, "Fetch filter %s returned %d",
+		if (vp != VFP_OK && vp != VFP_END && vp != VFP_ERROR)
+			vp = VFP_Error(vc, "Fetch filter %s returned %d",
 			    vfe->vfp->name, vp);
-			vp = VFP_ERROR;
-		}
+		else
+			vfe->bytes_out += *lp;
 		vfe->closed = vp;
 		vfe->calls++;
-		vfe->bytes_out += *lp;
 	} else {
 		/* Already closed filter */
 		*lp = 0;


More information about the varnish-commit mailing list