Commit f07792e7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move bodystatus into struct http_conn

parent 980cce7f
...@@ -244,6 +244,7 @@ struct http_conn { ...@@ -244,6 +244,7 @@ struct http_conn {
struct ws *ws; struct ws *ws;
txt rxbuf; txt rxbuf;
txt pipeline; txt pipeline;
enum body_status body_status;
}; };
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
...@@ -532,7 +533,6 @@ struct busyobj { ...@@ -532,7 +533,6 @@ struct busyobj {
struct exp exp; struct exp exp;
struct http_conn htc; struct http_conn htc;
enum body_status body_status;
struct pool_task fetch_task; struct pool_task fetch_task;
struct vef_priv *vef_priv; struct vef_priv *vef_priv;
......
...@@ -276,7 +276,7 @@ fetch_straight(struct busyobj *bo, struct http_conn *htc, ssize_t cl) ...@@ -276,7 +276,7 @@ fetch_straight(struct busyobj *bo, struct http_conn *htc, ssize_t cl)
{ {
int i; int i;
assert(bo->body_status == BS_LENGTH); assert(htc->body_status == BS_LENGTH);
if (cl < 0) { if (cl < 0) {
return (FetchError(bo, "straight length field bogus")); return (FetchError(bo, "straight length field bogus"));
...@@ -303,7 +303,7 @@ fetch_chunked(struct busyobj *bo, struct http_conn *htc) ...@@ -303,7 +303,7 @@ fetch_chunked(struct busyobj *bo, struct http_conn *htc)
unsigned u; unsigned u;
ssize_t cl; ssize_t cl;
assert(bo->body_status == BS_CHUNKED); assert(htc->body_status == BS_CHUNKED);
do { do {
/* Skip leading whitespace */ /* Skip leading whitespace */
do { do {
...@@ -361,7 +361,7 @@ static void ...@@ -361,7 +361,7 @@ static void
fetch_eof(struct busyobj *bo, struct http_conn *htc) 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) if (VFP_Bytes(bo, htc, SSIZE_MAX) < 0)
(void)FetchError(bo,"eof socket fail"); (void)FetchError(bo,"eof socket fail");
} }
...@@ -561,7 +561,7 @@ FetchBody(struct worker *wrk, void *priv) ...@@ -561,7 +561,7 @@ FetchBody(struct worker *wrk, void *priv)
/* XXX: pick up estimate from objdr ? */ /* XXX: pick up estimate from objdr ? */
cl = 0; cl = 0;
cls = 0; cls = 0;
switch (bo->body_status) { switch (htc->body_status) {
case BS_NONE: case BS_NONE:
mklen = 0; mklen = 0;
break; break;
...@@ -611,7 +611,7 @@ FetchBody(struct worker *wrk, void *priv) ...@@ -611,7 +611,7 @@ FetchBody(struct worker *wrk, void *priv)
bo->vfp = NULL; bo->vfp = NULL;
VSLb(bo->vsl, SLT_Fetch_Body, "%u(%s) cls %d mklen %d", 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); cls, mklen);
http_Teardown(bo->bereq); http_Teardown(bo->bereq);
......
...@@ -216,7 +216,7 @@ pan_busyobj(const struct busyobj *bo) ...@@ -216,7 +216,7 @@ pan_busyobj(const struct busyobj *bo)
if (bo->do_stream) VSB_printf(pan_vsp, " do_stream\n"); if (bo->do_stream) VSB_printf(pan_vsp, " do_stream\n");
if (bo->should_close) VSB_printf(pan_vsp, " should_close\n"); if (bo->should_close) VSB_printf(pan_vsp, " should_close\n");
VSB_printf(pan_vsp, " bodystatus = %d (%s),\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"); VSB_printf(pan_vsp, " },\n");
if (VALID_OBJ(bo->vbc, BACKEND_MAGIC)) if (VALID_OBJ(bo->vbc, BACKEND_MAGIC))
pan_vbc(bo->vbc); pan_vbc(bo->vbc);
......
...@@ -392,7 +392,7 @@ cnt_fetch(struct worker *wrk, struct req *req) ...@@ -392,7 +392,7 @@ cnt_fetch(struct worker *wrk, struct req *req)
* headers are adultered by VCL * headers are adultered by VCL
* NB: Also sets other wrk variables * 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); req->err_code = http_GetStatus(bo->beresp);
...@@ -557,7 +557,7 @@ cnt_fetchbody(struct worker *wrk, struct req *req) ...@@ -557,7 +557,7 @@ cnt_fetchbody(struct worker *wrk, struct req *req)
bo->do_stream = 0; bo->do_stream = 0;
/* No reason to try streaming a non-existing body */ /* 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; bo->do_stream = 0;
l = http_EstimateWS(bo->beresp, l = http_EstimateWS(bo->beresp,
......
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