]> err.no Git - varnish/commitdiff
Set the poll'ed fd to -1 when we halfclose the fd to avoid
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 19:42:08 +0000 (19:42 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 30 Sep 2007 19:42:08 +0000 (19:42 +0000)
an infinite loop on certain OS's.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2057 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pipe.c

index 3e6392ec6cb84d56aa5779003eaf4f39e7a0ef6f..4df0a0c2c583eeec85ed3c94c856ac4c8b4139c8 100644 (file)
@@ -52,6 +52,7 @@ rdf(struct pollfd *fds, int idx)
        if (i <= 0 || fds[1-idx].events == 0) {
                AZ(shutdown(fds[idx].fd, SHUT_RD));
                AZ(shutdown(fds[1-idx].fd, SHUT_WR));
+               fds[idx].fd = -1;
                fds[idx].events = 0;
                return;
        }
@@ -60,6 +61,7 @@ rdf(struct pollfd *fds, int idx)
                if (j != i) {
                        AZ(shutdown(fds[idx].fd, SHUT_WR));
                        AZ(shutdown(fds[1-idx].fd, SHUT_RD));
+                       fds[1-idx].fd = -1;
                        fds[1-idx].events = 0;
                        return;
                }