From: phk Date: Mon, 1 Oct 2007 12:25:37 +0000 (+0000) Subject: Remember to move numeric status when we filter one http to another. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f75de669279549385469322a9534ee616bf53ddc;p=varnish Remember to move numeric status when we filter one http to another. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2075 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 58925901..365ecc30 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -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) { diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 1f6819f0..e9b6e45f 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -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__); } { diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 73ef557e..c7d60b1c 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -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; diff --git a/varnish-cache/bin/varnishd/cache_synthetic.c b/varnish-cache/bin/varnishd/cache_synthetic.c index 863f0023..ce6f8c19 100644 --- a/varnish-cache/bin/varnishd/cache_synthetic.c +++ b/varnish-cache/bin/varnishd/cache_synthetic.c @@ -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); diff --git a/varnish-cache/bin/varnishd/mgt_vcc.c b/varnish-cache/bin/varnishd/mgt_vcc.c index 325094f7..908c7a00 100644 --- a/varnish-cache/bin/varnishd/mgt_vcc.c +++ b/varnish-cache/bin/varnishd/mgt_vcc.c @@ -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" diff --git a/varnish-cache/bin/varnishd/rfc2616.c b/varnish-cache/bin/varnishd/rfc2616.c index 28beeb48..1f3c46c3 100644 --- a/varnish-cache/bin/varnishd/rfc2616.c +++ b/varnish-cache/bin/varnishd/rfc2616.c @@ -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 */