]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* some optimizations taken from the inflate out filter
authorRuediger Pluem <rpluem@apache.org>
Sat, 29 Jul 2006 13:08:38 +0000 (13:08 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 29 Jul 2006 13:08:38 +0000 (13:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@426795 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_deflate.c

index 1b7b1fe1843a77cf50481a6fe038da733766e04d..6050b3e733a86ddccd6105f4da01b1bf0d84f019 100644 (file)
@@ -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",