]> err.no Git - varnish/commitdiff
When closing a backend connection, we can run into a ECONNRESET which
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 11:11:17 +0000 (11:11 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 11:11:17 +0000 (11:11 +0000)
given circumstances is fair game.

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

varnish-cache/bin/varnishd/cache_backend_simple.c

index a12b7961fd2790910459a03076e8c7b1260fff66..a105036501753ed09861e3013638146410875931 100644 (file)
@@ -274,12 +274,14 @@ bes_GetFd(const struct sess *sp)
 static void
 bes_ClosedFd(struct worker *w, struct vbe_conn *vc)
 {
+       int i;
 
        CHECK_OBJ_NOTNULL(vc, VBE_CONN_MAGIC);
        CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC);
        assert(vc->fd >= 0);
        WSL(w, SLT_BackendClose, vc->fd, "%s", vc->backend->vcl_name);
-       AZ(close(vc->fd));
+       i = close(vc->fd);
+       assert(i == 0 || errno == ECONNRESET);
        vc->fd = -1;
        VBE_DropRef(vc->backend);
        vc->backend = NULL;