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

Don't assert if we fail to get storage in VFP_Begin()

Fixes	#1100
parent b399a62f
......@@ -76,13 +76,16 @@ FetchError(struct busyobj *bo, const char *error)
* VFP method functions
*/
static void
static int
VFP_Begin(struct busyobj *bo, size_t estimate)
{
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
AN(bo->vfp);
bo->vfp->begin(bo, estimate);
if (bo->fetch_failed)
return (-1);
return (0);
}
static int
......@@ -146,7 +149,6 @@ vfp_nop_bytes(struct busyobj *bo, struct http_conn *htc, ssize_t bytes)
ssize_t l, wl;
struct storage *st;
AZ(bo->fetch_failed);
while (bytes > 0) {
st = FetchStorage(bo, 0);
if (st == NULL)
......@@ -575,22 +577,25 @@ FetchBody(struct worker *wrk, struct busyobj *bo)
break;
case BS_LENGTH:
cl = fetch_number(bo->h_content_length, 10);
VFP_Begin(bo, cl > 0 ? cl : 0);
cls = fetch_straight(bo, htc, cl);
cls = VFP_Begin(bo, cl > 0 ? cl : 0);
if (!cls)
cls = fetch_straight(bo, htc, cl);
mklen = 1;
if (VFP_End(bo))
cls = -1;
break;
case BS_CHUNKED:
VFP_Begin(bo, cl);
cls = fetch_chunked(bo, htc);
cls = VFP_Begin(bo, cl);
if (!cls)
cls = fetch_chunked(bo, htc);
mklen = 1;
if (VFP_End(bo))
cls = -1;
break;
case BS_EOF:
VFP_Begin(bo, cl);
cls = fetch_eof(bo, htc);
cls = VFP_Begin(bo, cl);
if (!cls)
cls = fetch_eof(bo, htc);
mklen = 1;
if (VFP_End(bo))
cls = -1;
......
......@@ -213,7 +213,8 @@ pan_busyobj(const struct busyobj *bo)
if (bo->do_esi) VSB_printf(pan_vsp, " do_esi\n");
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,\n", bo->body_status);
VSB_printf(pan_vsp, " bodystatus = %d (%s),\n",
bo->body_status, body_status(bo->body_status));
VSB_printf(pan_vsp, " },\n");
if (VALID_OBJ(bo->vbc, BACKEND_MAGIC))
pan_vbc(bo->vbc);
......
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