r3875 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Wed Mar 4 12:28:07 CET 2009
Author: phk
Date: 2009-03-04 12:28:07 +0100 (Wed, 04 Mar 2009)
New Revision: 3875
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_backend.c
trunk/varnish-cache/bin/varnishd/cache_center.c
trunk/varnish-cache/bin/varnishd/cache_esi.c
trunk/varnish-cache/bin/varnishd/cache_fetch.c
trunk/varnish-cache/bin/varnishd/cache_http.c
trunk/varnish-cache/bin/varnishd/cache_pipe.c
trunk/varnish-cache/bin/varnishd/cache_pool.c
trunk/varnish-cache/bin/varnishd/cache_vrt.c
Log:
Move bereq.* to worker.
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2009-03-04 11:28:07 UTC (rev 3875)
@@ -220,6 +220,10 @@
struct ws ws[1];
struct http http[3];
+ struct http *bereq;
+ struct http *beresp1;
+ struct http *beresp;
+ struct http *resp;
};
/* Work Request for worker thread ------------------------------------*/
@@ -244,7 +248,6 @@
#define BEREQ_MAGIC 0x3b6d250c
VTAILQ_ENTRY(bereq) list;
struct ws ws[1];
- struct http bereq[1];
struct http beresp[2];
struct http_conn htc[1];
unsigned cacheable;
Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -65,10 +65,10 @@
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->bereq, BEREQ_MAGIC);
- CHECK_OBJ_NOTNULL(sp->bereq->bereq, HTTP_MAGIC);
+ CHECK_OBJ_NOTNULL(sp->wrk->bereq, HTTP_MAGIC);
CHECK_OBJ_NOTNULL(sp->vbe, VBE_CONN_MAGIC);
CHECK_OBJ_NOTNULL(sp->vbe->backend, BACKEND_MAGIC);
- http_PrintfHeader(sp->wrk, sp->fd, sp->bereq->bereq,
+ http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->bereq,
"Host: %s", sp->vbe->backend->hosthdr);
}
@@ -163,7 +163,6 @@
WS_Init(bereq->ws, "bereq", bereq + 1, len);
sp->wrk->stats->n_bereq++;
}
- http_Setup(bereq->bereq, bereq->ws);
http_Setup(bereq->beresp, bereq->ws);
return (bereq);
}
Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -339,6 +339,7 @@
assert(sp->handling == VCL_RET_DELIVER);
sp->err_code = 0;
sp->err_reason = NULL;
+ sp->wrk->bereq = NULL;
sp->step = STP_DELIVER;
return (0);
}
@@ -536,6 +537,7 @@
HSH_Unbusy(sp);
}
sp->acct_req.fetch++;
+ sp->wrk->bereq = NULL;
sp->step = STP_DELIVER;
return (0);
}
@@ -622,6 +624,7 @@
if (sp->handling == VCL_RET_DELIVER) {
/* Dispose of any body part of the request */
FetchReqBody(sp);
+ sp->wrk->bereq = NULL;
sp->step = STP_DELIVER;
return (0);
}
@@ -771,6 +774,7 @@
AZ(sp->obj);
AN(sp->objcore);
AN(sp->objhead);
+ sp->wrk->bereq = &sp->wrk->http[0];
http_FilterHeader(sp, HTTPH_R_FETCH);
VCL_miss_method(sp);
switch(sp->handling) {
@@ -836,6 +840,7 @@
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
AZ(sp->obj);
+ sp->wrk->bereq = &sp->wrk->http[0];
http_FilterHeader(sp, HTTPH_R_PASS);
VCL_pass_method(sp);
@@ -884,6 +889,7 @@
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
sp->acct_req.pipe++;
+ sp->wrk->bereq = &sp->wrk->http[0];
http_FilterHeader(sp, HTTPH_R_PIPE);
VCL_pipe_method(sp);
Modified: trunk/varnish-cache/bin/varnishd/cache_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_esi.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -398,8 +398,8 @@
*/
CHECK_OBJ_NOTNULL(ew->sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(ew->sp->bereq, BEREQ_MAGIC);
- CHECK_OBJ_NOTNULL(ew->sp->bereq->bereq, HTTP_MAGIC);
- tag = ew->sp->bereq->bereq->hd[HTTP_HDR_URL];
+ CHECK_OBJ_NOTNULL(ew->sp->wrk->bereq, HTTP_MAGIC);
+ tag = ew->sp->wrk->bereq->hd[HTTP_HDR_URL];
/* Use the objects WS to store the result */
CHECK_OBJ_NOTNULL(ew->sp->obj, OBJECT_MAGIC);
Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -333,7 +333,7 @@
w = sp->wrk;
bereq = sp->bereq;
- hp = bereq->bereq;
+ hp = sp->wrk->bereq;
VBE_GetFd(sp);
if (sp->vbe == NULL)
@@ -421,7 +421,7 @@
vc = sp->vbe;
- is_head = (strcasecmp(http_GetReq(sp->bereq->bereq), "head") == 0);
+ is_head = (strcasecmp(http_GetReq(sp->wrk->bereq), "head") == 0);
/* Determine if we have a body or not */
cls = 0;
Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -637,7 +637,7 @@
AZ(sp->bereq);
bereq = VBE_new_bereq(sp);
AN(bereq);
- hp = bereq->bereq;
+ hp = sp->wrk->bereq;
hp->logtag = HTTP_Tx;
http_copyreq(hp, sp->http, how);
Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -84,7 +84,7 @@
TCP_blocking(vc->fd);
WRW_Reserve(w, &vc->fd);
- sp->acct_req.hdrbytes += http_Write(w, bereq->bereq, 0);
+ sp->acct_req.hdrbytes += http_Write(w, sp->wrk->bereq, 0);
if (sp->htc->pipeline.b != NULL)
sp->acct_req.bodybytes +=
Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -347,6 +347,10 @@
http_Setup(&w->http[0], w->ws);
http_Setup(&w->http[1], w->ws);
http_Setup(&w->http[2], w->ws);
+ w->bereq = NULL;
+ w->beresp1 = NULL;
+ w->beresp = NULL;
+ w->resp = NULL;
w->wrq->func(w, w->wrq->priv);
AZ(w->wfd);
assert(w->wlp == w->wlb);
Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-03-04 10:55:28 UTC (rev 3874)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2009-03-04 11:28:07 UTC (rev 3875)
@@ -101,7 +101,7 @@
hp = sp->http;
break;
case HDR_BEREQ:
- hp = sp->bereq->bereq;
+ hp = sp->wrk->bereq;
break;
case HDR_BERESP:
hp = sp->bereq->beresp;
@@ -244,9 +244,9 @@
VRT_DO_HDR(req, request, sp->http, HTTP_HDR_REQ)
VRT_DO_HDR(req, url, sp->http, HTTP_HDR_URL)
VRT_DO_HDR(req, proto, sp->http, HTTP_HDR_PROTO)
-VRT_DO_HDR(bereq, request, sp->bereq->bereq, HTTP_HDR_REQ)
-VRT_DO_HDR(bereq, url, sp->bereq->bereq, HTTP_HDR_URL)
-VRT_DO_HDR(bereq, proto, sp->bereq->bereq, HTTP_HDR_PROTO)
+VRT_DO_HDR(bereq, request, sp->wrk->bereq, HTTP_HDR_REQ)
+VRT_DO_HDR(bereq, url, sp->wrk->bereq, HTTP_HDR_URL)
+VRT_DO_HDR(bereq, proto, sp->wrk->bereq, HTTP_HDR_PROTO)
VRT_DO_HDR(obj, proto, sp->obj->http, HTTP_HDR_PROTO)
VRT_DO_HDR(obj, response, sp->obj->http, HTTP_HDR_RESPONSE)
VRT_DO_HDR(resp, proto, sp->http, HTTP_HDR_PROTO)
More information about the varnish-commit
mailing list