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

Method add_compression_algorithms

plugins/compress/configuration.cc:224–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void
225HostConfiguration::add_compression_algorithms(string &line)
226{
227 compression_algorithms_ = ALGORITHM_DEFAULT; // remove the default gzip.
228 for (;;) {
229 string token = extractFirstToken(line, isCommaOrSpace);
230 if (token.empty()) {
231 break;
232 } else if (token == "br") {
233#ifdef HAVE_BROTLI_ENCODE_H
234 compression_algorithms_ |= ALGORITHM_BROTLI;
235#else
236 error("supported-algorithms: brotli support not compiled in.");
237#endif
238 } else if (token == "gzip") {
239 compression_algorithms_ |= ALGORITHM_GZIP;
240 } else if (token == "deflate") {
241 compression_algorithms_ |= ALGORITHM_DEFLATE;
242 } else {
243 error("Unknown compression type. Supported compression-algorithms <br,gzip,deflate>.");
244 }
245 }
246}
247
248void
249HostConfiguration::add_compressible_status_codes(string &line)

Callers 1

ParseMethod · 0.80

Calls 3

extractFirstTokenFunction · 0.85
errorFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected