Commit 233b3928 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

push busyobj out of V1F fetching

parent e6e95699
...@@ -809,7 +809,7 @@ void VBO_waitstate(struct busyobj *bo, enum busyobj_state_e want); ...@@ -809,7 +809,7 @@ void VBO_waitstate(struct busyobj *bo, enum busyobj_state_e want);
/* cache_http1_fetch.c [V1F] */ /* cache_http1_fetch.c [V1F] */
int V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, struct req *req); int V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, struct req *req);
void V1F_Setup_Fetch(struct busyobj *bo); void V1F_Setup_Fetch(struct vfp_ctx *vfc, ssize_t cl, struct http_conn *htc);
/* cache_http1_fsm.c [HTTP1] */ /* cache_http1_fsm.c [HTTP1] */
typedef int (req_body_iter_f)(struct req *, void *priv, void *ptr, size_t); typedef int (req_body_iter_f)(struct req *, void *priv, void *ptr, size_t);
......
...@@ -556,7 +556,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo) ...@@ -556,7 +556,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
ObjSetFlag(bo->vfc, OF_IMSCAND, 1); ObjSetFlag(bo->vfc, OF_IMSCAND, 1);
if (bo->htc.body_status != BS_NONE) if (bo->htc.body_status != BS_NONE)
V1F_Setup_Fetch(bo); V1F_Setup_Fetch(bo->vfc, bo->content_length, &bo->htc);
/* /*
* Ready to fetch the body * Ready to fetch the body
......
...@@ -153,39 +153,34 @@ static const struct vfp v1f_eof = { ...@@ -153,39 +153,34 @@ static const struct vfp v1f_eof = {
*/ */
void void
V1F_Setup_Fetch(struct busyobj *bo) V1F_Setup_Fetch(struct vfp_ctx *vfc, ssize_t cl, struct http_conn *htc)
{ {
struct http_conn *htc;
struct vfp_entry *vfe; struct vfp_entry *vfe;
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(vfc, VFP_CTX_MAGIC);
htc = &bo->htc;
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
CHECK_OBJ_NOTNULL(bo->vbc, VBC_MAGIC);
switch(htc->body_status) { switch(htc->body_status) {
case BS_EOF: case BS_EOF:
assert(bo->content_length == -1); assert(cl == -1);
vfe = VFP_Push(bo->vfc, &v1f_eof, 0); vfe = VFP_Push(vfc, &v1f_eof, 0);
vfe->priv1 = &bo->htc;
vfe->priv2 = 0; vfe->priv2 = 0;
break; break;
case BS_LENGTH: case BS_LENGTH:
assert(bo->content_length > 0); assert(cl > 0);
vfe = VFP_Push(bo->vfc, &v1f_straight, 0); vfe = VFP_Push(vfc, &v1f_straight, 0);
vfe->priv1 = &bo->htc; vfe->priv2 = cl;
vfe->priv2 = bo->content_length;
break; break;
case BS_CHUNKED: case BS_CHUNKED:
assert(bo->content_length == -1); assert(cl == -1);
vfe = VFP_Push(bo->vfc, &v1f_chunked, 0); vfe = VFP_Push(vfc, &v1f_chunked, 0);
vfe->priv1 = &bo->htc;
vfe->priv2 = -1; vfe->priv2 = -1;
break; break;
default: default:
WRONG("Wrong body_status"); WRONG("Wrong body_status");
break; break;
} }
vfe->priv1 = htc;
return; return;
} }
......
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