[master] 026e9ed Explictly tell V1L which workspace to use
Poul-Henning Kamp
phk at FreeBSD.org
Mon Oct 27 11:33:59 CET 2014
commit 026e9ede4c396107e61d91a11ba37ef9bf4f9136
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Oct 27 10:33:42 2014 +0000
Explictly tell V1L which workspace to use
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index e058fed..5dc39c0 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -951,7 +951,7 @@ void Pool_PurgeStat(unsigned nobj);
#define V1L_IsReleased(w) ((w)->v1l == NULL)
void V1L_Chunked(const struct worker *w);
void V1L_EndChunk(const struct worker *w);
-void V1L_Reserve(struct worker *w, int *fd, struct vsl_log *, double t0);
+void V1L_Reserve(struct worker *, struct ws *, int *fd, struct vsl_log *, double t0);
unsigned V1L_Flush(const struct worker *w);
unsigned V1L_FlushRelease(struct worker *w);
unsigned V1L_Write(const struct worker *w, const void *ptr, int len);
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 9eb10e3..5d4588d 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -162,7 +162,8 @@ ved_include(struct req *preq, const char *src, const char *host)
/* Reset the workspace */
WS_Reset(wrk->aws, wrk_ws_wm); /* XXX ? */
- V1L_Reserve(preq->wrk, &preq->sp->fd, preq->vsl, preq->t_prev);
+ V1L_Reserve(preq->wrk, preq->wrk->aws, &preq->sp->fd, preq->vsl,
+ preq->t_prev);
if (preq->res_mode & RES_CHUNKED)
V1L_Chunked(preq->wrk);
diff --git a/bin/varnishd/http1/cache_http1_deliver.c b/bin/varnishd/http1/cache_http1_deliver.c
index 4122672..9523a2e 100644
--- a/bin/varnishd/http1/cache_http1_deliver.c
+++ b/bin/varnishd/http1/cache_http1_deliver.c
@@ -326,7 +326,8 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
v1d_dorange(req, bo, r);
}
- V1L_Reserve(req->wrk, &req->sp->fd, req->vsl, req->t_prev);
+ V1L_Reserve(req->wrk, req->wrk->aws, &req->sp->fd, req->vsl,
+ req->t_prev);
/*
* Send HTTP protocol header, unless interior ESI object
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 3124812..58175b4 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -111,7 +111,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo)
}
(void)VTCP_blocking(vc->fd); /* XXX: we should timeout instead */
- V1L_Reserve(wrk, &vc->fd, bo->vsl, bo->t_prev);
+ V1L_Reserve(wrk, wrk->aws, &vc->fd, bo->vsl, bo->t_prev);
bo->acct.bereq_hdrbytes = HTTP1_Write(wrk, hp, HTTP1_Req);
/* Deal with any message-body the request might (still) have */
diff --git a/bin/varnishd/http1/cache_http1_line.c b/bin/varnishd/http1/cache_http1_line.c
index a2781d1..3254691 100644
--- a/bin/varnishd/http1/cache_http1_line.c
+++ b/bin/varnishd/http1/cache_http1_line.c
@@ -59,29 +59,39 @@ struct v1l {
double t0;
struct vsl_log *vsl;
ssize_t cnt; /* Flushed byte count */
+ struct ws *ws;
+ void *res;
};
/*--------------------------------------------------------------------
*/
void
-V1L_Reserve(struct worker *wrk, int *fd, struct vsl_log *vsl, double t0)
+V1L_Reserve(struct worker *wrk, struct ws *ws, int *fd, struct vsl_log *vsl,
+ double t0)
{
struct v1l *v1l;
unsigned u;
+ void *res;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
AZ(wrk->v1l);
- v1l = WS_Alloc(wrk->aws, sizeof *v1l);
+
+ res = WS_Snapshot(ws);
+ v1l = WS_Alloc(ws, sizeof *v1l);
AN(v1l);
INIT_OBJ(v1l, V1L_MAGIC);
- u = WS_Reserve(wrk->aws, 0);
+
+ v1l->ws = ws;
+ v1l->res = res;
+
+ u = WS_Reserve(ws, 0);
u = PRNDDN(u);
u /= sizeof(struct iovec);
if (u > IOV_MAX)
u = IOV_MAX;
AN(u);
- v1l->iov = (void*)PRNDUP(wrk->aws->f);
+ v1l->iov = (void*)PRNDUP(ws->f);
v1l->siov = u;
v1l->ciov = u;
v1l->werr = 0;
@@ -104,8 +114,8 @@ V1L_FlushRelease(struct worker *wrk)
v1l = wrk->v1l;
wrk->v1l = NULL;
CHECK_OBJ_NOTNULL(v1l, V1L_MAGIC);
- WS_Release(wrk->aws, 0);
- WS_Reset(wrk->aws, NULL);
+ WS_Release(v1l->ws, 0);
+ WS_Reset(v1l->ws, v1l->res);
return (u);
}
diff --git a/bin/varnishd/http1/cache_http1_pipe.c b/bin/varnishd/http1/cache_http1_pipe.c
index 87b7256..84b45a0 100644
--- a/bin/varnishd/http1/cache_http1_pipe.c
+++ b/bin/varnishd/http1/cache_http1_pipe.c
@@ -123,7 +123,7 @@ V1P_Process(struct req *req, struct busyobj *bo)
bo->director_state = DIR_S_BODY;
(void)VTCP_blocking(fd);
- V1L_Reserve(wrk, &fd, bo->vsl, req->t_req);
+ V1L_Reserve(wrk, wrk->aws, &fd, bo->vsl, req->t_req);
acct_pipe.bereq += HTTP1_Write(wrk, bo->bereq, HTTP1_Req);
if (req->htc->pipeline_b != NULL)
More information about the varnish-commit
mailing list