Commit f94e1445 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remember to move numeric status when we filter one http to another.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2075 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 63ffc8ad
......@@ -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) {
......
......@@ -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__);
}
{
......
......@@ -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;
......
......@@ -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);
......
......@@ -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"
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment