httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r423940 - /httpd/httpd/trunk/modules/filters/mod_deflate.c
Date Thu, 20 Jul 2006 14:11:49 GMT
Author: rpluem
Date: Thu Jul 20 07:11:48 2006
New Revision: 423940

URL: http://svn.apache.org/viewvc?rev=423940&view=rev
Log:
* In preparation of the changes of the inflate out filter:
  - rename flush_zlib_buffer to flush_libz_buffer (this name seems
    better)
  - add a parameter to tell flush_libz_buffer whether it should
    deflate or inflate as this function should be also used for the
    inflate out filter.

Modified:
    httpd/httpd/trunk/modules/filters/mod_deflate.c

Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?rev=423940&r1=423939&r2=423940&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c Thu Jul 20 07:11:48 2006
@@ -214,9 +214,9 @@
     apr_bucket_brigade *bb, *proc_bb;
 } deflate_ctx;
 
-static int flush_zlib_buffer(deflate_ctx *ctx, deflate_filter_config *c,
+static int flush_libz_buffer(deflate_ctx *ctx, deflate_filter_config *c,
                              struct apr_bucket_alloc_t *bucket_alloc,
-                             int flush)
+                             int (*libz_func)(z_streamp, int), int flush)
 {
     int zRC;
     int done = 0;
@@ -238,7 +238,7 @@
          if (done)
              break;
 
-         zRC = deflate(&ctx->stream, flush);
+         zRC = libz_func(&ctx->stream, flush);
 
          if (deflate_len == 0 && zRC == Z_BUF_ERROR)
              zRC = Z_OK;
@@ -450,7 +450,7 @@
 
             ctx->stream.avail_in = 0; /* should be zero already anyway */
             /* flush the remaining data from the zlib buffers */
-            flush_zlib_buffer(ctx, c, f->c->bucket_alloc, Z_FINISH);
+            flush_libz_buffer(ctx, c, f->c->bucket_alloc, deflate, Z_FINISH);
 
             buf = apr_palloc(r->pool, 8);
             putLong((unsigned char *)&buf[0], ctx->crc);
@@ -505,7 +505,8 @@
             apr_status_t rv;
 
             /* flush the remaining data from the zlib buffers */
-            zRC = flush_zlib_buffer(ctx, c, f->c->bucket_alloc, Z_SYNC_FLUSH);
+            zRC = flush_libz_buffer(ctx, c, f->c->bucket_alloc, deflate,
+                                    Z_SYNC_FLUSH);
             if (zRC != Z_OK) {
                 /*
                  * Things screwed up. It is likely that we never return into



Mime
View raw message