Commit 192e6d06 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Commit the actual fix for #1014 and not just the test-case.

Fixes	#1014
parent b6fcb3de
...@@ -202,20 +202,15 @@ fetch_straight(struct sess *sp, struct http_conn *htc, const char *b) ...@@ -202,20 +202,15 @@ fetch_straight(struct sess *sp, struct http_conn *htc, const char *b)
ssize_t cl; ssize_t cl;
assert(sp->wrk->body_status == BS_LENGTH); assert(sp->wrk->body_status == BS_LENGTH);
cl = fetch_number(b, 10); cl = fetch_number(b, 10);
sp->wrk->vfp->begin(sp, cl > 0 ? cl : 0);
if (cl < 0) { if (cl < 0) {
WSP(sp, SLT_FetchError, "straight length field bogus"); WSP(sp, SLT_FetchError, "straight length field bogus");
return (-1); return (-1);
} } else if (cl == 0)
/*
* XXX: we shouldn't need this if we have cl==0
* XXX: but we must also conditionalize the vfp->end()
*/
sp->wrk->vfp->begin(sp, cl);
if (cl == 0)
return (0); return (0);
i = sp->wrk->vfp->bytes(sp, htc, cl); i = sp->wrk->vfp->bytes(sp, htc, cl);
if (i <= 0) { if (i <= 0) {
WSP(sp, SLT_FetchError, "straight read_error: %d %d (%s)", WSP(sp, SLT_FetchError, "straight read_error: %d %d (%s)",
......
...@@ -600,6 +600,7 @@ vfp_testgzip_begin(struct sess *sp, size_t estimate) ...@@ -600,6 +600,7 @@ vfp_testgzip_begin(struct sess *sp, size_t estimate)
{ {
(void)estimate; (void)estimate;
sp->wrk->vgz_rx = VGZ_NewUngzip(sp, "u F -"); sp->wrk->vgz_rx = VGZ_NewUngzip(sp, "u F -");
CHECK_OBJ_NOTNULL(sp->wrk->vgz_rx, VGZ_MAGIC);
} }
static int __match_proto__() static int __match_proto__()
......
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