jerenkrantz 2002/06/05 02:08:02
Modified: modules/filters mod_deflate.c
Log:
Oops.
When deflating: only reset ctx->stream buffers when the ctx was NULL.
When inflating: remember to clear the ctx->bb after we're done with it.
Revision Changes Path
1.16 +5 -7 httpd-2.0/modules/filters/mod_deflate.c
Index: mod_deflate.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- mod_deflate.c 30 May 2002 22:06:01 -0000 1.15
+++ mod_deflate.c 5 Jun 2002 09:08:02 -0000 1.16
@@ -365,12 +365,12 @@
}
apr_table_setn(r->headers_out, "Vary", "Accept-Encoding");
apr_table_unset(r->headers_out, "Content-Length");
+
+ /* initialize deflate output buffer */
+ ctx->stream.next_out = ctx->buffer;
+ ctx->stream.avail_out = c->bufferSize;
}
- /* initialize deflate output buffer */
- ctx->stream.next_out = ctx->buffer;
- ctx->stream.avail_out = c->bufferSize;
-
APR_BRIGADE_FOREACH(e, bb) {
const char *data;
apr_bucket *b;
@@ -713,13 +713,13 @@
}
inflateEnd(&ctx->stream);
- apr_brigade_cleanup(ctx->bb);
eos = apr_bucket_eos_create(f->c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, eos);
break;
}
}
+ apr_brigade_cleanup(ctx->bb);
}
if (!APR_BRIGADE_EMPTY(ctx->proc_bb)) {
@@ -732,8 +732,6 @@
APR_BRIGADE_CONCAT(bb, ctx->proc_bb);
APR_BRIGADE_CONCAT(ctx->proc_bb, newbb);
}
-
-
return APR_SUCCESS;
}
|