[5.1] 5e4d6c8 backend probe: no need to parse a reason phrase we do not use

Nils Goroll nils.goroll at uplex.de
Mon Apr 10 13:59:08 CEST 2017


commit 5e4d6c843376acc0bf14872d89a4e8bb2f77186b
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Apr 4 15:55:06 2017 +0200

    backend probe: no need to parse a reason phrase we do not use
    
    Ref: bcdf4f12891eb7ecba395bdf268f8be4c9faa255
    
    https://tools.ietf.org/html/rfc7230#section-3.1.2

diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index 3d5bc15..52de48f 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -369,9 +369,9 @@ vbp_poke(struct vbp_target *vt)
 	if (p != NULL)
 		*p = '\0';
 
-	i = sscanf(vt->resp_buf, "HTTP/%*f %u %s", &resp, buf);
+	i = sscanf(vt->resp_buf, "HTTP/%*f %u ", &resp);
 
-	if ((i == 1 || i == 2) && resp == vt->exp_status)
+	if (i == 1 && resp == vt->exp_status)
 		vt->happy |= 1;
 }
 



More information about the varnish-commit mailing list