This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch 10.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/10.2.x by this push:
new 34edd76543 compress; Fixes a regression in protocol parser (#13107)
34edd76543 is described below
commit 34edd765431fc091b303bcf12ceba6dfe40c06be
Author: Leif Hedstrom <[email protected]>
AuthorDate: Tue Apr 21 09:59:19 2026 -0600
compress; Fixes a regression in protocol parser (#13107)
* compress; Fixes a regression in protocol parser
This is a regression I think, in 10.2, where we get warnings like
...(Parse)> (compress) WARNING: failed to interpret "br,gzip" at line 2
Also address copilots concerns
* Fix failing autests, after our fixes. This was broken on master before
too.
(cherry picked from commit 450d3f3bfe2f0853ed98738e6783287a51809176)
---
plugins/compress/configuration.cc | 4 ++--
plugins/compress/configuration.h | 4 ++--
tests/gold_tests/pluginTest/compress/compress.gold | 8 ++++----
tests/gold_tests/pluginTest/compress/compress_userver.gold | 2 +-
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/plugins/compress/configuration.cc
b/plugins/compress/configuration.cc
index 3ba265d284..793a04f4c2 100644
--- a/plugins/compress/configuration.cc
+++ b/plugins/compress/configuration.cc
@@ -194,7 +194,7 @@ isCommaOrSpace(int ch)
}
void
-HostConfiguration::add_compression_algorithms(swoc::TextView line)
+HostConfiguration::add_compression_algorithms(swoc::TextView &line)
{
compression_algorithms_ = ALGORITHM_DEFAULT; // remove the default gzip.
for (;;) {
@@ -228,7 +228,7 @@
HostConfiguration::add_compression_algorithms(swoc::TextView line)
}
void
-HostConfiguration::add_compressible_status_codes(swoc::TextView line)
+HostConfiguration::add_compressible_status_codes(swoc::TextView &line)
{
compressible_status_codes_.clear();
diff --git a/plugins/compress/configuration.h b/plugins/compress/configuration.h
index bc54aae63d..b3aad8faf2 100644
--- a/plugins/compress/configuration.h
+++ b/plugins/compress/configuration.h
@@ -195,11 +195,11 @@ public:
void update_defaults();
void add_allow(swoc::TextView allow);
void add_compressible_content_type(swoc::TextView
content_type);
- void add_compressible_status_codes(swoc::TextView
status_codes);
+ void add_compressible_status_codes(swoc::TextView
&status_codes);
[[nodiscard]] bool is_url_allowed(const char *url, int url_len);
[[nodiscard]] bool is_content_type_compressible(const char *content_type,
int content_type_length);
[[nodiscard]] bool is_status_code_compressible(const TSHttpStatus
status_code) const;
- void add_compression_algorithms(swoc::TextView algorithms);
+ void add_compression_algorithms(swoc::TextView &algorithms);
[[nodiscard]] int compression_algorithms();
void set_range_request(swoc::TextView token);
diff --git a/tests/gold_tests/pluginTest/compress/compress.gold
b/tests/gold_tests/pluginTest/compress/compress.gold
index 223c32eb70..c4ae63b6aa 100644
--- a/tests/gold_tests/pluginTest/compress/compress.gold
+++ b/tests/gold_tests/pluginTest/compress/compress.gold
@@ -174,8 +174,8 @@
> Accept-Encoding: gzip, deflate, sdch, br, zstd
< HTTP/1.1 200 OK
< Content-Type: text/javascript
-< Content-Encoding: zstd
< Vary: Accept-Encoding
+< Content-Encoding: zstd
< Content-Length: 64
===
> GET http://ae-4/obj4 HTTP/1.1
@@ -209,8 +209,8 @@
> Accept-Encoding: zstd
< HTTP/1.1 200 OK
< Content-Type: text/javascript
-< Content-Encoding: zstd
< Vary: Accept-Encoding
+< Content-Encoding: zstd
< Content-Length: 64
===
> GET http://ae-5/obj5 HTTP/1.1
@@ -218,8 +218,8 @@
> Accept-Encoding: gzip, deflate, sdch, br, zstd
< HTTP/1.1 200 OK
< Content-Type: text/javascript
-< Content-Encoding: zstd
< Vary: Accept-Encoding
+< Content-Encoding: zstd
< Content-Length: 64
===
> GET http://ae-5/obj5 HTTP/1.1
@@ -253,8 +253,8 @@
> Accept-Encoding: zstd
< HTTP/1.1 200 OK
< Content-Type: text/javascript
-< Content-Encoding: zstd
< Vary: Accept-Encoding
+< Content-Encoding: zstd
< Content-Length: 64
===
> GET http://ae-0/obj0 HTTP/1.1
diff --git a/tests/gold_tests/pluginTest/compress/compress_userver.gold
b/tests/gold_tests/pluginTest/compress/compress_userver.gold
index 6c7a1e49f9..4a705adc91 100644
--- a/tests/gold_tests/pluginTest/compress/compress_userver.gold
+++ b/tests/gold_tests/pluginTest/compress/compress_userver.gold
@@ -36,7 +36,7 @@
0/gzip;q=-0.1
0/aaa, gzip;q=0.666, bbb
0/ br ; q=0.666, bbb
-0/aaa, gzip;q=0.666 ,
+0/aaa, gzip;q=0.666 ,
3/gzip
vary-no-accept-encoding
0/compress, identity