From 84b91a18f975f6f1af5a954776b810a95f1012be Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 24 Jun 2008 10:04:48 +0000 Subject: [PATCH] Fix code, so varnish will still start as long as at least one listen address works. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2785 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 60dfb9d2..f631110a 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -185,20 +185,26 @@ vca_acct(void *arg) if (params->send_timeout != tv_sndtimeo.tv_sec) { need_test = 1; tv_sndtimeo.tv_sec = params->send_timeout; - VTAILQ_FOREACH(ls, &heritage.socks, list) + VTAILQ_FOREACH(ls, &heritage.socks, list) { + if (ls->sock < 0) + continue; AZ(setsockopt(ls->sock, SOL_SOCKET, SO_SNDTIMEO, &tv_sndtimeo, sizeof tv_sndtimeo)); + } } #endif #ifdef SO_RCVTIMEO_WORKS if (params->sess_timeout != tv_rcvtimeo.tv_sec) { need_test = 1; tv_rcvtimeo.tv_sec = params->sess_timeout; - VTAILQ_FOREACH(ls, &heritage.socks, list) + VTAILQ_FOREACH(ls, &heritage.socks, list) { + if (ls->sock < 0) + continue; AZ(setsockopt(ls->sock, SOL_SOCKET, SO_RCVTIMEO, &tv_rcvtimeo, sizeof tv_rcvtimeo)); + } } #endif i = poll(pfd, heritage.nsocks, 1000); -- 2.39.5