From 1440ac11883391a3b2cf8ecdc65dbb3711fd9d77 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 21 Dec 2008 18:35:24 +0000 Subject: [PATCH] Be more stringent about our timeout: fail even if we did get a socket, but took to. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3492 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_backend_poll.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_backend_poll.c b/varnish-cache/bin/varnishd/cache_backend_poll.c index dc8423fa..3c07f566 100644 --- a/varnish-cache/bin/varnishd/cache_backend_poll.c +++ b/varnish-cache/bin/varnishd/cache_backend_poll.c @@ -157,6 +157,11 @@ vbp_poke(struct vbp_target *vt) /* Got no connection: failed */ return; } + if (tmo <= 0) { + /* Spent too long time getting it */ + TCP_close(&s); + return; + } /* Send the request */ i = write(s, vt->req, vt->req_len); -- 2.39.5