From: phk Date: Tue, 24 Jun 2008 10:04:48 +0000 (+0000) Subject: Fix code, so varnish will still start as long as at least one listen X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84b91a18f975f6f1af5a954776b810a95f1012be;p=varnish 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 --- 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);