if (rv != APR_SUCCESS) {
return rv;
}
-
+
len = 10;
rv = apr_brigade_flatten(ctx->bb, deflate_hdr, &len);
if (rv != APR_SUCCESS) {
if (zRC != Z_OK) {
f->ctx = NULL;
+ inflateEnd(&ctx->stream);
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"unable to init Zlib: "
"inflateInit2 returned %d: URL %s",
rv = ap_get_brigade(f->next, ctx->bb, mode, block, readbytes);
if (rv != APR_SUCCESS) {
+ /* What about APR_EAGAIN errors? */
+ inflateEnd(&ctx->stream);
return rv;
}
/* If we actually see the EOS, that means we screwed up! */
if (APR_BUCKET_IS_EOS(bkt)) {
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
apr_bucket *tmp_heap;
zRC = inflate(&(ctx->stream), Z_SYNC_FLUSH);
if (zRC != Z_OK) {
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
}
if (zRC != Z_OK) {
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
}
unsigned long compCRC, compLen;
compCRC = getLong(ctx->stream.next_in);
if (ctx->crc != compCRC) {
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
ctx->stream.next_in += 4;
compLen = getLong(ctx->stream.next_in);
if (ctx->stream.total_out != compLen) {
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
}
else {
/* FIXME: We need to grab the 8 verification bytes
* from the wire! */
+ inflateEnd(&ctx->stream);
return APR_EGENERAL;
}
inflateEnd(&ctx->stream);
-
+
eos = apr_bucket_eos_create(f->c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, eos);
break;