[master] f07792e Move bodystatus into struct http_conn
Poul-Henning Kamp
phk at varnish-cache.org
Wed Jan 23 15:21:02 CET 2013
commit f07792e7cc484effd86df838705435499e583a00
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Jan 23 14:20:47 2013 +0000
Move bodystatus into struct http_conn
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index f77837a..e75535b 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -244,6 +244,7 @@ struct http_conn {
struct ws *ws;
txt rxbuf;
txt pipeline;
+ enum body_status body_status;
};
/*--------------------------------------------------------------------*/
@@ -532,7 +533,6 @@ struct busyobj {
struct exp exp;
struct http_conn htc;
- enum body_status body_status;
struct pool_task fetch_task;
struct vef_priv *vef_priv;
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 0d539f7..ea110bb 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -276,7 +276,7 @@ fetch_straight(struct busyobj *bo, struct http_conn *htc, ssize_t cl)
{
int i;
- assert(bo->body_status == BS_LENGTH);
+ assert(htc->body_status == BS_LENGTH);
if (cl < 0) {
return (FetchError(bo, "straight length field bogus"));
@@ -303,7 +303,7 @@ fetch_chunked(struct busyobj *bo, struct http_conn *htc)
unsigned u;
ssize_t cl;
- assert(bo->body_status == BS_CHUNKED);
+ assert(htc->body_status == BS_CHUNKED);
do {
/* Skip leading whitespace */
do {
@@ -361,7 +361,7 @@ static void
fetch_eof(struct busyobj *bo, struct http_conn *htc)
{
- assert(bo->body_status == BS_EOF);
+ assert(htc->body_status == BS_EOF);
if (VFP_Bytes(bo, htc, SSIZE_MAX) < 0)
(void)FetchError(bo,"eof socket fail");
}
@@ -561,7 +561,7 @@ FetchBody(struct worker *wrk, void *priv)
/* XXX: pick up estimate from objdr ? */
cl = 0;
cls = 0;
- switch (bo->body_status) {
+ switch (htc->body_status) {
case BS_NONE:
mklen = 0;
break;
@@ -611,7 +611,7 @@ FetchBody(struct worker *wrk, void *priv)
bo->vfp = NULL;
VSLb(bo->vsl, SLT_Fetch_Body, "%u(%s) cls %d mklen %d",
- bo->body_status, body_status(bo->body_status),
+ htc->body_status, body_status(htc->body_status),
cls, mklen);
http_Teardown(bo->bereq);
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index cbb258b..60f30f4 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -216,7 +216,7 @@ pan_busyobj(const struct busyobj *bo)
if (bo->do_stream) VSB_printf(pan_vsp, " do_stream\n");
if (bo->should_close) VSB_printf(pan_vsp, " should_close\n");
VSB_printf(pan_vsp, " bodystatus = %d (%s),\n",
- bo->body_status, body_status(bo->body_status));
+ bo->htc.body_status, body_status(bo->htc.body_status));
VSB_printf(pan_vsp, " },\n");
if (VALID_OBJ(bo->vbc, BACKEND_MAGIC))
pan_vbc(bo->vbc);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 2bb15cd..3a15f58 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -392,7 +392,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
* headers are adultered by VCL
* NB: Also sets other wrk variables
*/
- bo->body_status = RFC2616_Body(bo, &wrk->stats);
+ bo->htc.body_status = RFC2616_Body(bo, &wrk->stats);
req->err_code = http_GetStatus(bo->beresp);
@@ -557,7 +557,7 @@ cnt_fetchbody(struct worker *wrk, struct req *req)
bo->do_stream = 0;
/* No reason to try streaming a non-existing body */
- if (bo->body_status == BS_NONE)
+ if (bo->htc.body_status == BS_NONE)
bo->do_stream = 0;
l = http_EstimateWS(bo->beresp,
More information about the varnish-commit
mailing list