From: des Date: Tue, 23 Oct 2007 12:36:34 +0000 (+0000) Subject: Check for a negative return from HTC_Rx(). Probably needs revisiting. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32b5bfe7ff32de87067003a8b6f63f44df8b7c22;p=varnish 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 --- 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);