if (APR_BUCKET_IS_FLUSH(bkt)) {
apr_bucket *tmp_b;
+
+ ctx->inflate_total += ctx->stream.avail_out;
zRC = inflate(&(ctx->stream), Z_SYNC_FLUSH);
+ ctx->inflate_total -= ctx->stream.avail_out;
if (zRC != Z_OK) {
inflateEnd(&ctx->stream);
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01391)
ctx->stream.msg);
return APR_EGENERAL;
}
-
- ctx->stream.next_out = ctx->buffer;
- len = c->bufferSize - ctx->stream.avail_out;
- ctx->inflate_total += len;
if (inflate_limit && ctx->inflate_total > inflate_limit) {
inflateEnd(&ctx->stream);
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(02647)
return APR_EINVAL;
}
+ len = c->bufferSize - ctx->stream.avail_out;
ctx->crc = crc32(ctx->crc, (const Bytef *)ctx->buffer, len);
tmp_b = apr_bucket_heap_create((char *)ctx->buffer, len,
NULL, f->c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, tmp_b);
+
+ ctx->stream.next_out = ctx->buffer;
ctx->stream.avail_out = c->bufferSize;
/* Flush everything so far in the returning brigade, but continue
ctx->stream.avail_out = c->bufferSize;
}
- len = ctx->stream.avail_out;
+ ctx->inflate_total += ctx->stream.avail_out;
zRC = inflate(&ctx->stream, Z_NO_FLUSH);
-
+ ctx->inflate_total -= ctx->stream.avail_out;
if (zRC != Z_OK && zRC != Z_STREAM_END) {
inflateEnd(&ctx->stream);
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01392)
return APR_EGENERAL;
}
- ctx->inflate_total += len - ctx->stream.avail_out;
if (inflate_limit && ctx->inflate_total > inflate_limit) {
inflateEnd(&ctx->stream);
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(02648)