From: phk Date: Wed, 19 Jul 2006 19:45:14 +0000 (+0000) Subject: Don't bother determining if we should close if we already have done so. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a034e2f8bd9f8eecd53d160279f373208c5e0559;p=varnish Don't bother determining if we should close if we already have done so. Also: we may not have valid headers if cache_http.c threw a 400. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@502 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 4829c26b..b19a4f78 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -85,7 +85,9 @@ cnt_done(struct sess *sp) char *b; assert(sp->obj == NULL); - if (http_GetHdr(sp->http, "Connection", &b) && + if (sp->fd < 0) { + /* Allready closed */ + } else if (http_GetHdr(sp->http, "Connection", &b) && !strcmp(b, "close")) { vca_close_session(sp, "Connection header"); } else if (strcmp(sp->http->proto, "HTTP/1.1")) {