Commit 44109ac5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Be much more BOFH about bereq, more asserts, free them where they

obviously should be freed.

This could fix 421 or make it much worse, but give us more info.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3530 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2221ffa3
......@@ -155,6 +155,8 @@ cnt_deliver(struct sess *sp)
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
AZ(sp->bereq);
sp->t_resp = TIM_real();
if (sp->obj->objhead != NULL) {
sp->obj->last_use = sp->t_resp; /* XXX: locking ? */
......@@ -301,6 +303,7 @@ cnt_error(struct sess *sp)
char date[40];
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AZ(sp->bereq);
/* We always close when we take this path */
sp->doclose = "error";
......@@ -663,6 +666,7 @@ cnt_miss(struct sess *sp)
sp->step = STP_FETCH;
return (0);
case VCL_RET_RESTART:
VBE_free_bereq(&sp->bereq);
INCOMPL();
default:
WRONG("Illegal action in vcl_miss{}");
......@@ -713,6 +717,7 @@ cnt_pass(struct sess *sp)
VCL_pass_method(sp);
if (sp->handling == VCL_RET_ERROR) {
VBE_free_bereq(&sp->bereq);
sp->step = STP_ERROR;
return (0);
}
......@@ -769,6 +774,7 @@ cnt_pipe(struct sess *sp)
assert(sp->handling == VCL_RET_PIPE);
PipeSession(sp);
AZ(sp->bereq);
AZ(sp->wrk->wfd);
sp->step = STP_DONE;
return (0);
......
......@@ -324,6 +324,7 @@ Fetch(struct sess *sp)
CHECK_OBJ_NOTNULL(sp->bereq, BEREQ_MAGIC);
AN(sp->director);
AN(sp->obj->busy);
AN(sp->bereq);
w = sp->wrk;
bereq = sp->bereq;
hp = bereq->http;
......
......@@ -634,6 +634,7 @@ http_FilterHeader(struct sess *sp, unsigned how)
struct bereq *bereq;
struct http *hp;
AZ(sp->bereq);
bereq = VBE_new_bereq();
AN(bereq);
hp = bereq->http;
......
......@@ -90,14 +90,15 @@ PipeSession(struct sess *sp)
sp->acct_req.bodybytes +=
WRW_Write(w, sp->htc->pipeline.b, Tlen(sp->htc->pipeline));
if (WRW_FlushRelease(w)) {
i = WRW_FlushRelease(w);
VBE_free_bereq(&bereq);
if (i) {
vca_close_session(sp, "pipe");
VBE_ClosedFd(sp);
return;
}
VBE_free_bereq(&bereq);
sp->t_resp = TIM_real();
memset(fds, 0, sizeof fds);
......
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