]> err.no Git - varnish/commitdiff
Remember to move numeric status when we filter one http to another.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Oct 2007 12:25:37 +0000 (12:25 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 1 Oct 2007 12:25:37 +0000 (12:25 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2075 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_fetch.c
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_synthetic.c
varnish-cache/bin/varnishd/mgt_vcc.c
varnish-cache/bin/varnishd/rfc2616.c

index 589259013b889f353dc2b2ae8a5a59926617b747..365ecc302098bff9023c4f842125a37a673f89e0 100644 (file)
@@ -309,6 +309,8 @@ cnt_fetch(struct sess *sp)
        else
                http_PutStatus(sp->wrk, sp->fd, sp->obj->http, 503);
 
+       sp->err_code = http_GetStatus(sp->obj->http);
+WSP(sp, SLT_Debug, "i %d err %d v %d c %d", i, sp->err_code, sp->obj->valid, sp->obj->cacheable);
        VCL_fetch_method(sp);
 
        switch (sp->handling) {
index 1f6819f09d843a22e118318ca3e6f32411ae5ca7..e9b6e45f52063eb91f377097c11a02b995614d44 100644 (file)
@@ -284,14 +284,14 @@ Fetch(struct sess *sp)
 
        vc = VBE_GetFd(sp);
        if (vc == NULL)
-               return (1);
+               return (__LINE__);
        WRK_Reset(w, &vc->fd);
        http_Write(w, hp, 0);
        if (WRK_Flush(w)) {
                VBE_UpdateHealth(sp, vc, -1);
                VBE_ClosedFd(sp->wrk, vc);
                /* XXX: other cleanup ? */
-               return (1);
+               return (__LINE__);
        }
 
        /* XXX is this the right place? */
@@ -306,7 +306,7 @@ Fetch(struct sess *sp)
                VBE_UpdateHealth(sp, vc, -2);
                VBE_ClosedFd(sp->wrk, vc);
                /* XXX: other cleanup ? */
-               return (1);
+               return (__LINE__);
        }
 
        sp->obj->entered = TIM_real();
@@ -338,7 +338,7 @@ Fetch(struct sess *sp)
                WSL(sp->wrk, SLT_Debug, vc->fd, "Invalid Transfer-Encoding");
                VBE_UpdateHealth(sp, vc, -3);
                VBE_ClosedFd(sp->wrk, vc);
-               return (-1);
+               return (__LINE__);
        } else if (strcmp(http_GetProto(hp), "HTTP/1.1")) {
                switch (http_GetStatus(hp)) {
                        case 200:
@@ -359,7 +359,7 @@ Fetch(struct sess *sp)
                }
                VBE_UpdateHealth(sp, vc, -4);
                VBE_ClosedFd(sp->wrk, vc);
-               return (-1);
+               return (__LINE__);
        }
 
        {
index 73ef557ec22adc0f68cac01184cc539dcdb86d9a..c7d60b1c421581bffb7f9f83e0b4f54529dd39f0 100644 (file)
@@ -598,6 +598,7 @@ http_FilterFields(struct worker *w, int fd, struct http *to, const struct http *
        CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
        CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
        to->nhd = HTTP_HDR_FIRST;
+       to->status = fm->status;
        for (u = HTTP_HDR_FIRST; u < fm->nhd; u++) {
                if (fm->hdf[u] & HDF_FILTER)
                        continue;
index 863f0023db8243b6b09fab1250db7ade4f6e1e27..ce6f8c19a9dd29ae422eaabe1e93b601e9fdcdf1 100644 (file)
@@ -56,6 +56,7 @@ SYN_ErrorPage(struct sess *sp, int status, const char *reason, int ttl)
        double now;
        int fd;
 
+       WSL_Flush(sp->wrk);
        assert(status >= 100 && status <= 999);
        CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
        CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
index 325094f790657d0d360c4ccf041c1ba7efa2233a..908c7a007fec7f624c43490bba450e5051dbe443 100644 (file)
@@ -98,15 +98,11 @@ static const char *default_vcl =
     "\n"
     "sub vcl_hash {\n"
     "    set req.hash += req.url;\n"
-#if 1
-    "    set req.hash += req.http.host;\n"
-#else
     "    if (req.http.host) {\n"
     "        set req.hash += req.http.host;\n"
     "    } else {\n"
-    "        set req.hash += server.ip;\n"     /* XXX: see ticket 137 */
+    "        set req.hash += server.ip;\n"
     "    }\n"
-#endif
     "    hash;\n"
     "}\n"
     "\n"
index 28beeb48227a0eb78e6eaa283b857f06028774e8..1f3c46c336bdc422976ccde2276315d3f7c115f8 100644 (file)
@@ -172,6 +172,7 @@ RFC2616_cache_policy(const struct sess *sp, const struct http *hp)
         * We do not support ranges yet, so 206 is out.
         */
        sp->obj->response = http_GetStatus(hp);
+WSP(sp, SLT_Debug, "resp: %d", sp->obj->response);
        switch (sp->obj->response) {
        case 200: /* OK */
        case 203: /* Non-Authoritative Information */