You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/04/26 21:21:12 UTC

[trafficserver] branch master updated: Renames gzip plugin to compress

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 72ade77  Renames gzip plugin to compress
72ade77 is described below

commit 72ade7791838e90a193185098039629f203d3f30
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon Apr 2 18:26:39 2018 -0700

    Renames gzip plugin to compress
    
    Removes "disallow" pattern support
    
    Addresses issue #1645
---
 .../plugins/{gzip.en.rst => compress.en.rst}       | 35 +++++--------
 doc/admin-guide/plugins/index.en.rst               |  2 +-
 plugins/Makefile.am                                |  2 +-
 plugins/{gzip => compress}/Makefile.inc            |  8 +--
 plugins/{gzip => compress}/README                  | 26 ++++------
 plugins/{gzip/gzip.cc => compress/compress.cc}     | 58 ++++++++++------------
 plugins/{gzip => compress}/configuration.cc        | 25 +---------
 plugins/{gzip => compress}/configuration.h         |  9 +---
 plugins/{gzip => compress}/debug_macros.h          |  4 +-
 plugins/{gzip => compress}/misc.cc                 |  6 +--
 plugins/{gzip => compress}/misc.h                  |  4 +-
 .../sample.compress.config}                        | 15 +++---
 12 files changed, 73 insertions(+), 121 deletions(-)

diff --git a/doc/admin-guide/plugins/gzip.en.rst b/doc/admin-guide/plugins/compress.en.rst
similarity index 89%
rename from doc/admin-guide/plugins/gzip.en.rst
rename to doc/admin-guide/plugins/compress.en.rst
index 42750e2..29f6b2a 100644
--- a/doc/admin-guide/plugins/gzip.en.rst
+++ b/doc/admin-guide/plugins/compress.en.rst
@@ -17,9 +17,9 @@
 
 .. include:: ../../common.defs
 
-.. _admin-plugins-gzip:
+.. _admin-plugins-compress:
 
-GZip Plugin
+Compress Plugin
 ***********
 
 This plugin adds compression and decompression options to both origin and cache
@@ -60,7 +60,7 @@ This plugin can be used as either global plugin or remap plugin.
 It can be enabled globally for |TS| by adding the following to your
 :file:`plugin.config`::
 
-    gzip.so
+    compress.so
 
 With no further options, this will enable the following default behavior:
 
@@ -74,17 +74,17 @@ With no further options, this will enable the following default behavior:
 
 -  No URLs are disallowed from compression.
 
