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);
/* cache_http1_fetch.c [V1F] */
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] */
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)
ObjSetFlag(bo->vfc, OF_IMSCAND, 1);
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
......
......@@ -153,39 +153,34 @@ static const struct vfp v1f_eof = {
*/
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;
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
htc = &bo->htc;
CHECK_OBJ_NOTNULL(vfc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
CHECK_OBJ_NOTNULL(bo->vbc, VBC_MAGIC);
switch(htc->body_status) {
case BS_EOF:
assert(bo->content_length == -1);
vfe = VFP_Push(bo->vfc, &v1f_eof, 0);
vfe->priv1 = &bo->htc;
assert(cl == -1);
vfe = VFP_Push(vfc, &v1f_eof, 0);
vfe->priv2 = 0;
break;
case BS_LENGTH:
assert(bo->content_length > 0);
vfe = VFP_Push(bo->vfc, &v1f_straight, 0);
vfe->priv1 = &bo->htc;
vfe->priv2 = bo->content_length;
assert(cl > 0);
vfe = VFP_Push(vfc, &v1f_straight, 0);
vfe->priv2 = cl;
break;
case BS_CHUNKED:
assert(bo->content_length == -1);
vfe = VFP_Push(bo->vfc, &v1f_chunked, 0);
vfe->priv1 = &bo->htc;
assert(cl == -1);
vfe = VFP_Push(vfc, &v1f_chunked, 0);
vfe->priv2 = -1;
break;
default:
WRONG("Wrong body_status");
break;
}
vfe->priv1 = htc;
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