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

Method NewEntry

src/proxy/ControlMatcher.cc:188–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186//
187template <class Data, class MatchResult>
188Result
189HostMatcher<Data, MatchResult>::NewEntry(matcher_line *line_info)
190{
191 Data *cur_d;
192 Result error = Result::ok();
193 char *match_data;
194
195 // Make sure space has been allocated
196 ink_assert(num_el >= 0);
197 ink_assert(array_len >= 0);
198
199 // Make sure we do not overrun the array;
200 ink_assert(num_el < array_len);
201
202 match_data = line_info->line[1][line_info->dest_entry];
203
204 // Make sure that the line_info is not bogus
205 ink_assert(line_info->dest_entry < MATCHER_MAX_TOKENS);
206 ink_assert(match_data != nullptr);
207
208 // Remove our consumed label from the parsed line
209 line_info->line[0][line_info->dest_entry] = nullptr;
210 line_info->num_el--;
211
212 // Fill in the parameter info
213 cur_d = data_array + num_el;
214 error = cur_d->Init(line_info);
215 if (error.failed()) {
216 // There was a problem so undo the effects this function
217 new (cur_d) Data(); // reconstruct
218 } else {
219 // Fill in the matching info
220 host_lookup->NewEntry(match_data, (line_info->type == MATCH_DOMAIN) ? true : false, cur_d);
221 num_el++;
222 }
223
224 return error;
225}
226
227/*************************************************************
228 * End class HostMatcher

Callers 1

BuildTableFromStringMethod · 0.45

Calls 8

ats_freeFunction · 0.85
failedMethod · 0.80
emplaceMethod · 0.80
InitMethod · 0.45
findMethod · 0.45
endMethod · 0.45
loadMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected