From: Ruediger Pluem Date: Sat, 29 Jul 2006 13:08:38 +0000 (+0000) Subject: * some optimizations taken from the inflate out filter X-Git-Tag: 2.3.0~2194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8526b8da4a90b3d8a5a21e408ba70f0e1ac5d936;p=thirdparty%2Fapache%2Fhttpd.git * some optimizations taken from the inflate out filter git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@426795 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_deflate.c b/modules/filters/mod_deflate.c index 1b7b1fe1843..6050b3e733a 100644 --- a/modules/filters/mod_deflate.c +++ b/modules/filters/mod_deflate.c @@ -299,14 +299,16 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, request_rec *r = f->r; deflate_ctx *ctx = f->ctx; int zRC; - deflate_filter_config *c = ap_get_module_config(r->server->module_config, - &deflate_module); + deflate_filter_config *c; /* Do nothing if asked to filter nothing. */ if (APR_BRIGADE_EMPTY(bb)) { return ap_pass_brigade(f->next, bb); } + c = ap_get_module_config(r->server->module_config, + &deflate_module); + /* If we don't have a context, we need to ensure that it is okay to send * the deflated content. If we have a context, that means we've done * this before and we liked it. @@ -447,6 +449,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f, Z_DEFAULT_STRATEGY); if (zRC != Z_OK) { + deflateEnd(&ctx->stream); ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "unable to init Zlib: " "deflateInit2 returned %d: URL %s",