[master] 2d22965 Fix a variable leaf uninitialized by previous commit.

Poul-Henning Kamp phk at FreeBSD.org
Thu Dec 5 11:05:01 CET 2013


commit 2d229657c6f5b7e070a75483b5c90c208f60410a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Dec 5 10:04:17 2013 +0000

    Fix a variable leaf uninitialized by previous commit.
    
    Spotted by:	Scoof (first) and Coverity (second)

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 2f5237c..6a601a8 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -41,6 +41,7 @@
 
 #include "config.h"
 
+#include <math.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -399,10 +400,14 @@ vca_acct(void *arg)
 			continue;
 		AZ(listen(ls->sock, cache_param->listen_depth));
 #ifdef HAVE_TCP_KEEP
+		u = (unsigned)round(cache_param->tcp_keepalive_time);
 		vca_tcp_keep_probe(ls->sock, TCP_KEEPIDLE, &u);
 		cache_param->tcp_keepalive_time = u;
+
 		vca_tcp_keep_probe(ls->sock,
 		    TCP_KEEPCNT, &cache_param->tcp_keepalive_probes);
+
+		u = (unsigned)round(cache_param->tcp_keepalive_intvl);
 		vca_tcp_keep_probe(ls->sock, TCP_KEEPINTVL, &u);
 		cache_param->tcp_keepalive_intvl = u;
 #endif



More information about the varnish-commit mailing list