]> err.no Git - varnish/commitdiff
We always want to go through vcl_fetch(), even on error 503
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Oct 2007 07:21:26 +0000 (07:21 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Oct 2007 07:21:26 +0000 (07:21 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2070 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c

index fd5f4e90b454aed307d760137ca4ea3029da95d7..e2e852e3a0fcb49c945cdb3599f0f250a640d5f8 100644 (file)
@@ -304,39 +304,35 @@ cnt_fetch(struct sess *sp)
        VBE_free_bereq(sp->bereq);
        sp->bereq = NULL;
 
-       if (0 && i) {
-               SYN_ErrorPage(sp, 503, "Error talking to backend", 30);
-       } else {
-               if (!i)
-                       RFC2616_cache_policy(sp, &sp->obj->http);       /* XXX -> VCL */
-               else
-                       sp->obj->http.status = 503;
-
-               VCL_fetch_method(sp);
-
-               switch (sp->handling) {
-               case VCL_RET_ERROR:
-               case VCL_RET_RESTART:
-                       sp->obj->ttl = 0;
-                       sp->obj->cacheable = 0;
-                       HSH_Unbusy(sp->obj);
-                       HSH_Deref(sp->obj);
-                       sp->obj = NULL;
-                       if (sp->handling == VCL_RET_ERROR)
-                               sp->step = STP_ERROR;
-                       else {
-                               sp->restarts++;
-                               sp->step = STP_RECV;
-                       }
-                       return (0);
-               case VCL_RET_PASS:
-                       sp->obj->pass = 1;
-                       break;
-               case VCL_RET_INSERT:
-                       break;
-               default:
-                       INCOMPL();
+       if (!i)
+               RFC2616_cache_policy(sp, &sp->obj->http);       /* XXX -> VCL */
+       else
+               http_PutStatus(sp->wrk, sp->fd, &sp->obj->http, 503);
+
+       VCL_fetch_method(sp);
+
+       switch (sp->handling) {
+       case VCL_RET_ERROR:
+       case VCL_RET_RESTART:
+               sp->obj->ttl = 0;
+               sp->obj->cacheable = 0;
+               HSH_Unbusy(sp->obj);
+               HSH_Deref(sp->obj);
+               sp->obj = NULL;
+               if (sp->handling == VCL_RET_ERROR)
+                       sp->step = STP_ERROR;
+               else {
+                       sp->restarts++;
+                       sp->step = STP_RECV;
                }
+               return (0);
+       case VCL_RET_PASS:
+               sp->obj->pass = 1;
+               break;
+       case VCL_RET_INSERT:
+               break;
+       default:
+               INCOMPL();
        }
 
        sp->obj->cacheable = 1;