--  Disable flush (flush gzipped content to client).
+-  Disable flush (flush compressed content to client).
 
 Alternatively, a configuration may be specified (shown here using the sample
 configuration provided with the plugin's source)::
 
-    gzip.so <path-to-plugin>/sample.gzip.config
+    compress.so <path-to-plugin>/sample.compress.config
 
 This can be used as remap plugin by pointing to config file in remap rule
 :file:`remap.config`:: (relative to the ts:cv:`proxy.config.config_dir`)
 
-    @plugin=gzip.so @pparam=sample.gzip.config
+    @plugin=compress.so @pparam=sample.compress.config
 
 The following sections detail the options you may specify in the plugin's
 configuration file. Options may be used globally, or may be specified on a
@@ -108,15 +108,6 @@ Provides a wildcard to match against content types, determining which are to be
 considered compressible. This defaults to ``text/*``. Takes one Content-Type
 per line.
 
-disallow
---------
-
-Provides a wildcard pattern which will be applied to request URLs. Any which
-match the pattern will be considered incompressible, and only deflated versions
-of the objects will be cached and returned to clients. This may be useful for
-objects which already have their own compression built-in, to avoid the expense
-of multiple rounds of compression for trivial gains.
-
 allow
 --------
 
@@ -182,7 +173,7 @@ might create a configuration with the following options::
     [www.example.com]
     cache false
     remove-accept-encoding true
-    disallow /notthis/*.js
+    allow !/notthis/*.js
     allow /this/*.js
     flush true
 
@@ -200,23 +191,23 @@ might create a configuration with the following options::
     compressible-content-type text/*
     compressible-content-type application/json
     flush true
-    supported-algorithms br, gzip
+    supported-algorithms br,gzip
 
     # This origin does it all
     [bar.example.com]
     enabled false
 
-Assuming the above options are in a file at ``/etc/trafficserver/gzip.config``
+Assuming the above options are in a file at ``/etc/trafficserver/compress.config``
 the plugin would be enabled for |TS| in :file:`plugin.config` as::
 
-    gzip.so /etc/trafficserver/gzip.config
+    compress.so /etc/trafficserver/compress.config
 
-Alternatively, the gzip plugin can be used as a remap plugin: ::
+Alternatively, the compress plugin can be used as a remap plugin: ::
 
   map http://www.example.com http://origin.example.com \
-    @plugin=gzip.so @pparam=gzip.config
+    @plugin=compress.so @pparam=compress.config
 
-    $ cat /etc/trafficserver/gzip.config
+    $ cat /etc/trafficserver/compress.config
     enabled true
     cache true
     compressible-content-type *xml
diff --git a/doc/admin-guide/plugins/index.en.rst b/doc/admin-guide/plugins/index.en.rst
index 9e2b171..bc1c4ec 100644
--- a/doc/admin-guide/plugins/index.en.rst
+++ b/doc/admin-guide/plugins/index.en.rst
@@ -51,7 +51,7 @@ Plugins that are considered stable are installed by default in |TS| releases.
    Combo Handler <combo_handler.en>
    Configuration Remap <conf_remap.en>
    ESI <esi.en>
-   GZip <gzip.en>
+   Compress <compress.en>
    Generator <generator.en>
    Header Rewrite <header_rewrite.en>
    Health Checks <healthchecks.en>
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 71d7153..5c08e8e 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -32,7 +32,7 @@ include background_fetch/Makefile.inc
 include conf_remap/Makefile.inc
 include esi/Makefile.inc
 include generator/Makefile.inc
-include gzip/Makefile.inc
+include compress/Makefile.inc
 include header_rewrite/Makefile.inc
 include healthchecks/Makefile.inc
 include libloader/Makefile.inc
diff --git a/plugins/gzip/Makefile.inc b/plugins/compress/Makefile.inc
similarity index 78%
rename from plugins/gzip/Makefile.inc
rename to plugins/compress/Makefile.inc
index 019e37f..ca0abd8 100644
--- a/plugins/gzip/Makefile.inc
+++ b/plugins/compress/Makefile.inc
@@ -14,10 +14,10 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglib_LTLIBRARIES += gzip/gzip.la
-gzip_gzip_la_SOURCES = gzip/gzip.cc gzip/configuration.cc gzip/misc.cc
+pkglib_LTLIBRARIES += compress/compress.la
+compress_compress_la_SOURCES = compress/compress.cc compress/configuration.cc compress/misc.cc
 
-gzip_gzip_la_LDFLAGS = \
+compress_compress_la_LDFLAGS = \
   $(AM_LDFLAGS) $(LIB_BROTLIENC)
 
-gzip_gzip_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_BROTLIENC)
+compress_compress_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_BROTLIENC)
diff --git a/plugins/gzip/README b/plugins/compress/README
similarity index 80%
rename from plugins/gzip/README
rename to plugins/compress/README
index b687cad..279de7e 100644
--- a/plugins/gzip/README
+++ b/plugins/compress/README
@@ -1,19 +1,19 @@
 What this plugin does:
 
 =====================
-this plugin gzips or deflates or deflates responses, whichever is applicable
+this plugin compresses responses, via gzip or brotli, whichever is applicable
 it can compress origin respones as well as cached responses
 
 installation:
 make && sudo make install
 
 if no makefile is present, you can compile it using
-    tsxs -o gzip.so *.cc
+    tsxs -o compress.so *.cc
 and then install it using
-    tsxs -i -o gzip.so
+    tsxs -i -o compress.so
 
 after installation, add a line to plugin.config:
-gzip.so
+compress.so
 
 in this case, the plugin will use a default behaviour:
 - use caching
@@ -22,12 +22,12 @@ in this case, the plugin will use a default behaviour:
 - no urls are disallowed from compression
 
 alternatively, a configuration can also be specified:
-gzip.so <path-to-plugin>/sample.gzip.config
+compress.so <path-to-plugin>/sample.compress.config
 
 after modifying plugin.config, restart traffic server (sudo traffic_ctl server restart)
 the configuration is re-read when a management update is given (sudo traffic_ctl config reload)
 
-a sample configuration (sample.gzip.config):
+a sample configuration (sample.compress.config):
 
 ######################################################################
 #flags and options are:
@@ -43,9 +43,7 @@ a sample configuration (sample.gzip.config):
 #
 # compressible-content-type: wildcard pattern for matching compressible content types
 #
-# disallow: wildcard pattern for disabling compression on urls
-#
-# allow: wildcard pattern for enabling compression on urls
+# allow: wildcard pattern for enabling compression on urls. prefix with ! to exclude from compression
 #
 # supported-algorithms: compression algorithms supported. comma separated algorithms. Default is gzip
 #
@@ -61,12 +59,8 @@ compressible-content-type *javascript*
 #disabling is possible too
 compressible-content-type !text/javascript
 
-disallow /notthis/*.js
-disallow /notthat*
-disallow */bla*
-
 allow */here/*
-#disabling is possible too. trying to deprecate disallow
+#disabling is possible too
 allow !*/nothere/*
 
 #supported algorithms
@@ -80,8 +74,8 @@ remove-accept-encoding true
 compressible-content-type text/*
 
 cache false
-disallow /notthis/*.js
-disallow /notthat*
+allow !/notthis/*.js
+allow !/notthat*
 
 allow /this/*.js
 allow !/notthat/*.css
diff --git a/plugins/gzip/gzip.cc b/plugins/compress/compress.cc
similarity index 94%
rename from plugins/gzip/gzip.cc
rename to plugins/compress/compress.cc
index 58ff490..34c1909 100644
--- a/plugins/gzip/gzip.cc
+++ b/plugins/compress/compress.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -112,10 +112,10 @@ data_alloc(int compression_type, int compression_algorithms)
 #if HAVE_BROTLI_ENCODE_H
   data->bstrm.br = nullptr;
   if (compression_type & COMPRESSION_TYPE_BROTLI) {
-    debug("gzip-transform: brotli compression. Create Brotli Encoder Instance.");
+    debug("brotli compression. Create Brotli Encoder Instance.");
     data->bstrm.br = BrotliEncoderCreateInstance(0, 0, 0);
     if (!data->bstrm.br) {
-      fatal("gzip-transform: ERROR: Brotli Encoder Instance Failed");
+      fatal("Brotli Encoder Instance Failed");
     }
     BrotliEncoderSetParameter(data->bstrm.br, BROTLI_PARAM_QUALITY, BROTLI_COMPRESSION_LEVEL);
     BrotliEncoderSetParameter(data->bstrm.br, BROTLI_PARAM_LGWIN, BROTLI_LGW);
@@ -330,7 +330,7 @@ gzip_transform_one(Data *data, const char *upstream_buffer, int64_t upstream_len
 
     if (data->zstrm.avail_out > 0) {
       if (data->zstrm.avail_in != 0) {
-        error("gzip-transform: ERROR: avail_in is (%d): should be 0", data->zstrm.avail_in);
+        error("gzip-transform: avail_in is (%d): should be 0", data->zstrm.avail_in);
       }
     }
   }
@@ -476,10 +476,11 @@ gzip_transform_finish(Data *data)
     }
 
     if (data->downstream_length != (int64_t)(data->zstrm.total_out)) {
-      error("gzip-transform: ERROR: output lengths don't match (%d, %ld)", data->downstream_length, data->zstrm.total_out);
+      error("gzip-transform: output lengths don't match (%d, %ld)", data->downstream_length, data->zstrm.total_out);
     }
+
     debug("gzip-transform: Finished gzip");
-    gzip_log_ratio(data->zstrm.total_in, data->downstream_length);
+    log_compression_ratio(data->zstrm.total_in, data->downstream_length);
   }
 }
 
@@ -504,7 +505,7 @@ brotli_transform_finish(Data *data)
   }
 
   debug("brotli-transform: Finished brotli");
-  gzip_log_ratio(data->bstrm.total_in, data->downstream_length);
+  log_compression_ratio(data->bstrm.total_in, data->downstream_length);
 }
 #endif
 
@@ -514,15 +515,15 @@ compress_transform_finish(Data *data)
 #if HAVE_BROTLI_ENCODE_H
   if (data->compression_type & COMPRESSION_TYPE_BROTLI && data->compression_algorithms & ALGORITHM_BROTLI) {
     brotli_transform_finish(data);
-    debug("brotli-transform: Brotli compression finish.");
+    debug("compress_transform_finish: brotli compression finish");
   } else
 #endif
     if ((data->compression_type & (COMPRESSION_TYPE_GZIP | COMPRESSION_TYPE_DEFLATE)) &&
         (data->compression_algorithms & (ALGORITHM_GZIP | ALGORITHM_DEFLATE))) {
     gzip_transform_finish(data);
-    debug("gzip-transform: Gzip compression finish.");
+    debug("compress_transform_finish: gzip compression finish");
   } else {
-    error("No Compression matched, shouldn't come here.");
+    error("No Compression matched, shouldn't come here");
   }
 }
 
@@ -598,7 +599,7 @@ compress_transform(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
   } else {
     switch (event) {
     case TS_EVENT_ERROR: {
-      debug("gzip_transform: TS_EVENT_ERROR starts");
+      debug("compress_transform: TS_EVENT_ERROR starts");
       TSVIO upstream_vio = TSVConnWriteVIOGet(contp);
       TSContCall(TSVIOContGet(upstream_vio), TS_EVENT_ERROR, upstream_vio);
     } break;
@@ -639,13 +640,6 @@ transformable(TSHttpTxn txnp, bool server, HostConfiguration *host_configuration
   int i, compression_acceptable, len;
   TSHttpStatus resp_status;
 
-  /*
-    // Before anything, check atleast one compression algorithm is supported
-    if (host_configuration->compression_algorithms() == ALGORITHM_DEFAULT) {
-      info("No compression algorithms configured");
-      return 0;
-    }
-  */
   if (server) {
     if (TS_SUCCESS != TSHttpTxnServerRespGet(txnp, &bufp, &hdr_loc)) {
       return 0;
@@ -891,7 +885,7 @@ transform_plugin(TSCont contp, TSEvent event, void *edata)
     break;
 
   default:
-    fatal("gzip transform unknown event");
+    fatal("compress transform unknown event");
   }
 
   TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
@@ -900,7 +894,7 @@ transform_plugin(TSCont contp, TSEvent event, void *edata)
 }
 
 /**
- * This handles gzip request
+ * This handles a compress request
  * 1. Reads the client request header
  * 2. For global plugin, get host configuration from global config
  *    For remap plugin, get host configuration from configs populated through remap
@@ -924,7 +918,7 @@ handle_request(TSHttpTxn txnp, Configuration *config)
     bool allowed = false;
 
     if (hc->enabled()) {
-      if (hc->has_disallows() || hc->has_allows()) {
+      if (hc->has_allows()) {
         int url_len;
         char *url = TSHttpTxnEffectiveUrlStringGet(txnp, &url_len);
         allowed   = hc->is_url_allowed(url, url_len);
@@ -938,7 +932,7 @@ handle_request(TSHttpTxn txnp, Configuration *config)
 
       TSContDataSet(transform_contp, (void *)hc);
 
-      info("Kicking off gzip plugin for request");
+      info("Kicking off compress plugin for request");
       normalize_accept_encoding(txnp, req_buf, req_loc);
       TSHttpTxnHookAdd(txnp, TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, transform_contp);
       TSHttpTxnHookAdd(txnp, TS_HTTP_TXN_CLOSE_HOOK, transform_contp); // To release the config
@@ -956,12 +950,12 @@ transform_global_plugin(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edat
 
   switch (event) {
   case TS_EVENT_HTTP_READ_REQUEST_HDR:
-    // Handle gzip request and use the global configs
+    // Handle compress request and use the global configs
     handle_request(txnp, nullptr);
     break;
 
   default:
-    fatal("gzip global transform unknown event");
+    fatal("compress global transform unknown event");
   }
 
   TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
@@ -1005,13 +999,13 @@ TSPluginInit(int argc, const char *argv[])
   const char *config_path = nullptr;
 
   if (argc > 2) {
-    fatal("the gzip plugin does not accept more than 1 plugin argument");
+    fatal("the compress plugin does not accept more than 1 plugin argument");
   } else {
     config_path = TSstrdup(2 == argc ? argv[1] : "");
   }
 
   if (!register_plugin()) {
-    fatal("The gzip plugin failed to register");
+    fatal("the compress plugin failed to register");
   }
 
   info("TSPluginInit %s", argv[0]);
@@ -1048,20 +1042,20 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
     return TS_ERROR;
   }
 
-  info("The gzip plugin is successfully initialized");
+  info("The compress plugin is successfully initialized");
   return TS_SUCCESS;
 }
 
 TSReturnCode
 TSRemapNewInstance(int argc, char *argv[], void **instance, char *errbuf, int errbuf_size)
 {
-  info("Instantiating a new gzip plugin remap rule");
-  info("Reading gzip config from file = %s", argv[2]);
+  info("Instantiating a new compress plugin remap rule");
+  info("Reading config from file = %s", argv[2]);
 
   const char *config_path = nullptr;
 
   if (argc > 4) {
-    fatal("The gzip plugin does not accept more than one plugin argument");
+    fatal("The compress plugin does not accept more than one plugin argument");
   } else {
     config_path = TSstrdup(3 == argc ? argv[2] : "");
   }
@@ -1088,9 +1082,9 @@ TSRemapDoRemap(void *instance, TSHttpTxn txnp, TSRemapRequestInfo *rri)
   if (nullptr == instance) {
     info("No Rules configured, falling back to default");
   } else {
-    info("Remap Rules configured for gzip");
+    info("Remap Rules configured for compress");
     Configuration *config = (Configuration *)instance;
-    // Handle gzip request and use the configs populated from remap instance
+    // Handle compress request and use the configs populated from remap instance
     handle_request(txnp, config);
   }
   return TSREMAP_NO_REMAP;
diff --git a/plugins/gzip/configuration.cc b/plugins/compress/configuration.cc
similarity index 93%
rename from plugins/gzip/configuration.cc
rename to plugins/compress/configuration.cc
index 3d917a5..e3ac75b 100644
--- a/plugins/gzip/configuration.cc
+++ b/plugins/compress/configuration.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -102,7 +102,6 @@ enum ParserState {
   kParseRemoveAcceptEncoding,
   kParseEnable,
   kParseCache,
-  kParseDisallow,
   kParseFlush,
   kParseAllow,
   kParseMinimumContentLength
@@ -125,12 +124,6 @@ HostConfiguration::update_defaults()
 }
 
 void
-HostConfiguration::add_disallow(const std::string &disallow)
-{
-  disallows_.push_back(disallow);
-}
-
-void
 HostConfiguration::add_allow(const std::string &allow)
 {
   allows_.push_back(allow);
@@ -175,14 +168,6 @@ bool
 HostConfiguration::is_url_allowed(const char *url, int url_len)
 {
   string surl(url, url_len);
-  if (has_disallows()) {
-    for (StringContainer::iterator it = disallows_.begin(); it != disallows_.end(); ++it) {
-      if (fnmatch(it->c_str(), surl.c_str(), 0) == 0) {
-        info("url [%s] disabled for compression, matched disallow pattern [%s]", surl.c_str(), it->c_str());
-        return false;
-      }
-    }
-  }
   if (has_allows()) {
     for (StringContainer::iterator allow_it = allows_.begin(); allow_it != allows_.end(); ++allow_it) {
       const char *match_string = allow_it->c_str();
@@ -199,7 +184,7 @@ HostConfiguration::is_url_allowed(const char *url, int url_len)
     info("url [%s] disabled for compression, did not match any allows pattern", surl.c_str());
     return false;
   }
-  info("url [%s] enabled for compression, did not match and disallow pattern ", surl.c_str());
+  info("url [%s] enabled for compression, did not match any pattern", surl.c_str());
   return true;
 }
 
@@ -366,8 +351,6 @@ Configuration::Parse(const char *path)
           state = kParseEnable;
         } else if (token == "cache") {
           state = kParseCache;
-        } else if (token == "disallow") {
-          state = kParseDisallow;
         } else if (token == "flush") {
           state = kParseFlush;
         } else if (token == "supported-algorithms") {
@@ -400,10 +383,6 @@ Configuration::Parse(const char *path)
         current_host_configuration->set_cache(token == "true");
         state = kParseStart;
         break;
-      case kParseDisallow:
-        current_host_configuration->add_disallow(token);
-        state = kParseStart;
-        break;
       case kParseFlush:
         current_host_configuration->set_flush(token == "true");
         state = kParseStart;
diff --git a/plugins/gzip/configuration.h b/plugins/compress/configuration.h
similarity index 95%
rename from plugins/gzip/configuration.h
rename to plugins/compress/configuration.h
index 55fe54c..dcb9ba2 100644
--- a/plugins/gzip/configuration.h
+++ b/plugins/compress/configuration.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -100,11 +100,6 @@ public:
   {
     return host_;
   }
-  bool
-  has_disallows() const
-  {
-    return !disallows_.empty();
-  }
 
   bool
   has_allows() const
@@ -123,7 +118,6 @@ public:
   }
 
   void update_defaults();
-  void add_disallow(const std::string &disallow);
   void add_allow(const std::string &allow);
   void add_compressible_content_type(const std::string &content_type);
   void add_compressible_status_codes(std::string &status_codes);
@@ -159,7 +153,6 @@ private:
   int ref_count_;
 
   StringContainer compressible_content_types_;
-  StringContainer disallows_;
   StringContainer allows_;
   // maintain backwards compatibility/usability out of the box
   std::set<TSHttpStatus> compressible_status_codes_ = {TS_HTTP_STATUS_OK, TS_HTTP_STATUS_PARTIAL_CONTENT,
diff --git a/plugins/gzip/debug_macros.h b/plugins/compress/debug_macros.h
similarity index 97%
rename from plugins/gzip/debug_macros.h
rename to plugins/compress/debug_macros.h
index 3bc0cc2..3104052 100644
--- a/plugins/gzip/debug_macros.h
+++ b/plugins/compress/debug_macros.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -26,7 +26,7 @@
 
 #include <ts/ts.h>
 
-#define TAG "gzip"
+#define TAG "compress"
 
 #define debug(fmt, args...)                                                             \
   do {                                                                                  \
diff --git a/plugins/gzip/misc.cc b/plugins/compress/misc.cc
similarity index 97%
rename from plugins/gzip/misc.cc
rename to plugins/compress/misc.cc
index 646187d..9f572d3 100644
--- a/plugins/gzip/misc.cc
+++ b/plugins/compress/misc.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -151,7 +151,7 @@ register_plugin()
 {
   TSPluginRegistrationInfo info;
 
-  info.plugin_name   = (char *)"gzip";
+  info.plugin_name   = (char *)"compress";
   info.vendor_name   = (char *)"Apache Software Foundation";
   info.support_email = (char *)"dev@trafficserver.apache.org";
 
@@ -162,7 +162,7 @@ register_plugin()
 }
 
 void
-gzip_log_ratio(int64_t in, int64_t out)
+log_compression_ratio(int64_t in, int64_t out)
 {
   if (in) {
     info("Compressed size %" PRId64 " (bytes), Original size %" PRId64 ", ratio: %f", out, in, ((float)(in - out) / in));
diff --git a/plugins/gzip/misc.h b/plugins/compress/misc.h
similarity index 96%
rename from plugins/gzip/misc.h
rename to plugins/compress/misc.h
index ba1a2ff..af0164c 100644
--- a/plugins/gzip/misc.h
+++ b/plugins/compress/misc.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Transforms content using gzip or deflate
+  Transforms content using gzip, deflate or brotli
 
   @section license License
 
@@ -96,4 +96,4 @@ void restore_accept_encoding(TSHttpTxn txnp, TSMBuffer reqp, TSMLoc hdr_loc, con
 const char *init_hidden_header_name();
 int check_ts_version();
 int register_plugin();
-void gzip_log_ratio(int64_t in, int64_t out);
+void log_compression_ratio(int64_t in, int64_t out);
diff --git a/plugins/gzip/sample.gzip.config b/plugins/compress/sample.compress.config
similarity index 88%
rename from plugins/gzip/sample.gzip.config
rename to plugins/compress/sample.compress.config
index d8ff721..61151a4 100644
--- a/plugins/gzip/sample.gzip.config
+++ b/plugins/compress/sample.compress.config
@@ -18,7 +18,7 @@
 ######################################################################
 #flags and options are:
 #
-# enable-gzip: default true, set true/false to enable/disable plugin for specific host
+# enabled: default true, set true/false to enable/disable plugin for specific host
 #
 # remove-accept-encoding: this sets if the plugin should hide the accept encoding from origin servers
 # - to ease the load on the origins
@@ -29,7 +29,8 @@
 #
 # compressible-content-type: wildcard pattern for matching compressible content types
 #
-# disallow: wildcard pattern for disabling compression on urls
+# allow: wildcard pattern for allow/disallowing compression on urls
+# - prefix pattern with ! to disallow
 #
 # compressible-status-code: a comma separated list of status codes in which to enable compression
 #
@@ -46,9 +47,9 @@ cache false
 compressible-content-type text/*
 compressible-content-type *javascript*
 compressible-status-code 200
-disallow /notthis/*.js
-disallow /notthat*
-disallow */bla*
+allow !/notthis/*.js
+allow !/notthat*
+allow !*/bla*
 
 minimum-content-length 1024
 
@@ -65,5 +66,5 @@ compressible-status-code 200,206,409
 minimum-content-length 1024
 
 cache false
-disallow /notthis/*.js
-disallow /notthat*
+allow /this/*.js
+allow !/notthat*

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.