void CacheHostMatcher::Match(RequestData* rdata, Result* result) Searches our tree and updates argresult for each element matching arg hostname
| 105 | // arg hostname |
| 106 | // |
| 107 | void |
| 108 | CacheHostMatcher::Match(const char *rdata, int rlen, CacheHostResult *result) const |
| 109 | { |
| 110 | void *opaque_ptr; |
| 111 | CacheHostRecord *data_ptr; |
| 112 | bool r; |
| 113 | |
| 114 | // Check to see if there is any work to do before making |
| 115 | // the string copy |
| 116 | if (num_el <= 0) { |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | if (rlen == 0) { |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | std::string_view data{rdata, static_cast<size_t>(rlen)}; |
| 125 | HostLookupState s; |
| 126 | |
| 127 | r = host_lookup->MatchFirst(data, &s, &opaque_ptr); |
| 128 | |
| 129 | while (r == true) { |
| 130 | ink_assert(opaque_ptr != nullptr); |
| 131 | data_ptr = static_cast<CacheHostRecord *>(opaque_ptr); |
| 132 | data_ptr->UpdateMatch(result); |
| 133 | |
| 134 | r = host_lookup->MatchNext(&s, &opaque_ptr); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | // |
| 139 | // char* CacheHostMatcher::NewEntry(bool domain_record, |
no test coverage detected