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

Method LogFilterString

src/proxy/logging/LogFilter.cc:384–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384LogFilterString::LogFilterString(const char *name, LogField *field, LogFilter::Action action, LogFilter::Operator oper,
385 char *values)
386 : LogFilter(name, field, action, oper)
387{
388 // parse the comma-separated list of values and construct array
389 //
390 char **val_array = nullptr;
391 size_t i = 0;
392 SimpleTokenizer tok(values, ',');
393 size_t n = tok.getNumTokensRemaining();
394 if (n) {
395 val_array = new char *[n];
396 char *t;
397 while (t = tok.getNext(), t != nullptr) {
398 val_array[i++] = t;
399 }
400 if (i < n) {
401 Warning("There were invalid values in the definition of filter %s"
402 "only %zu out of %zu values will be used",
403 name, i, n);
404 }
405 }
406 _setValues(i, val_array);
407 delete[] val_array;
408}
409
410LogFilterString::LogFilterString(const char *name, LogField *field, LogFilter::Action action, LogFilter::Operator oper,
411 size_t num_values, char **value)

Callers

nothing calls this directly

Calls 2

getNumTokensRemainingMethod · 0.80
getNextMethod · 0.45

Tested by

no test coverage detected