MCPcopy Create free account
hub / github.com/apache/trafficserver / strip_ae_value

Function strip_ae_value

plugins/compress/misc.cc:50–77  ·  view source on GitHub ↗

Strips parameters from value. Returns cleared TextView if a q=f parameter present, where f is less than or equal to zero.

Source from the content-addressed store, hash-verified

48// zero.
49//
50void
51strip_ae_value(swoc::TextView &value)
52{
53 swoc::TextView compression{value.take_prefix_at(';')};
54 compression.trim(" \t");
55 while (value) {
56 swoc::TextView param{value.take_prefix_at(';')};
57 swoc::TextView name{param.take_prefix_at('=')};
58 name.trim(" \t");
59 if (strcasecmp("q", name) == 0) {
60 // If q value is valid and is zero, suppress compression types.
61 param.trim(" \t");
62 if (param) {
63 swoc::TextView whole{param.take_prefix_at('.')};
64 whole.ltrim(" \t");
65 if ("0" == whole) {
66 param.trim('0');
67 if (!param) {
68 // Suppress compression type.
69 compression.clear();
70 break;
71 }
72 }
73 }
74 }
75 }
76 value = compression;
77}
78} // end anonymous namespace
79
80void

Callers 1

Calls 3

strcasecmpFunction · 0.85
take_prefix_atMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected