]> err.no Git - varnish/commitdiff
Fix code, so varnish will still start as long as at least one listen
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Jun 2008 10:04:48 +0000 (10:04 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Jun 2008 10:04:48 +0000 (10:04 +0000)
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

index 60dfb9d2d93c16b07764f111bec20c91cc046c6d..f631110aa7986a178223729bbf9e48cf8e75cac7 100644 (file)
@@ -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);