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

Function recordRangeCheck

src/records/RecUtils.cc:398–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398bool
399recordRangeCheck(const char *pattern, const char *value)
400{
401 char *p = const_cast<char *>(pattern);
402 Tokenizer dashTok("-");
403
404 if (recordRegexCheck("^[0-9]+$", value)) {
405 while (*p != '[') {
406 p++;
407 } // skip to '['
408 if (dashTok.Initialize(++p, COPY_TOKS) == 2) {
409 int l_limit = atoi(dashTok[0]);
410 int u_limit = atoi(dashTok[1]);
411 int val = atoi(value);
412 if (val >= l_limit && val <= u_limit) {
413 return true;
414 }
415 }
416 }
417 return false;
418}
419
420bool
421recordIPCheck(const char *pattern, const char *value)

Callers 2

recordIPCheckFunction · 0.85
RecordValidityCheckFunction · 0.85

Calls 2

recordRegexCheckFunction · 0.85
InitializeMethod · 0.45

Tested by

no test coverage detected