[master] e30f261 Correctly initialize probe state in case .initial == 0

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 25 20:17:17 CET 2015


commit e30f261736993a5e03a011f6892eb91ef54aea87
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 25 19:13:48 2015 +0000

    Correctly initialize probe state in case .initial == 0

diff --git a/bin/varnishd/cache/cache_backend_poll.c b/bin/varnishd/cache/cache_backend_poll.c
index 4fc7163..9564e4f 100644
--- a/bin/varnishd/cache/cache_backend_poll.c
+++ b/bin/varnishd/cache/cache_backend_poll.c
@@ -37,11 +37,9 @@
 
 #include "config.h"
 
-#include <math.h>
 #include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/socket.h>
 
 #include "cache.h"
 
@@ -489,11 +487,14 @@ VBP_Insert(struct backend *b, const struct vrt_backend_probe *p,
 	Lck_Unlock(&vbp_mtx);
 
 	if (startthread) {
+		vt->probe = vcl->probe;
 		for (u = 0; u < vcl->probe.initial; u++) {
 			vbp_start_poke(vt);
 			vt->happy |= 1;
 			vbp_has_poked(vt);
 		}
+		if (!vcl->probe.initial)
+			vbp_has_poked(vt);
 		AZ(pthread_create(&vt->thread, NULL, vbp_wrk_poll_backend, vt));
 	}
 }



More information about the varnish-commit mailing list