Commit 42f2968a authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't pollute bereq.* in vcl_fetch{} with the reply



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3833 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 4890aa39
......@@ -242,7 +242,7 @@ struct bereq {
#define BEREQ_MAGIC 0x3b6d250c
VTAILQ_ENTRY(bereq) list;
struct ws ws[1];
struct http http[1];
struct http http[2];
};
/* Storage -----------------------------------------------------------*/
......
......@@ -163,7 +163,8 @@ VBE_new_bereq(void)
WS_Init(bereq->ws, "bereq", bereq + 1, len);
VSL_stats->n_bereq++;
}
http_Setup(bereq->http, bereq->ws);
http_Setup(&bereq->http[0], bereq->ws);
http_Setup(&bereq->http[1], bereq->ws);
return (bereq);
}
......
......@@ -329,9 +329,12 @@ Fetch(struct sess *sp)
if (sp->obj->objcore != NULL) /* pass has no objcore */
AN(ObjIsBusy(sp->obj));
AN(sp->bereq);
/* Transmit request */
w = sp->wrk;
bereq = sp->bereq;
hp = bereq->http;
hp = &bereq->http[0];
is_head = (strcasecmp(http_GetReq(hp), "head") == 0);
sp->obj->xid = sp->xid;
......@@ -371,6 +374,8 @@ Fetch(struct sess *sp)
/* XXX is this the right place? */
VSL_stats->backend_req++;
/* Receive response */
HTC_Init(htc, bereq->ws, vc->fd);
TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
do {
......@@ -385,6 +390,8 @@ Fetch(struct sess *sp)
return (__LINE__);
}
hp = &bereq->http[1];
if (http_DissectResponse(sp->wrk, htc, hp)) {
VBE_ClosedFd(sp);
/* XXX: other cleanup ? */
......
......@@ -100,7 +100,7 @@ vrt_selecthttp(const struct sess *sp, enum gethdr_e where)
hp = sp->http;
break;
case HDR_BEREQ:
hp = sp->bereq->http;
hp = &sp->bereq->http[0];
break;
case HDR_RESP:
hp = sp->http;
......
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