From 32b5bfe7ff32de87067003a8b6f63f44df8b7c22 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 23 Oct 2007 12:36:34 +0000 Subject: [PATCH] Check for a negative return from HTC_Rx(). Probably needs revisiting. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2162 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_fetch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 067749d4..a3f1ea93 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -331,6 +331,13 @@ Fetch(struct sess *sp) i = HTC_Rx(htc); while (i == 0); + if (i < 0) { + VBE_UpdateHealth(sp, vc, -1); + VBE_ClosedFd(sp->wrk, vc); + /* XXX: other cleanup ? */ + return (__LINE__); + } + if (http_DissectResponse(sp->wrk, htc, hp)) { VBE_UpdateHealth(sp, vc, -2); VBE_ClosedFd(sp->wrk, vc); -- 2.39.5